Errors/Warnings

Indicate your preferences for the Errors/Warnings settings on the Opens the Errors/Warnings preference page Java > Compiler > Errors/Warnings preference page.

Code style

Option

Description

Default

Non-static access to a static member

When enabled, the compiler will issue an error or a warning whenever a static field or method is accessed with an expression receiver. A reference to a static member should be qualified with a type name.

Warning

Indirect access to a static member

When enabled, the compiler will issue an error or a warning whenever a static field or method is indirectly accessed. A static field of an interface should be qualified with the declaring type name.

Ignore

Unqualified access to instance field

When enabled, the compiler will issue an error or a warning whenever it encounters a field access which is not qualified (eg. misses a 'this').

Ignore

Undocumented empty block

When enabled, the compiler will issue an error or a warning whenever it encounters an empty block statement with no explaining comment.

Ignore

Access to a non-accessible member of an enclosing type

When enabled, the compiler will issue an error or a warning whenever it emulates access to a non-accessible member of an enclosing type. Such accesses can have performance implications.

Ignore

Method with a constructor name

Naming a method with a constructor name is generally considered poor style programming. When enabling this option, the compiler will signal such scenario either as an error or a warning.

Warning

Parameter assignment

Assigning a value to a parameter is generally considered poor style programming. When enabling this option, the compiler will signal such scenario either as an error or a warning.

Ignore

Non-externalized strings

