| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]"> |
| <title> |
| Java Compiler |
| </title> |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </head> |
| <body> |
| <h1> |
| Java Compiler |
| </h1> |
| <p>The |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.CompliancePreferencePage)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <b>Java > Compiler</b></a> preference page |
| lets you configure the various settings related to compiling, building and checking Java source code.</p> |
| <p> |
| The Java compiler preferences are separated in the following sections: |
| </p> |
| <ul> |
| <li> |
| General |
| </li> |
| <li> |
| Building |
| </li> |
| <li> |
| Errors/Warnings |
| </li> |
| </ul> |
| |
| <h2 class="Head"> |
| General |
| </h2> |
| <p><h3>JDK Compliance</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <th> |
| <p> |
| Option |
| </p> |
| </th> |
| <th> |
| <p> |
| Description |
| </p> |
| </th> |
| <th> |
| <p> |
| Default |
| </p> |
| </th> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Compiler compliance level |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Specifies the compiler compliance level. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 1.4 |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Use default compliance settings |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, the default compliance settings for the compiler compliance level are applied. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Generated class files compatibility |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Specifies the generated class file compatibility. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 1.2 |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Source compatibility |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Specifies the compatibility of the accepted source code. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 1.3 |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Disallow identifiers called 'assert' |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in J2SE 1.4). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Disallow identifiers called 'enum' |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever 'enum' is used as an identifier (reserved keyword in J2SE 5.0). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Classfile generation</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Add variable attributes to generated class files |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, variable attributes are added to the class file. This will enable local variable names to be displayed in the debugger (in places where variables are |
| definitely assigned) The resulting .class file is then bigger. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Add line number attributes to generated class files |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, line number information is added to the class file. This will enable source code highlighting in the debugger. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Add source file name to generated class file |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, the source file name is added to the class file. This will enable the debugger to present the corresponding source code. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Preserve unused local variables |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, unused local variables (i.e. never read) are not stripped from the class file. If stripped this potentially alters debugging. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Inline finally blocks |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| If enabled, finally blocks are inlined in the generated class files. This positively affects performance, but may result in larger class files. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| </table> |
| |
| <h2 class="Head"> |
| Building |
| </h2> |
| <p><h3>General</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <th> |
| <p> |
| Option |
| </p> |
| </th> |
| <th> |
| <p> |
| Description |
| </p> |
| </th> |
| <th> |
| <p> |
| Default |
| </p> |
| </th> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Maximum number of reported problems per compilation unit |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Specifies how many problems should be reported for a compilation unit. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 100 |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Enable using exclusion patterns in source folders |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When disabled, no entry on a project classpath can be associated with |
| an exclusion pattern. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Enable using multiple output locations for source folders |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When disabled, no entry on a project classpath can be associated with |
| a specific output location, preventing thus usage of multiple output locations. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Build path problems</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Abort building on build path errors |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Allow to toggle the builder to abort if the classpath is invalid. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Incomplete build path |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Indicate the severity of the problem reported when an entry on the classpath does not exist, |
| is not legitimate or is not visible (e.g. a reference project is closed). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Error |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Circular dependencies |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Indicate the severity of the problem reported when a project is involved in a cycle. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Error |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Incompatible required binaries |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Indicated the severity of the problem reported when a project requires incompatible binaries. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Output folder</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Duplicated resources |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Indicate the severity of the problem reported when more than one occurrence of a resource |
| is to be copied into the output location. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Scrub output folders when cleaning projects |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Indicate whether the Java Builder is allowed to clean the output folders |
| when performing full build operations. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Filtered resources |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| A comma separated list of file patterns which are not copied to the output folder. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| '' |
| </p> |
| </td> |
| </tr> |
| </table> |
| <h2 class="Head"> |
| Errors/Warnings |
| </h2> |
| <p><h3>Code style</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <th> |
| <p> |
| Option |
| </p> |
| </th> |
| <th> |
| <p> |
| Description |
| </p> |
| </th> |
| <th> |
| <p> |
| Default |
| </p> |
| </th> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Non-static access to a static member |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Indirect access to a static member |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unqualified access to instance field |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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'). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Undocumented empty block |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an empty block statement with no explaining comment. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Access to a non-accessible member of an enclosing type |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Methods with a constructor name |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Usage of non-externalized strings |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning for non externalized String literal (i.e. non tagged with //$NON-NLS-<n>$). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Potential programming problems</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Serializable class without serialVersionUID |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever a type implementing 'java.io.Serializable' does not contain a serialVersionUID field. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Assignment has no effect (eg. 'x = x') |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever an assignment has no effect (eg. 'x = x'). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Possible accidential boolean assigment (eg. 'if (a = b)') |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever if encounters a possible accidential boolean assignment (eg. 'if (a = b)'). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| 'finally' does not complete normally |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever a 'finally' statement does not complete normally (eg. contains a return statement). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Empty statement |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an empty statement (eg. a superfluos semicolon). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Using a char array in string concatenation |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever a char[] expression is used in String concatenations, |
| </p> |
| <code>"hello" + new char[]{'w','o','r','l','d'}</code> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Hidden catch blocks |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Locally to a try statement, some catch blocks may hide others , eg. |
| </p> |
| <code>try { throw new java.io.CharConversionException();</code><br> |
| <code>} catch (java.io.CharConversionException e) {</code><br> |
| <code>} catch (java.io.IOException e) {}.</code><br> |
| <br> |
| |
| <p> |
| When enabling this option, the compiler will issue an error or a warning for hidden catch blocks corresponding to checked exceptions. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| |
| </table> |
| <p><h3>Name shadowing and conflicts</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Field declaration hides another field or variable |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabling this option, the compiler will issue an error or a warning if a field declaration hides another inherited field. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Local variable declaration hides another field or variable |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabling this option, the compiler will issue an error or a warning if a local variable declaration hides another field or variable. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Include constructor or setter method parameters |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Type parameter hides another type |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Methods overridden but not package visible |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| |
| <tr> |
| <td valign="top"> |
| <p> |
| Conflict of interface method with protected 'Object' method |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| <code>interface I {</code><br> |
| <code> int clone();</code><br> |
| <code>}</code><br> |
| <br> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Name shadowing and conflicts</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| |
| <tr> |
| <td valign="top"> |
| <p> |
| Deprecated API |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will signal use of deprecated API either as an error or a warning. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Signal use of deprecated API inside deprecated code |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will signal use of deprecated API inside deprecated code. |
| The severity of the problem is controlled with option "Deprecated API". |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Signal overriding or implementing deprecated method |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will signal overriding or implementing a deprecated method |
| The severity of the problem is controlled with option "Deprecated API". |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Forbidden reference (access rules) |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will signal a forbidden reference specified in the access rules. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Error |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Discouraged reference (access rules) |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will signal a discouraged reference specified in the access rules. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>Unnecessary code</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Local variable is never read |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning |
| whenever a local variable is declared but never used within the its scope. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Parameter is never read |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning |
| whenever a parameter is declared but never used within the its scope. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Check overriding and implementing methods |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler additionally will issue an error or a warning |
| whenever a parameter is declared but never used within the its scope in overriding or implementing methods. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unused imports |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning for unused import reference. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unused local or private members |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unnecessary else statement |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an unnecessary else statement (eg. if (condition) return; else doSomething();). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unnecessary cast or 'instanceof' operation |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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;). |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unnecessary declaration of thrown checked exception |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an unnecessary declaration of a thrown exception. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Check overriding and implementing methods |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Off |
| </p> |
| </td> |
| </tr> |
| </table> |
| <p><h3>J2SE 5.0 options</h3></p> |
| <table border="1" cellspacing="0" cellpadding="5" width="100%"> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unchecked generic type operation |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an unchecked generic type operation. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Generic type parameter declared with a final type bound |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters a type bound involving a final type. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Inexact type match for vararg arguments |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an |
| inexact type match for vararg arguments. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Boxing and unboxing conversions |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters a boxing or |
| unboxing conversion. Autoboxing may affects performance negatively. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Missing '@Override' annotation |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Missing '@Deprecated' annotation |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters a deprecated |
| type without additional '@Deprecated' annotation. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Annotation is used as super interface |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Not all enum constants covered on 'switch' |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| 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. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Ignore |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Unhandled warning tokens in '@SuppressWarnings' |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will issue an error or a warning whenever it encounters an unhandled |
| warning token in a '@SuppressWarnings' annotation. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| Warning |
| </p> |
| </td> |
| </tr> |
| <tr> |
| <td valign="top"> |
| <p> |
| Enable '@SuppressWarnings' annotations |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| When enabled, the compiler will process '@SuppressWarnings' annotations. |
| </p> |
| </td> |
| <td valign="top"> |
| <p> |
| On |
| </p> |
| </td> |
| </tr> |
| </table> |
| |
| <p> |
| <img src="../images/ngrelc.png" alt="Related concepts" border="0" ></p> |
| <p> |
| <a href="../concepts/concepts-4.htm">Java builder</a> |
| </p> |
| <p> |
| <img src="../images/ngrelt.png" alt="Related tasks" border="0" ></p> |
| <p> |
| <a href="../tasks/tasks-106.htm">Building a Java program</a><br> |
| <a href="../tasks/tasks-110.htm">Working with build paths</a><br> |
| <a href="../tasks/tasks-JREs.htm">Working with JREs</a> |
| </p> |
| <p> |
| <img border="0" src="../images/ngrelr.png" alt="Related reference"></p> |
| <p> |
| <a href="../reference/ref-15.htm">Classpath Variables preferences</a><br> |
| <a href="../reference/ref-123.htm">Java Build Path properties</a> |
| </p> |
| |
| </body> |
| </html> |
| |