Skip to content

Commit 9f18089

Browse files
committed
Fix unused import
As there are such cases often I raised it to error and enable the save action.
1 parent 1901a3c commit 9f18089

File tree

3 files changed

+115
-4
lines changed

3 files changed

+115
-4
lines changed

org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.core.prefs

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
3+
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
4+
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
5+
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
6+
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
7+
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
8+
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
9+
org.eclipse.jdt.core.compiler.annotation.notowning=org.eclipse.jdt.annotation.NotOwning
10+
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
11+
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
12+
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
13+
org.eclipse.jdt.core.compiler.annotation.owning=org.eclipse.jdt.annotation.Owning
14+
org.eclipse.jdt.core.compiler.annotation.resourceanalysis=disabled
215
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
316
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
417
org.eclipse.jdt.core.compiler.codegen.targetPlatform=23
@@ -7,10 +20,106 @@ org.eclipse.jdt.core.compiler.compliance=23
720
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
821
org.eclipse.jdt.core.compiler.debug.localVariable=generate
922
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
23+
org.eclipse.jdt.core.compiler.problem.APILeak=warning
24+
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
25+
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
1026
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
27+
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
28+
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
29+
org.eclipse.jdt.core.compiler.problem.deadCode=warning
30+
org.eclipse.jdt.core.compiler.problem.deprecation=warning
31+
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
32+
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
33+
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
34+
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
1135
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
1236
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
37+
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
38+
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
39+
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
40+
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
41+
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
42+
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
43+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
44+
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
45+
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
46+
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
47+
org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract=warning
48+
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
49+
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
50+
org.eclipse.jdt.core.compiler.problem.insufficientResourceAnalysis=warning
51+
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
52+
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
53+
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
54+
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
55+
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
56+
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
57+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
58+
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
59+
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
60+
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
61+
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
62+
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
63+
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
64+
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
65+
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
66+
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
67+
org.eclipse.jdt.core.compiler.problem.nullReference=warning
68+
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
69+
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
70+
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
71+
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
72+
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
73+
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
74+
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
75+
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
76+
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
77+
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
78+
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
79+
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
80+
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
81+
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
82+
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
1383
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
84+
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
85+
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
86+
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
87+
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
88+
org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
89+
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
90+
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
91+
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
92+
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
93+
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
94+
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
95+
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
96+
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
97+
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=ignore
98+
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
99+
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
100+
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
101+
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
102+
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
103+
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
104+
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
105+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
106+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
107+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
108+
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
109+
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
110+
org.eclipse.jdt.core.compiler.problem.unusedImport=error
111+
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
112+
org.eclipse.jdt.core.compiler.problem.unusedLambdaParameter=warning
113+
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
114+
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
115+
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
116+
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
117+
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
118+
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
119+
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
120+
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
121+
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
122+
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
14123
org.eclipse.jdt.core.compiler.release=disabled
15124
org.eclipse.jdt.core.compiler.source=23
16125
org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns=false

org.eclipse.jdt.core.javac/.settings/org.eclipse.jdt.ui.prefs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ sp_cleanup.no_string_creation=false
6262
sp_cleanup.no_super=false
6363
sp_cleanup.number_suffix=false
6464
sp_cleanup.objects_equals=false
65-
sp_cleanup.on_save_use_additional_actions=false
65+
sp_cleanup.on_save_use_additional_actions=true
6666
sp_cleanup.one_if_rather_than_duplicate_blocks_that_fall_through=false
6767
sp_cleanup.operand_factorization=false
6868
sp_cleanup.organize_imports=true
@@ -104,6 +104,7 @@ sp_cleanup.remove_unused_private_methods=true
104104
sp_cleanup.remove_unused_private_types=true
105105
sp_cleanup.replace_deprecated_calls=false
106106
sp_cleanup.return_expression=false
107+
sp_cleanup.simplify_boolean_if_else=false
107108
sp_cleanup.simplify_lambda_expression_and_method_ref=false
108109
sp_cleanup.single_used_field=false
109110
sp_cleanup.sort_members=false
@@ -122,6 +123,8 @@ sp_cleanup.system_property=false
122123
sp_cleanup.system_property_boolean=false
123124
sp_cleanup.system_property_file_encoding=false
124125
sp_cleanup.system_property_file_separator=false
126+
sp_cleanup.system_property_javaspecversion=false
127+
sp_cleanup.system_property_javaversion=false
125128
sp_cleanup.system_property_line_separator=false
126129
sp_cleanup.system_property_path_separator=false
127130
sp_cleanup.ternary_operator=false
@@ -130,7 +133,7 @@ sp_cleanup.unlooped_while=false
130133
sp_cleanup.unreachable_block=false
131134
sp_cleanup.use_anonymous_class_creation=false
132135
sp_cleanup.use_autoboxing=false
133-
sp_cleanup.use_blocks=true
136+
sp_cleanup.use_blocks=false
134137
sp_cleanup.use_blocks_only_for_return_and_throw=false
135138
sp_cleanup.use_directly_map_method=false
136139
sp_cleanup.use_lambda=true

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023, 2024 Red Hat, Inc. and others.
2+
* Copyright (c) 2023, 2025 Red Hat, Inc. and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -51,7 +51,6 @@
5151
import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
5252
import com.sun.tools.javac.tree.DCTree.DCDocComment;
5353
import com.sun.tools.javac.tree.JCTree;
54-
import com.sun.tools.javac.tree.TreeInfo;
5554
import com.sun.tools.javac.tree.JCTree.JCAnnotatedType;
5655
import com.sun.tools.javac.tree.JCTree.JCAnnotation;
5756
import com.sun.tools.javac.tree.JCTree.JCAnyPattern;

0 commit comments

Comments
 (0)