When enabled, the compiler will issue an error or a warning for non externalized String literal (i.e. non tagged with //$NON-NLS-<n>$) or for non externalized String tags which do not belong to a String.

Ignore

Potential programming problems

Serializable class without serialVersionUID

When enabled, the compiler will issue an error or a warning whenever a type implementing 'java.io.Serializable' does not contain a serialVersionUID field.

Warning

Assignment has no effect (eg. 'x = x')

When enabled, the compiler will issue an error or a warning whenever an assignment has no effect (eg. 'x = x').

Warning

Possible accidential boolean assigment (eg. 'if (a = b)')

When enabled, the compiler will issue an error or a warning whenever it encounters a possible accidential boolean assignment (eg. 'if (a = b)').

Ignore

'finally' does not complete normally

When enabled, the compiler will issue an error or a warning whenever a 'finally' statement does not complete normally (eg. contains a return statement).

Warning

Empty statement

When enabled, the compiler will issue an error or a warning whenever it encounters an empty statement (eg. a superfluos semicolon).

Ignore

Using a char array in string concatenation

When enabled, the compiler will issue an error or a warning whenever a char[] expression is used in String concatenations,

"hello" + new char[]{'w','o','r','l','d'}

Warning

Hidden catch blocks

Locally to a try statement, some catch blocks may hide others , eg.

try { throw new java.io.CharConversionException();
} catch (java.io.CharConversionException e) {
} catch (java.io.IOException e) {}.

When enabling this option, the compiler will issue an error or a warning for hidden catch blocks corresponding to checked exceptions.

Warning

Inexact type match for vararg arguments

When enabled, the compiler will issue an error or a warning whenever it encounters an inexact type match for vararg arguments.

Warning

Boxing and unboxing conversions

When enabled, the compiler will issue an error or a warning whenever it encounters a boxing or unboxing conversion. Autoboxing may affects performance negatively.

Ignore

Enum type constant not covered on 'switch'

When enabled, the compiler will issue an error or a warning whenever it encounters a switch statement which does not contain case statements for every enum constant of the referenced enum.

Ignore

'switch' case fall-through

When enabled, the compiler will issue an error or a warning whenever it encounters a switch case without a 'break' statement. Empty switch cases are allowed.

Ignore

Null reference

When enabled, the compiler will issue an error or a warning when it encounters that a local variable which may be null is dereferenced. Note that the analysis is fairly conservative, it only considers cases where there is something suspicious.

Ignore

Name shadowing and conflicts

Field declaration hides another field or variable

When enabling this option, the compiler will issue an error or a warning if a field declaration hides another inherited field.

Ignore

Local variable declaration hides another field or variable

When enabling this option, the compiler will issue an error or a warning if a local variable declaration hides another field or variable.

Ignore

Include constructor or setter method parameters

When enabling this option, the compiler additionally will issue an error or a warning if a constructor or setter method parameter hides another field or variable.

Off

Type parameter hides another type

When enabling this option, the compiler will issue an error or a warning if eg. a type parameter of an inner class hides an outer type.

Warning

Methods overridden but not package visible

A package default method is not visible in a different package, and thus cannot be overridden. When enabling this option, the compiler will signal such scenario either as an error or a warning.

Warning

Interface method conflicts with protected 'Object' method

When enabled, the compiler will issue an error or a warning whenever an interface defines a method incompatible with a non-inherited Object method. Until this conflict is resolved, such an interface cannot be implemented, eg.

interface I {
   int clone();
}

Warning

Deprecated and restricted API

Deprecated API

When enabled, the compiler will signal use of deprecated API either as an error or a warning.

Warning

Signal use of deprecated API inside deprecated code

When enabled, the compiler will signal use of deprecated API inside deprecated code. The severity of the problem is controlled with option "Deprecated API".

Off

Signal overriding or implementing deprecated method

When enabled, the compiler will signal overriding or implementing a deprecated method The severity of the problem is controlled with option "Deprecated API".

Off

Forbidden reference (access rules)

When enabled, the compiler will signal a forbidden reference specified in the access rules.

Error

Discouraged reference (access rules)

When enabled, the compiler will signal a discouraged reference specified in the access rules.

Warning

Unnecessary code

Local variable is never read

When enabled, the compiler will issue an error or a warning whenever a local variable is declared but never used within its scope.

Warning

Parameter is never read

When enabled, the compiler will issue an error or a warning whenever a parameter is declared but never used within its scope.

Ignore

Check overriding and implementing methods

When enabled, the compiler additionally will issue an error or a warning whenever a parameter is declared but never used within its scope in overriding or implementing methods.

Off

Unused import

When enabled, the compiler will issue an error or a warning for unused import reference.

Warning

Unused local or private members

When enabled, the compiler will issue an error or a warning whenever a local or private member is declared but never used within the same unit.

Warning

Unnecessary else statement

When enabled, the compiler will issue an error or a warning whenever it encounters an unnecessary else statement (eg. if (condition) return; else doSomething();).

Ignore

Unnecessary cast or 'instanceof' operation

When enabled, the compiler will issue an error or a warning whenever it encounters an unnecessary cast or 'instanceof' operation (eg. if (object instanceof Object) return;).

Ignore

Unnecessary declaration of thrown checked exception

When enabled, the compiler will issue an error or a warning whenever it encounters an unnecessary declaration of a thrown exception.

Ignore

Check overriding and implementing methods

When enabled, the compiler additionally will issue an error or a warning whenever it encounters an unnecessary declaration of a thrown exception in an overriding or implementing method.

Off

Unused break/continue label

When enabled, the compiler will issue an error or a warning whenever it encounters an unused 'break' or 'continue' label.

Warning

Generic types

Unchecked generic type operation

When enabled, the compiler will issue an error or a warning whenever it encounters an unchecked generic type operation.

Warning

Usage of a raw type

When enabled, the compiler will issue an error or a warning whenever it encounters a usage of a raw type (i.e. List instead of List<String>).

Ignore

Generic type parameter declared with a final type bound

When enabled, the compiler will issue an error or a warning whenever it encounters a type bound involving a final type.

Warning

Annotations

Missing '@Override' annotation

When enabled, the compiler will issue an error or a warning whenever it encounters a method overriding another implemented method, and the '@Override' annotation is missing.

Ignore

Missing '@Deprecated' annotation

When enabled, the compiler will issue an error or a warning whenever it encounters a deprecated type without additional '@Deprecated' annotation.

Ignore

Annotation is used as super interface

When enabled, the compiler will issue an error or a warning whenever it encounters a type implementing an annotation. Although possible, this is considered bad practice.

Warning

Unhandled warning tokens in '@SuppressWarnings'

When enabled, the compiler will issue an error or a warning whenever it encounters an unhandled warning token in a '@SuppressWarnings' annotation.

Warning

Enable '@SuppressWarnings' annotations

When enabled, the compiler will process '@SuppressWarnings' annotations.

On

Related concepts

Problems View
Quick Fix
Java builder