Inspectopedia Help

Declaration redundancy

'final' method in 'final' class   New in this release

Reports final methods in final classes.

'protected' member in 'final' class   New in this release

Reports protected members in finalclasses.

Access static member via instance reference   New in this release

Reports references to static methods and fields via a class instance rather than the class itself.

Declaration access can be weaker   New in this release

Reports fields, methods or classes that may have their access modifier narrowed down.

Declaration can have 'final' modifier   New in this release

Reports fields, methods, or classes that may have the final modifier added to their declarations.

Default annotation parameter value   New in this release

Reports annotation parameters that are assigned to their default value.

Duplicate throws   New in this release

Reports duplicate exceptions in a method throws list.

Empty class initializer   New in this release

Reports empty class initializer blocks.

Functional expression can be folded   New in this release

Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.

Method always returns the same value   New in this release

Reports methods and method hierarchies that always return the same constant.

Method can be made 'void'   New in this release

Reports methods whose return values are never used when called.

Method parameter always has the same value   New in this release

Reports method parameters that always have the same constant value.

Redundant 'close()'   New in this release

Reports unnecessary calls to close() at the end of a try-with-resources block and suggests removing them.

Redundant 'requires' directive in module-info   New in this release

Reports redundant requires directives in Java Platform Module System module-info.java files.

Redundant 'throws' clause   New in this release

Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.

Redundant lambda parameter types   New in this release

Reports lambda formal parameter types that are redundant because they can be inferred from the context.

Redundant record constructor   New in this release

Reports redundant constructors declared inside Java records.

Trivial usage of functional expression   New in this release

Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class.

Unnecessary module dependency   New in this release

Reports dependencies on modules that are not used.

Unused declaration  

Reports classes, methods, or fields that are not used or unreachable from the entry points.

Unused label   New in this release

Reports labels that are not targets of any break or continue statements.

Unused library   New in this release

Reports libraries attached to the specified inspection scope that are not used directly in code.

Variable is assigned to itself  

Reports assignments of a variable to itself.

Last modified: 11 September 2024