Package Declaration
|
- Add missing package declaration or correct package
declaration
- Move compilation unit to package that corresponds to the
package declaration
|
Imports
|
- Remove unused, unresolvable or non-visible import
- Invoke 'Organize imports' on problems in imports
- Convert static field accesses and static methods to use a static import
|
Types
|
- Create new class, interface, enum, annotation or type
variable for references to types that can not be resolved
- Change visibility for types that are accessed but not visible
- Rename to a similar type for references to types that can not
be resolved
- Add import statement for types that can not be resolved but
exist in the project
- Add explicit import statement for ambiguous type references
(two import-on-demands for the same type)
- If the type name is not matching with the compilation unit
name either rename the type or rename the compilation unit
- Remove unused private types
- Add missing type annotation attributes
|
Constructors
|
- Create new constructor for references to constructors that
can not be resolved (this, super or new class creation)
- Reorder, add or remove arguments for constructor references
that mismatch parameters
- Change method with constructor name to constructor (remove
return type)
- Change visibility for constructors that are accessed but not
visible
- Remove unused private constructor
- Create constructor when super call of the implicit default
constructor is undefined, not visible or throws an exception
- If type contains unimplemented methods, change type modifier
to 'abstract' or add the method to implement
|
Methods
|
- Create new method for references to methods that can not be
resolved
- Rename to a similar method for references to methods that can
not be resolved
- Reorder or remove arguments for method references that
mismatch parameters
- Correct access (visibility, static) of referenced methods
- Remove unused private methods
- Correct return type for methods that have a missing return
type or where the return type does not match the return statement
- Add return statement if missing
- For non-abstract methods with no body change to 'abstract' or
add body
- For an abstract method in a non-abstract type remove abstract
modifier of the method or make type abstract
- For an abstract/native method with body remove the abstract
or native modifier or remove body
- Change method access to 'static' if method is invoked inside
a constructor invocation (super, this)
- Change method access to default access to avoid emulated
method access
- Add 'synchronized' modifier
- Override hashCode()
- Open the 'Generate hashCode() and equals()' wizard
- Create abstract methods. Improved the existing quick fix to
create missing methods to create abstract method declarations in
an abstract class.
|
Fields and variables
|
- Correct access (visibility, static) of referenced fields
- Create new fields, parameters, local variables or constants
for references to variables that can not be resolved
- Rename to a variable with similar name for references that
can not be resolved
- Remove unused private fields
- Correct non-static access of static fields
- Add 'final' modifier to local variables accessed in outer
types
- Change field access to default access to avoid emulated
method access
- Change local variable type to fix a type mismatch
- Initialize a variable that has not been initialized
- Create getter and setters for invisible or unused fields
- Create loop variable to correct an incomplete enhanced 'for' loop by adding the type of the loop variable
|
Exception Handling
|
- Remove unneeded catch block
- Remove unneeded exceptions from a multi-catch clause (1.7 or higher)
- Handle uncaught exception by surrounding with try/catch or
adding catch block to a surrounding try block
- Handle uncaught exceptions by surrounding with try/multi-catch or
adding exceptions to existing catch clause (1.7 or higher)
- Handle uncaught exception by adding a throw declaration to
the parent method or by generalize an existing throw declaration
|
Build Path Problems
|
- Add a missing JAR or library for an unresolvable type
- Open the build path dialog for access restriction problems or
missing binary classes.
- Change project compliance and JRE to 1.5
- Change workspace compliance and JRE to 1.5
- Change project compliance and JRE to 10 on var type (10 or higher)
- Change project compliance and JRE to 11
- Change project compliance and JRE to 12
|
Others
|
- Add cast or change cast to fix type mismatches
- Let a type implement an interface to fix type mismatches
- Add type arguments to raw references
- Complete switch statements over enums
- Remove dead code
- Insert '//$FALL-THROUGH$'
- Insert null check
- For non-NLS strings open the NLS wizard or mark as non-NLS
- Add missing @Override, @Deprecated annotations
- Add missing Javadoc comments
- Add missing Javadoc tags
- Suppress a warning using @SuppressWarnings
- Throw the allocated object
- Return the allocated object
- Add @SafeVarargs annotation for heap pollution warnings (1.7 or higher)
- Remove invalid @SafeVarargs annotations (1.7 or higher)
- Remove redundant type arguments (1.7 or higher)
- Add inferred type arguments (1.5 and 1.6)
- Remove unused type parameter (1.5 or higher)
- Configure problem severity
- Add @NonNullByDefault annotation on package when the Missing '@NonNullByDefault' annotation on package warning is enabled
- Add missing module dependency (requires statement) on import statements (9 or higher)
- Add missing import statement and module dependency (requires statement) on unresolved type (9 or higher)
- Create new Class or Interface for an unresolved type on service provider in a provides directive (9 or higher)
- Move Classpath entry to Modulepath for unresolved module on requires statement (9 or higher)
- Create new Class or Integer or Enum or Annotation for Non-existing or empty package on exports directive (9 or higher)
- Open Compiler Compliance property page on JRE Compiler Compilance problem marker
- Create new service provider method in case of invalid service provider implementation used in module-info.java (9 or higher)
- Change "Enable preview features" option to true on Compiler preferences page (12 or higher)
- Configure problem severity of "Enable preview features" option on Compiler preferences page (12 or higher)
- Add 'default' case to enhanced switch statement (12 or higher)
- Add missing case statements for enhanced switch statement (12 or higher)
- Add 'default' case to switch expression (12 or higher)
- Add missing case statements for switch expression (12 or higher)
- Split switch case labels into separate case statements (12 or higher)
- Create a public constructor on a Service defined in module-info.java whose no-arg constructor is not visible, or is non-existent (9 or higher)
- Change the visibility of the constructor of a service defined in module-info.java to public (9 or higher)
|
Duplicate Code
|
- Replace (X && Y) || (!X && Z) by X ? Y: Z
- Use '==' or '^' on booleans
- Merge conditions of if/else if/else that have the same blocks
- Remove redundant end of block with jump statement
- Redundant if condition
|
Unnecessary code
|
- Use Objects.hash() (1.7 or higher)
- Use String.join() when possible (1.8 or higher)
- Use Arrays.fill() when possible
- Evaluate without null check
- Use Autoboxing (1.5 or higher)
- Use Unboxing (1.5 or higher)
- Push down negation
- Double negation
- Remove redundant comparison statement
- Remove redundant super() call in constructor
- Operate on Maps directly
- Initialize collection at creation
- ...
|