Class JavaCore

java.lang.Object
org.eclipse.core.runtime.Plugin
org.eclipse.jdt.core.JavaCore
All Implemented Interfaces:
BundleActivator

public final class JavaCore extends org.eclipse.core.runtime.Plugin
The plug-in runtime class for the Java model plug-in containing the core (UI-free) support for Java projects.

Like all plug-in runtime classes (subclasses of Plugin), this class is automatically instantiated by the platform when the plug-in gets activated. Clients must not attempt to instantiate plug-in runtime classes directly.

The single instance of this class can be accessed from any plug-in declaring the Java model plug-in as a prerequisite via JavaCore.getJavaCore(). The Java model plug-in will be activated automatically if not already active.

Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • PLUGIN_ID

      public static final String PLUGIN_ID
      The plug-in identifier of the Java core support (value "org.eclipse.jdt.core").
      See Also:
    • BUILDER_ID

      public static final String BUILDER_ID
      The identifier for the Java builder (value "org.eclipse.jdt.core.javabuilder").
      See Also:
    • MODEL_ID

      public static final String MODEL_ID
      The identifier for the Java model (value "org.eclipse.jdt.core.javamodel").
      See Also:
    • NATURE_ID

      public static final String NATURE_ID
      The identifier for the Java nature (value "org.eclipse.jdt.core.javanature"). The presence of this nature on a project indicates that it is Java-capable.
      See Also:
    • ATT_HANDLE_ID

      protected static final String ATT_HANDLE_ID
      Name of the handle id attribute in a Java marker.
      See Also:
    • USER_LIBRARY_CONTAINER_ID

      public static final String USER_LIBRARY_CONTAINER_ID
      Name of the User Library Container id.
      Since:
      3.0
      See Also:
    • MODULE_PATH_CONTAINER_ID

      public static final String MODULE_PATH_CONTAINER_ID
      Since:
      3.14
      See Also:
    • COMPILER_LOCAL_VARIABLE_ATTR

      public static final String COMPILER_LOCAL_VARIABLE_ATTR
      Compiler option ID: Generating Local Variable Debug Attribute.

      When generated, this attribute will enable local variable names to be displayed in debugger, only in place where variables are definitely assigned (.class file is then bigger).

      Option id:
      "org.eclipse.jdt.core.compiler.debug.localVariable"
      Possible values:
      { "generate", "do not generate" }
      Default:
      "generate"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_LINE_NUMBER_ATTR

      public static final String COMPILER_LINE_NUMBER_ATTR
      Compiler option ID: Generating Line Number Debug Attribute.

      When generated, this attribute will enable source code highlighting in debugger (.class file is then bigger).

      Option id:
      "org.eclipse.jdt.core.compiler.debug.lineNumber"
      Possible values:
      { "generate", "do not generate" }
      Default:
      "generate"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_SOURCE_FILE_ATTR

      public static final String COMPILER_SOURCE_FILE_ATTR
      Compiler option ID: Generating Source Debug Attribute.

      When generated, this attribute will enable the debugger to present the corresponding source code.

      Option id:
      "org.eclipse.jdt.core.compiler.debug.sourceFile"
      Possible values:
      { "generate", "do not generate" }
      Default:
      "generate"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_CODEGEN_UNUSED_LOCAL

      public static final String COMPILER_CODEGEN_UNUSED_LOCAL
      Compiler option ID: Preserving Unused Local Variables.

      Unless requested to preserve unused local variables (that is, never read), the compiler will optimize them out, potentially altering debugging.

      Option id:
      "org.eclipse.jdt.core.compiler.codegen.unusedLocal"
      Possible values:
      { "preserve", "optimize out" }
      Default:
      "preserve"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_CODEGEN_METHOD_PARAMETERS_ATTR

      public static final String COMPILER_CODEGEN_METHOD_PARAMETERS_ATTR
      Compiler option ID: Generating Method Parameters Attribute.

      When generated, this attribute will enable information about the formal parameters of a method (such as their names) to be accessed from reflection libraries, annotation processing, code weaving, and in the debugger, from platform target level 1.8 and later.

      Option id:
      "org.eclipse.jdt.core.compiler.codegen.methodParameters"
      Possible values:
      { "generate", "do not generate" }
      Default:
      "do not generate"
      Since:
      3.10
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_CODEGEN_TARGET_PLATFORM

      public static final String COMPILER_CODEGEN_TARGET_PLATFORM
      Compiler option ID: Defining Target Java Platform.

      For binary compatibility reasons, .class files are tagged with a minimal required VM version.

      Note that "1.4" and higher target versions require the compliance mode to be at least as high as the target version. Usually, compliance, target, and source versions are set to the same values.

      "cldc1.1" requires the source version to be "1.3" and the compliance version to be "1.4" or lower.

      Option id:
      "org.eclipse.jdt.core.compiler.codegen.targetPlatform"
      Possible values:
      { "1.1", "cldc1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }
      Default:
      "1.2"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_CODEGEN_INLINE_JSR_BYTECODE

      public static final String COMPILER_CODEGEN_INLINE_JSR_BYTECODE
      Compiler option ID: Inline JSR Bytecode Instruction.

      When enabled, the compiler will no longer generate JSR instructions, but rather inline corresponding subroutine code sequences (mostly corresponding to try finally blocks). The generated code will thus get bigger, but will load faster on virtual machines since the verification process is then much simpler.

      This mode is anticipating support for the Java Specification Request 202.

      Note that JSR inlining is optional only for target platform lesser than 1.5. From 1.5 on, the JSR inlining is mandatory (also see related setting COMPILER_CODEGEN_TARGET_PLATFORM).

      Option id:
      "org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_DOC_COMMENT_SUPPORT

      public static final String COMPILER_DOC_COMMENT_SUPPORT
      Compiler option ID: Javadoc Comment Support.

      When this support is disabled, the compiler will ignore all javadoc problems options settings and will not report any javadoc problem. It will also not find any reference in javadoc comment and DOM AST Javadoc node will be only a flat text instead of having structured tag elements.

      Option id:
      "org.eclipse.jdt.core.compiler.doc.comment.support"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNREACHABLE_CODE

      public static final String COMPILER_PB_UNREACHABLE_CODE
      Deprecated.
      Discontinued since turning off would violate language specs.
      See Also:
      Category:
      DeprecatedOptionID
    • COMPILER_PB_INVALID_IMPORT

      public static final String COMPILER_PB_INVALID_IMPORT
      Deprecated.
      Discontinued since turning off would violate language specs.
      See Also:
      Category:
      DeprecatedOptionID
    • COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD

      public static final String COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD
      Compiler option ID: Reporting Attempt to Override Package Visible Method.

      A package visible method, which is any method that is not explicitly declared as public, protected or private, is not visible from other packages, and thus cannot be overridden from another package. Attempting to override a package visible method from another package introduces a new method that is unrelated to the original one. When enabling this option, the compiler will signal such situations as an error or a warning.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME

      public static final String COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME
      Compiler option ID: Reporting Method With 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.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DEPRECATION

      public static final String COMPILER_PB_DEPRECATION
      Compiler option ID: Reporting Deprecation.

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

      Option id:
      "org.eclipse.jdt.core.compiler.problem.deprecation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_TERMINAL_DEPRECATION

      public static final String COMPILER_PB_TERMINAL_DEPRECATION
      Compiler option ID: Reporting Terminal Deprecation.

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

      Option id:
      "org.eclipse.jdt.core.compiler.problem.terminalDeprecation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.14
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE

      public static final String COMPILER_PB_DEPRECATION_IN_DEPRECATED_CODE
      Compiler option ID: Reporting Deprecation 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 COMPILER_PB_DEPRECATION.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD

      public static final String COMPILER_PB_DEPRECATION_WHEN_OVERRIDING_DEPRECATED_METHOD
      Compiler option ID: Reporting Deprecation When Overriding Deprecated Method.

      When enabled, the compiler will signal the declaration of a method overriding a deprecated one.

      The severity of the problem is controlled with option COMPILER_PB_DEPRECATION.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_HIDDEN_CATCH_BLOCK

      public static final String COMPILER_PB_HIDDEN_CATCH_BLOCK
      Compiler option ID: Reporting Hidden Catch Block.

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

            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.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_LOCAL

      public static final String COMPILER_PB_UNUSED_LOCAL
      Compiler option ID: Reporting Unused Local.

      When enabled, the compiler will issue an error or a warning for unused local variables (that is, variables never read from).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedLocal"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_PARAMETER

      public static final String COMPILER_PB_UNUSED_PARAMETER
      Compiler option ID: Reporting Unused Parameter.

      When enabled, the compiler will issue an error or a warning for unused method parameters (that is, parameters never read from).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedParameter"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_EXCEPTION_PARAMETER

      public static final String COMPILER_PB_UNUSED_EXCEPTION_PARAMETER
      Compiler option ID: Reporting Unused Exception Parameter.

      When enabled, the compiler will issue an error or a warning for unused exception parameters (that is, the thrown exception is never read from).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.11
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT

      public static final String COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT
      Compiler option ID: Reporting Unused Parameter if Implementing Abstract Method.

      When enabled, the compiler will signal unused parameters in abstract method implementations.

      The severity of the problem is controlled with option COMPILER_PB_UNUSED_PARAMETER.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_PARAMETER_WHEN_OVERRIDING_CONCRETE

      public static final String COMPILER_PB_UNUSED_PARAMETER_WHEN_OVERRIDING_CONCRETE
      Compiler option ID: Reporting Unused Parameter if Overriding Concrete Method.

      When enabled, the compiler will signal unused parameters in methods overriding concrete ones.

      The severity of the problem is controlled with option COMPILER_PB_UNUSED_PARAMETER.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE

      public static final String COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE
      Compiler option ID: Consider Reference in Doc Comment for Unused Parameter Check.

      When enabled, the compiler will consider doc comment references to parameters (i.e. @param clauses) for the unused parameter check. Thus, documented parameters will be considered as mandated as per doc contract.

      The severity of the unused parameter problem is controlled with option COMPILER_PB_UNUSED_PARAMETER.

      Note: this option has no effect until the doc comment support is enabled according to the option COMPILER_DOC_COMMENT_SUPPORT.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.3
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_IMPORT

      public static final String COMPILER_PB_UNUSED_IMPORT
      Compiler option ID: Reporting Unused Import.

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

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedImport"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION

      public static final String COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION
      Compiler option ID: Reporting Presence of Type Arguments for a Non-Generic Method Invocation.

      When enabled, the compiler will issue an error or a warning whenever type arguments are encountered for a non-generic method invocation. Note that prior to compliance level is "1.7", this situation would automatically result in an error. From Java7 on, unused type arguments are being tolerated, and optionally warned against.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedTypeArgumentsForMethodInvocation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SYNTHETIC_ACCESS_EMULATION

      public static final String COMPILER_PB_SYNTHETIC_ACCESS_EMULATION
      Compiler option ID: Reporting Synthetic Access Emulation.

      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 access can have performance implications.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_TYPE_PARAMETER

      public static final String COMPILER_PB_UNUSED_TYPE_PARAMETER
      Compiler option ID: Reporting Unused Type Parameter.

      When enabled, the compiler will issue an error or a warning whenever it encounters an unused type parameter.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedTypeParameter"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.9
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NON_NLS_STRING_LITERAL

      public static final String COMPILER_PB_NON_NLS_STRING_LITERAL
      Compiler option ID: Reporting Non-Externalized String Literal.

      When enabled, the compiler will issue an error or a warning for non externalized String literal (that is, not tagged with //$NON-NLS-<n>$).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_ASSERT_IDENTIFIER

      public static final String COMPILER_PB_ASSERT_IDENTIFIER
      Compiler option ID: Reporting Usage of 'assert' Identifier.

      When enabled, the compiler will issue an error or a warning whenever 'assert' is used as an identifier (reserved keyword in 1.4).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.assertIdentifier"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_ENUM_IDENTIFIER

      public static final String COMPILER_PB_ENUM_IDENTIFIER
      Compiler option ID: Reporting Usage of 'enum' Identifier.

      When enabled, the compiler will issue an error or a warning whenever 'enum' is used as an identifier (reserved keyword in 1.5).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.enumIdentifier"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_STATIC_ACCESS_RECEIVER

      public static final String COMPILER_PB_STATIC_ACCESS_RECEIVER
      Compiler option ID: Reporting Non-Static Reference 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.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.staticAccessReceiver"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INDIRECT_STATIC_ACCESS

      public static final String COMPILER_PB_INDIRECT_STATIC_ACCESS
      Compiler option ID: Reporting Indirect Reference to a Static Member.

      When enabled, the compiler will issue an error or a warning whenever a static field or method is accessed in an indirect way. A reference to a static member should preferably be qualified with its declaring type name.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.indirectStaticAccess"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NO_EFFECT_ASSIGNMENT

      public static final String COMPILER_PB_NO_EFFECT_ASSIGNMENT
      Compiler option ID: Reporting Assignment with no Effect.

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

      Option id:
      "org.eclipse.jdt.core.compiler.problem.noEffectAssignment"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD

      public static final String COMPILER_PB_INCOMPATIBLE_NON_INHERITED_INTERFACE_METHOD
      Compiler option ID: Reporting Interface Method not Compatible with non-Inherited Methods.

      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. For example,

            interface I {
               int clone();
            }
          
      Option id:
      "org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_PRIVATE_MEMBER

      public static final String COMPILER_PB_UNUSED_PRIVATE_MEMBER
      Compiler option ID: Reporting Unused Private Members.

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

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedPrivateMember"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_LOCAL_VARIABLE_HIDING

      public static final String COMPILER_PB_LOCAL_VARIABLE_HIDING
      Compiler option ID: Reporting Local Variable Declaration Hiding another Variable.

      When enabled, the compiler will issue an error or a warning whenever a local variable declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.localVariableHiding"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SPECIAL_PARAMETER_HIDING_FIELD

      public static final String COMPILER_PB_SPECIAL_PARAMETER_HIDING_FIELD
      Compiler option ID: Reporting Special Parameter Hiding another Field.

      When enabled, the compiler will signal cases where a constructor or setter method parameter declaration is hiding some field (either locally, inherited or defined in enclosing type).

      The severity of the problem is controlled with option COMPILER_PB_LOCAL_VARIABLE_HIDING.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.specialParameterHidingField"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FIELD_HIDING

      public static final String COMPILER_PB_FIELD_HIDING
      Compiler option ID: Reporting Field Declaration Hiding another Variable.

      When enabled, the compiler will issue an error or a warning whenever a field declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.fieldHiding"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_TYPE_PARAMETER_HIDING

      public static final String COMPILER_PB_TYPE_PARAMETER_HIDING
      Compiler option ID: Reporting Type Declaration Hiding another Type.

      When enabled, the compiler will issue an error or a warning in situations where a type parameter declaration is hiding some type, when a nested type is hiding some type parameter, or when a nested type is hiding another nested type defined in same unit.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.typeParameterHiding"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT

      public static final String COMPILER_PB_POSSIBLE_ACCIDENTAL_BOOLEAN_ASSIGNMENT
      Compiler option ID: Reporting Possible Accidental Boolean Assignment.

      When enabled, the compiler will issue an error or a warning if a boolean assignment is acting as the condition of a control statement (where it probably was meant to be a boolean comparison).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FALLTHROUGH_CASE

      public static final String COMPILER_PB_FALLTHROUGH_CASE
      Compiler option ID: Reporting Switch Fall-Through Case.

      When enabled, the compiler will issue an error or a warning if a case may be entered by falling through previous case. Empty cases are allowed.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.fallthroughCase"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_EMPTY_STATEMENT

      public static final String COMPILER_PB_EMPTY_STATEMENT
      Compiler option ID: Reporting Empty Statements and Unnecessary Semicolons.

      When enabled, the compiler will issue an error or a warning if an empty statement or a unnecessary semicolon is encountered.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.emptyStatement"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_BOOLEAN_METHOD_THROWING_EXCEPTION

      public static final String COMPILER_PB_BOOLEAN_METHOD_THROWING_EXCEPTION
      Deprecated.
      - this option has no effect
      Compiler option ID.
      Option id:
      "org.eclipse.jdt.core.compiler.problem.booleanMethodThrowingException"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNNECESSARY_TYPE_CHECK

      public static final String COMPILER_PB_UNNECESSARY_TYPE_CHECK
      Compiler option ID: Reporting Unnecessary Type Check.

      When enabled, the compiler will issue an error or a warning when a cast or an instanceof operation is unnecessary.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNNECESSARY_ELSE

      public static final String COMPILER_PB_UNNECESSARY_ELSE
      Compiler option ID: Reporting Unnecessary Else.

      When enabled, the compiler will issue an error or a warning when a statement is unnecessarily nested within an else clause (in situation where then clause is not completing normally).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unnecessaryElse"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK

      public static final String COMPILER_PB_UNDOCUMENTED_EMPTY_BLOCK
      Compiler option ID: Reporting Undocumented Empty Block.

      When enabled, the compiler will issue an error or a warning when an empty block is detected and it is not documented with any comment.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING

      public static final String COMPILER_PB_FINALLY_BLOCK_NOT_COMPLETING
      Compiler option ID: Reporting Finally Blocks Not Completing Normally.

      When enabled, the compiler will issue an error or a warning when a finally block does not complete normally.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION

      public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION
      Compiler option ID: Reporting Unused Declared Thrown Exception.

      When enabled, the compiler will issue an error or a warning when a method or a constructor is declaring a checked exception as thrown, but its body actually raises neither that exception, nor any other exception extending it.

      This diagnostic is further tuned by options COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE, COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE, and COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING

      public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING
      Compiler option ID: Reporting Unused Declared Thrown Exception in Overriding Method.

      When disabled, the compiler will report unused declared thrown exceptions neither on overriding methods nor on implementing methods.

      The severity of the unused declared thrown exception problem is controlled with option COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION.

      This diagnostic is further tuned by options COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE and COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE

      public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE
      Compiler option ID: Consider Reference in Doc Comment for Unused Declared Thrown Exception Check.

      When enabled, the compiler will consider doc comment references to exceptions (i.e. @throws clauses) for the unused declared thrown exception check. Thus, documented exceptions will be considered as mandated as per doc contract.

      The severity of the unused declared thrown exception problem is controlled with option COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION.

      Note: this option has no effect until the doc comment support is enabled according to the option COMPILER_DOC_COMMENT_SUPPORT.

      This diagnostic is further tuned by options COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE and COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE

      public static final String COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE
      Compiler option ID: Reporting Unused Declared Thrown Exception Exempts Exception And Throwable.

      When enabled, the compiler will issue an error or a warning when a method or a constructor is declaring a checked exception else than Throwable or Exception as thrown, but its body actually raises neither that exception, nor any other exception extending it. When disabled, the compiler will issue an error or a warning when a method or a constructor is declaring a checked exception (including Throwable and Exception) as thrown, but its body actually raises neither that exception, nor any other exception extending it.

      The severity of the unused declared thrown exception problem is controlled with option COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION.

      This diagnostic is further tuned by options COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE and COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNQUALIFIED_FIELD_ACCESS

      public static final String COMPILER_PB_UNQUALIFIED_FIELD_ACCESS
      Compiler option ID: Reporting Unqualified Access to Field.

      When enabled, the compiler will issue an error or a warning when a field is access without any qualification. In order to improve code readability, it should be qualified, e.g. 'x' should rather be written 'this.x'.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNSAFE_TYPE_OPERATION

      public static final String COMPILER_PB_UNSAFE_TYPE_OPERATION
      Deprecated.
      Since:
      3.1
      See Also:
      Category:
      DeprecatedOptionID
    • COMPILER_PB_UNCHECKED_TYPE_OPERATION

      public static final String COMPILER_PB_UNCHECKED_TYPE_OPERATION
      Compiler option ID: Reporting Unchecked Type Operation.

      When enabled, the compiler will issue an error or a warning whenever an operation involves generic types, and potentially invalidates type safety since involving raw types (e.g. invoking #foo(X<String>) with arguments (X)).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_RAW_TYPE_REFERENCE

      public static final String COMPILER_PB_RAW_TYPE_REFERENCE
      Compiler option ID: Reporting Raw Type Reference.

      When enabled, the compiler will issue an error or a warning when detecting references to raw types. Raw types are discouraged, and are intended to help interfacing with legacy code. In the future, the language specification may reject raw references to generic types.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.rawTypeReference"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNAVOIDABLE_GENERIC_TYPE_PROBLEMS

      public static final String COMPILER_PB_UNAVOIDABLE_GENERIC_TYPE_PROBLEMS
      Compiler option ID: Reporting of Unavoidable Generic Type Problems due to raw APIs.

      When enabled, the compiler will issue an error or warning even when it detects a generics-related type problem that could not have been avoided by the programmer, because a referenced API already contains raw types. As an example, a type may be forced to use raw types in its method signatures and return types because the methods it overrides from a super type are declared to use raw types in the first place.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.7
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FINAL_PARAMETER_BOUND

      public static final String COMPILER_PB_FINAL_PARAMETER_BOUND
      Compiler option ID: Reporting final Bound for Type Parameter.

      When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a bound corresponding to a final type; since final types cannot be further extended, the parameter is pretty useless.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.finalParameterBound"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_SERIAL_VERSION

      public static final String COMPILER_PB_MISSING_SERIAL_VERSION
      Compiler option ID: Reporting Missing Declaration of serialVersionUID Field on Serializable Class.

      When enabled, the compiler will issue an error or a warning whenever a serializable class is missing a local declaration of a serialVersionUID field. This field must be declared as static final and be of type long.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingSerialVersion"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST

      public static final String COMPILER_PB_VARARGS_ARGUMENT_NEED_CAST
      Compiler option ID: Reporting Varargs Argument Needing a Cast in Method/Constructor Invocation.

      When enabled, the compiler will issue an error or a warning whenever a varargs arguments should be cast when passed to a method/constructor invocation. (e.g. Class.getMethod(String name, Class ... args ) invoked with arguments ("foo", null)).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_AUTOBOXING

      public static final String COMPILER_PB_AUTOBOXING
      Compiler option ID: Reporting Boxing/Unboxing Conversion.

      When enabled, the compiler will issue an error or a warning whenever a boxing or an unboxing conversion is performed.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.autoboxing"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_ANNOTATION_SUPER_INTERFACE

      public static final String COMPILER_PB_ANNOTATION_SUPER_INTERFACE
      Compiler option ID: Reporting Use of Annotation Type as Super Interface.

      When enabled, the compiler will issue an error or a warning whenever an annotation type is used as a super-interface. Though legal, this is discouraged.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.annotationSuperInterface"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_OVERRIDE_ANNOTATION

      public static final String COMPILER_PB_MISSING_OVERRIDE_ANNOTATION
      Compiler option ID: Reporting Missing @Override Annotation.

      When enabled, the compiler will issue an error or a warning whenever encountering a method declaration which overrides a superclass method but has no @Override annotation.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_OVERRIDE_ANNOTATION_FOR_INTERFACE_METHOD_IMPLEMENTATION

      public static final String COMPILER_PB_MISSING_OVERRIDE_ANNOTATION_FOR_INTERFACE_METHOD_IMPLEMENTATION
      Compiler option ID: Reporting Missing @Override Annotation for interface method implementation.

      When enabled, the compiler will issue an error or a warning whenever encountering a method declaration which overrides or implements a superinterface method but has no @Override annotation.

      This option only has an effect if the compiler compliance is 1.6 or greater.

      The severity of the problem is controlled with option COMPILER_PB_MISSING_OVERRIDE_ANNOTATION.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.6
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_DEPRECATED_ANNOTATION

      public static final String COMPILER_PB_MISSING_DEPRECATED_ANNOTATION
      Compiler option ID: Reporting Missing @Deprecated Annotation.

      When enabled, the compiler will issue an error or a warning whenever encountering a declaration carrying a @deprecated doc tag but having no corresponding @Deprecated annotation.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_HASHCODE_METHOD

      public static final String COMPILER_PB_MISSING_HASHCODE_METHOD
      Compiler option ID: Reporting Missing HashCode Method.

      When enabled, the compiler will issue an error or a warning if a type overrides Object.equals(Object) but does not override hashCode().

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.5
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DEAD_CODE

      public static final String COMPILER_PB_DEAD_CODE
      Compiler option ID: Reporting Dead Code.

      When enabled, the compiler will issue an error or a warning if some non fatal dead code is detected. For instance, if (false) foo(); is not reported as truly unreachable code by the Java Language Specification. If this diagnostic is enabled, then the invocation of foo() is going to be signaled as being dead code.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.deadCode"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.5
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DEAD_CODE_IN_TRIVIAL_IF_STATEMENT

      public static final String COMPILER_PB_DEAD_CODE_IN_TRIVIAL_IF_STATEMENT
      Compiler option ID: Reporting Dead Code Inside Trivial If Statement.

      When enabled, the compiler will signal presence of dead code inside trivial IF statement, e.g. if (DEBUG)....

      The severity of the problem is controlled with option COMPILER_PB_DEAD_CODE.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.5
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INCOMPLETE_ENUM_SWITCH

      public static final String COMPILER_PB_INCOMPLETE_ENUM_SWITCH
      Compiler option ID: Reporting Incomplete Enum Switch.

      When enabled, the compiler will issue an error or a warning regarding each enum constant for which a corresponding case label is lacking. Reporting is further controlled by the option COMPILER_PB_MISSING_ENUM_CASE_DESPITE_DEFAULT.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_ENUM_CASE_DESPITE_DEFAULT

      public static final String COMPILER_PB_MISSING_ENUM_CASE_DESPITE_DEFAULT
      Compiler option ID: Reporting Missing Enum Case In Switch Despite An Existing Default Case.

      This option further controls the option COMPILER_PB_INCOMPLETE_ENUM_SWITCH:

      • If enabled the compiler will report problems about missing enum constants even if a default case exists in the same switch statement.
      • If disabled existence of a default case is considered as sufficient to make a switch statement complete.
      This option has no effect if COMPILER_PB_INCOMPLETE_ENUM_SWITCH is set to "ignore".
      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SWITCH_MISSING_DEFAULT_CASE

      public static final String COMPILER_PB_SWITCH_MISSING_DEFAULT_CASE
      Compiler option ID: Reporting Missing Default Case In Switch.

      When enabled, the compiler will issue an error or a warning against each switch statement that lacks a default case.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingDefaultCase"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INCONSISTENT_NULL_CHECK

      public static final String COMPILER_PB_INCONSISTENT_NULL_CHECK
      Deprecated.
      Since:
      3.1
      See Also:
      Category:
      DeprecatedOptionID
    • COMPILER_PB_UNUSED_LABEL

      public static final String COMPILER_PB_UNUSED_LABEL
      Compiler option ID: Reporting Unreferenced Label.

      When enabled, the compiler will issue an error or a warning when encountering a labeled statement which label is never explicitly referenced. A label is considered to be referenced if its name explicitly appears behind a break or continue statement; for instance the following label would be considered unreferenced:

      LABEL: { break; }
      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedLabel"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INVALID_JAVADOC

      public static final String COMPILER_PB_INVALID_JAVADOC
      Compiler option ID: Reporting Invalid Javadoc Comment.

      This is the generic control for the severity of Javadoc problems. When enabled, the compiler will issue an error or a warning for a problem in Javadoc.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.invalidJavadoc"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INVALID_JAVADOC_TAGS

      public static final String COMPILER_PB_INVALID_JAVADOC_TAGS
      Compiler option ID: Reporting Invalid Javadoc Tags.

      When enabled, the compiler will signal unbound or unexpected reference tags in Javadoc. A @throws tag referencing an undeclared exception would be considered as unexpected.

      Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; also see the setting COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.invalidJavadocTags"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INVALID_JAVADOC_TAGS__DEPRECATED_REF

      public static final String COMPILER_PB_INVALID_JAVADOC_TAGS__DEPRECATED_REF
      Compiler option ID: Reporting Invalid Javadoc Tags with Deprecated References.

      Specify whether the compiler will report deprecated references used in Javadoc tags.

      Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; also see the setting COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INVALID_JAVADOC_TAGS__NOT_VISIBLE_REF

      public static final String COMPILER_PB_INVALID_JAVADOC_TAGS__NOT_VISIBLE_REF
      Compiler option ID: Reporting Invalid Javadoc Tags with Not Visible References.

      Specify whether the compiler will report non-visible references used in Javadoc tags.

      Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; also see the setting COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY

      public static final String COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY
      Compiler option ID: Visibility Level For Invalid Javadoc Tags.

      Set the minimum visibility level for Javadoc tag problems. Below this level problems will be ignored.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility"
      Possible values:
      { "public", "protected", "default", "private" }
      Default:
      "public"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION

      public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION
      Compiler option ID: Reporting missing tag description.

      When enabled, the compiler will report a warning or an error for any Javadoc tag missing a required description.

      The severity of the problem is controlled with option COMPILER_PB_INVALID_JAVADOC.

      It does not depend on option COMPILER_PB_INVALID_JAVADOC_TAGS.

      When this option is valued to COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS, a subset of the standard Javadoc tags that have a description, text or label are checked. While this set may grow in the future, note that user-defined tags are not and will not be checked.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription"
      Possible values:
      { "return_tag", "all_standard_tags", "no_tag" }
      Default:
      "return_tag"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_TAGS

      public static final String COMPILER_PB_MISSING_JAVADOC_TAGS
      Compiler option ID: Reporting Missing Javadoc Tags.

      This is the generic control for the severity of Javadoc missing tag problems. When enabled, the compiler will issue an error or a warning when tags are missing in Javadoc comments.

      Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; also see the setting COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocTags"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY

      public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY
      Compiler option ID: Visibility Level For Missing Javadoc Tags.

      Set the minimum visibility level for Javadoc missing tag problems. Below this level problems will be ignored.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility"
      Possible values:
      { "public", "protected", "default", "private" }
      Default:
      "public"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING

      public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING
      Compiler option ID: Reporting Missing Javadoc Tags on Overriding Methods.

      Specify whether the compiler will verify overriding methods in order to report Javadoc missing tag problems.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_TAGS_METHOD_TYPE_PARAMETERS

      public static final String COMPILER_PB_MISSING_JAVADOC_TAGS_METHOD_TYPE_PARAMETERS
      Compiler option ID: Reporting Missing Javadoc Tags for Method Type Parameters.

      Specify whether a missing @param for a type parameter in a method declaration should be reported. When enabled, the compiler will issue a missing Javadoc tag error or warning for a type parameter without a corresponding @param tag.

      This option only has an effect if the compiler compliance is 1.5 or greater.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.7
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_COMMENTS

      public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS
      Compiler option ID: Reporting Missing Javadoc Comments.

      This is the generic control for the severity of missing Javadoc comment problems. When enabled, the compiler will issue an error or a warning when Javadoc comments are missing.

      Note that this diagnosis can be enabled based on the visibility of the construct associated with the expected Javadoc; also see the setting COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocComments"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY

      public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY
      Compiler option ID: Visibility Level For Missing Javadoc Comments.

      Set the minimum visibility level for missing Javadoc problems. Below this level problems will be ignored.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility"
      Possible values:
      { "public", "protected", "default", "private" }
      Default:
      "public"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING

      public static final String COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING
      Compiler option ID: Reporting Missing Javadoc Comments on Overriding Methods.

      Specify whether the compiler will verify overriding methods in order to report missing Javadoc comment problems.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION

      public static final String COMPILER_PB_CHAR_ARRAY_IN_STRING_CONCATENATION
      Compiler option ID: Reporting Usage of char[] Expressions in String Concatenations.

      When enabled, the compiler will issue an error or a warning whenever a char[] expression is used in String concatenations (for example, "hello" + new char[]{'w','o','r','l','d'}).

      Option id:
      "org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MAX_PER_UNIT

      public static final String COMPILER_PB_MAX_PER_UNIT
      Compiler option ID: Maximum Number of Problems Reported per Compilation Unit.

      Specify the maximum number of problems reported on each compilation unit.

      Option id:
      "org.eclipse.jdt.core.compiler.maxProblemPerUnit"
      Possible values:
      "<n>" where <n> is zero or a positive integer (if zero then all problems are reported).
      Default:
      "100"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FATAL_OPTIONAL_ERROR

      public static final String COMPILER_PB_FATAL_OPTIONAL_ERROR
      Compiler option ID: Treating Optional Error as Fatal.

      When enabled, optional errors (i.e. optional problems which severity is set to "error") will be treated as standard compiler errors, yielding problem methods/types preventing from running offending code until the issue got resolved.

      When disabled, optional errors are only considered as warnings, still carrying an error indication to make them more severe. Note that by default, optional errors are not fatal. Non-optional errors are always fatal.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.fatalOptionalError"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_PARAMETER_ASSIGNMENT

      public static final String COMPILER_PB_PARAMETER_ASSIGNMENT
      Compiler option ID: Reporting Parameter Assignment.

      When enabled, the compiler will issue an error or a warning if a parameter is assigned to.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.parameterAssignment"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_STATIC_ON_METHOD

      public static final String COMPILER_PB_MISSING_STATIC_ON_METHOD
      Compiler option ID: Reporting a method that qualifies as static, but not declared static.

      When enabled, the compiler will issue an error or a warning if a method has not been declared as static, even though it qualifies as one.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.7
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_POTENTIALLY_MISSING_STATIC_ON_METHOD

      public static final String COMPILER_PB_POTENTIALLY_MISSING_STATIC_ON_METHOD
      Compiler option ID: Reporting a method that may qualify as static, but not declared static.

      When enabled, the compiler will issue an error or a warning if a method has not been declared as static, even though it may qualify as one, when another method doesn't override it.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.7
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNCLOSED_CLOSEABLE

      public static final String COMPILER_PB_UNCLOSED_CLOSEABLE
      Compiler option ID: Reporting a resource that is not closed properly.

      When enabled, the compiler will issue an error or a warning if a local variable holds a value of type java.lang.AutoCloseable (compliance>=1.7) or a value of type java.io.Closeable (compliance<=1.6) and if flow analysis shows that the method close() is not invoked locally on that value.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unclosedCloseable"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE

      public static final String COMPILER_PB_POTENTIALLY_UNCLOSED_CLOSEABLE
      Compiler option ID: Reporting a resource that may not be closed properly.

      When enabled, the compiler will issue an error or a warning if a local variable holds a value of type java.lang.AutoCloseable (compliance>=1.7) or a value of type java.io.Closeable (compliance<=1.6) and if flow analysis shows that the method close() is not invoked locally on that value for all execution paths.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE

      public static final String COMPILER_PB_EXPLICITLY_CLOSED_AUTOCLOSEABLE
      Compiler option ID: Reporting a resource that is not managed by try-with-resources.

      When enabled, the compiler will issue an error or a warning if a local variable holds a value of type java.lang.AutoCloseable, and if the method close() is explicitly invoked on that resource, but the resource is not managed by a try-with-resources block.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_ANNOTATION_RESOURCE_ANALYSIS

      public static final String COMPILER_ANNOTATION_RESOURCE_ANALYSIS
      Compiler option ID: Enable the use of specific annotations for more precise analysis of resource leaks.

      When enabled, the compiler will respect annotations by the names specified in COMPILER_OWNING_ANNOTATION_NAME and COMPILER_NOTOWNING_ANNOTATION_NAME

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.resourceanalysis"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.37
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_OWNING_ANNOTATION_NAME

      public static final String COMPILER_OWNING_ANNOTATION_NAME
      Compiler option ID: Name of annotation type for "owned" resource values.

      The annotation specified here should only be used on an element of type AutoCloseable or a subtype. It can be used in the following locations:

      Method parameter
      Signify that the receiving method is responsible for closing any resource value passed via this argument. At the caller side, passing an unclosed resource into this parameter satisfies any responsibility for this resource.
      Method
      Signify that every caller is responsible for closing any resource values received as return from this method. The method itself is entitled to return unclosed resources.
      Field:
      The enclosing class should implement AutoCloseable, and its AutoCloseable.close() method should close each field thusly annotated. Conversely, a constructor receiving an unclosed resource may satisfy its responsibility by assigning the resource to a field marked with this annotation.

      This option only has an effect if the option COMPILER_ANNOTATION_RESOURCE_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.owning"
      Possible values:
      A fully qualified name of an annotation declaration
      Default:
      "org.eclipse.jdt.annotation.Owning"
      Since:
      3.37
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NOTOWNING_ANNOTATION_NAME

      public static final String COMPILER_NOTOWNING_ANNOTATION_NAME
      Compiler option ID: Name of annotation type for "not-owned" resource values. This annotations is then inverse of COMPILER_OWNING_ANNOTATION_NAME.

      The annotation specified here should only be used on an element of type AutoCloseable or a subtype. It can be used in the following locations:

      Method parameter
      Signify that passing a resource into this parameter does not affect the caller's responsibility to close that resource. The receiving method has no obligations in this regard.
      Method
      Signify that returning a resource value from this method does not affect the responsibility to close. Given that the method can not close the resource after returning, the resource should therefore be stored in a field, for closing at a later point.
      Field:
      Storing a resource value in a field with this annotation does not affect responsibility to close. Storing an unclosed resource does not satisfy the responsibility, reading from such field does not create any responsibility.

      This option only has an effect if the option COMPILER_ANNOTATION_RESOURCE_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.notowning"
      Possible values:
      A fully qualified name of an annotation declaration
      Default:
      "org.eclipse.jdt.annotation.NotOwning"
      Since:
      3.37
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INCOMPATIBLE_OWNING_CONTRACT

      public static final String COMPILER_PB_INCOMPATIBLE_OWNING_CONTRACT
      Compiler option ID: Reporting when a method override incompatibly changes the owning contract.

      When enabled, the compiler will issue an error or a warning or an info if a method signature is incompatible with an overridden method from a super type in terms of resource ownership.

      Incompatibility occurs if:

      • A super parameter is tagged as owning (COMPILER_OWNING_ANNOTATION_NAME) but the corresponding parameter of the current method does not repeat this annotation.
      • The current method is tagged as owning (affecting the method return), but an overridden super method does not have this annotation.

      This option only has an effect if the option COMPILER_ANNOTATION_RESOURCE_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.incompatibleOwningContract"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.37
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE

      public static final String COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE
      Compiler option ID: Reporting a method invocation providing an argument of an unlikely type.

      When enabled, the compiler will issue an error or warning when certain well-known Collection methods that take an 'Object', like e.g. Map.get(Object), are used with an argument type that seems to be not related to the corresponding type argument of the Collection.

      By default, this analysis will apply some heuristics to determine whether or not two types may or may not be related, which can be changed via option COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.13
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT

      public static final String COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE_STRICT
      Compiler option ID: Perform strict analysis against the expected type of collection methods.

      This is a sub-option of COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE, which will replace the heuristics with strict compatibility checks, i.e., each argument that is not strictly compatible with the expected type will trigger an error or warning.

      This option has no effect if COMPILER_PB_UNLIKELY_COLLECTION_METHOD_ARGUMENT_TYPE is set to "ignore".

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.13
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE

      public static final String COMPILER_PB_UNLIKELY_EQUALS_ARGUMENT_TYPE
      Compiler option ID: Reporting a method invocation providing an argument of an unlikely type to method 'equals'.

      When enabled, the compiler will issue an error or warning when Object.equals(Object) is used with an argument type that seems to be not related to the receiver's type, or correspondingly when the arguments of Objects.equals(Object, Object) have types that seem to be not related to each other.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "info"
      Since:
      3.13
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_API_LEAKS

      public static final String COMPILER_PB_API_LEAKS
      Compiler option ID: Reporting when public API uses a non-API type.

      This option is relevant only when compiling code in a named module (at compliance 9 or greater).

      When enabled, the compiler will issue an error or warning when public API mentions a type that is not accessible to clients. Here, public API refers to signatures of public fields and methods declared by a public type in an exported package. In these positions types are complained against that are either not public or not in an exported package. Export qualification is not taken into account. If a type in one of these positions is declared in another module that is required by the current module, but without the transitive modifier, this is reported as a problem, too.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.APILeak"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.14
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNSTABLE_AUTO_MODULE_NAME

      public static final String COMPILER_PB_UNSTABLE_AUTO_MODULE_NAME
      Compiler option ID: Reporting when a module requires an auto module with an unstable name.

      The name of an auto module name is considered unstable when it is derived from a file name rather than being declared in the module's MANIFEST.MF.

      When enabled, the compiler will issue an error or warning when a module references an auto module with an unstable name in its 'requires' clause.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.14
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SUPPRESS_WARNINGS_NOT_FULLY_ANALYSED

      public static final String COMPILER_PB_SUPPRESS_WARNINGS_NOT_FULLY_ANALYSED
      Compiler option ID: Reporting when a @SuppressWarnings annotation might be unused, but exact information is not available.

      This issue occurs when a suppress warnings token (like, e.g., "unused") represents a group of problems, and some of the problems in that group are currently disabled (configured as "ignore"). In this situation the compiler may not know if none of the problems in that group could be found within the annotated code section.

      When enabled, the compiler will issue an error, warning or info when a @SuppressWarnings annotation was not observed to be necessary, but analysis of the suppressed group of problems was incomplete.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "info"
      Since:
      3.20
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_ANNOTATION_NULL_ANALYSIS

      public static final String COMPILER_ANNOTATION_NULL_ANALYSIS
      Compiler option ID: Annotation-based Null Analysis.

      This option controls whether the compiler will use null annotations for improved analysis of (potential) null references.

      When enabled, the compiler will interpret the annotation types defined using COMPILER_NONNULL_ANNOTATION_NAME and COMPILER_NULLABLE_ANNOTATION_NAME as specifying whether or not a given type includes the value null.

      The effect of these analyses is further controlled by the options COMPILER_PB_NULL_SPECIFICATION_VIOLATION, COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT and COMPILER_PB_NULL_UNCHECKED_CONVERSION.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nullanalysis"
      Possible values:
      { "disabled", "enabled" }
      Default:
      "disabled"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NULLABLE_ANNOTATION_NAME

      public static final String COMPILER_NULLABLE_ANNOTATION_NAME
      Compiler option ID: Name of Annotation Type for Nullable Types.

      This option defines a fully qualified Java type name that the compiler may use to perform special null analysis.

      If the annotation specified by this option is applied to a type in a method signature or variable declaration, this will be interpreted as a specification that null is a legal value in that position. Currently supported positions are: method parameters, method return type, fields and local variables.

      If a value whose type is annotated with this annotation is dereferenced without checking for null, the compiler will trigger a diagnostic as further controlled by COMPILER_PB_POTENTIAL_NULL_REFERENCE.

      The compiler may furthermore check adherence to the null specification as further controlled by COMPILER_PB_NULL_SPECIFICATION_VIOLATION, COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT and COMPILER_PB_NULL_UNCHECKED_CONVERSION.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nullable"
      Possible values:
      any legal, fully qualified Java type name; must resolve to an annotation type.
      Default:
      "org.eclipse.jdt.annotation.Nullable"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NULLABLE_ANNOTATION_SECONDARY_NAMES

      public static final String COMPILER_NULLABLE_ANNOTATION_SECONDARY_NAMES
      Compiler option ID: Names of Secondary Annotation Types for Nullable Types.

      This option defines a comma-separated list of fully qualified Java type names that the compiler may use to perform special null analysis.

      The annotation types identified by the names in this list are interpreted in the same way as the annotation identified by COMPILER_NULLABLE_ANNOTATION_NAME. The intention is to support libraries using different sets of null annotations, in addition to those used by the current project. Secondary null annotations should not be used in the project's own source code.

      JDT will never actively use any secondary annotation names from this list, i.e., inferred null annotations and content assist proposals mentioning null annotations are always rendered using the primary name from COMPILER_NULLABLE_ANNOTATION_NAME.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nullable.secondary"
      Possible values:
      a comma-separated list of legal, fully qualified Java type names; each name in the list must resolve to an annotation type.
      Default:
      ""
      Since:
      3.12
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NONNULL_ANNOTATION_NAME

      public static final String COMPILER_NONNULL_ANNOTATION_NAME
      Compiler option ID: Name of Annotation Type for Non-Null Types.

      This option defines a fully qualified Java type name that the compiler may use to perform special null analysis.

      If the annotation specified by this option is applied to a type in a method signature or variable declaration, this will be interpreted as a specification that null is not a legal value in that position. Currently supported positions are: method parameters, method return type, fields and local variables.

      For values declared with this annotation, the compiler will never trigger a null reference diagnostic (as controlled by COMPILER_PB_POTENTIAL_NULL_REFERENCE and COMPILER_PB_NULL_REFERENCE), because the assumption is made that null will never occur at runtime in these positions.

      The compiler may furthermore check adherence to the null specification as further controlled by COMPILER_PB_NULL_SPECIFICATION_VIOLATION, COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT and COMPILER_PB_NULL_UNCHECKED_CONVERSION.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nonnull"
      Possible values:
      any legal, fully qualified Java type name; must resolve to an annotation type.
      Default:
      "org.eclipse.jdt.annotation.NonNull"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NONNULL_ANNOTATION_SECONDARY_NAMES

      public static final String COMPILER_NONNULL_ANNOTATION_SECONDARY_NAMES
      Compiler option ID: Names of Secondary Annotation Types for Non-Null Types.

      This option defines a comma-separated list of fully qualified Java type names that the compiler may use to perform special null analysis.

      The annotation types identified by the names in this list are interpreted in the same way as the annotation identified by COMPILER_NONNULL_ANNOTATION_NAME. The intention is to support libraries using different sets of null annotations, in addition to those used by the current project. Secondary null annotations should not be used in the project's own source code.

      JDT will never actively use any secondary annotation names from this list, i.e., inferred null annotations and content assist proposals mentioning null annotations are always rendered using the primary name from COMPILER_NONNULL_ANNOTATION_NAME.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nonnull.secondary"
      Possible values:
      a comma-separated list of legal, fully qualified Java type names; each name in the list must resolve to an annotation type.
      Default:
      ""
      Since:
      3.12
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME

      public static final String COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME
      Compiler option ID: Name of Annotation Type to specify a nullness default for unannotated types.

      This option defines a fully qualified Java type name that the compiler may use to perform special null analysis.

      If the annotation is applied without an argument, all unannotated types in method signatures and field declarations within the annotated element will be treated as if they were specified with the non-null annotation (see COMPILER_NONNULL_ANNOTATION_NAME).

      If the annotation is applied with the constant false as its argument all corresponding defaults at outer scopes will be canceled for the annotated element.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nonnullbydefault"
      Possible values:
      any legal, fully qualified Java type name; must resolve to an annotation type. That annotation type should have exactly one boolean parameter.
      Default:
      "org.eclipse.jdt.annotation.NonNullByDefault"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_SECONDARY_NAMES

      public static final String COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_SECONDARY_NAMES
      Compiler option ID: Names of Secondary Annotation Types to specify a nullness default for unannotated types.

      This option defines a comma-separated list of fully qualified Java type names that the compiler may use to perform special null analysis.

      The annotation types identified by the names in this list are interpreted in the same way as the annotation identified by COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME. The intention is to support libraries using different sets of null annotations, in addition to those used by the current project. Secondary null annotations should not be used in the project's own source code.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary"
      Possible values:
      a comma-separated list of legal, fully qualified Java type names; each name in the list must resolve to an annotation type.
      Default:
      ""
      Since:
      3.12
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION

      public static final String COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION
      Compiler option ID: Reporting missing default nullness annotation.

      When enabled, the compiler will issue an error or a warning in the following cases:

      • When a package does not contain a default nullness annotation, as a result of missing package-info.java or missing default nullness annotation in package-info.java.
      • When a type inside a default package does not contain a default nullness annotation.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation"
      Possible values:
      { "error", "warning", "info", "ignore" }.
      Default:
      "ignore"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • CORE_JAVA_BUILD_EXTERNAL_ANNOTATIONS_FROM_ALL_LOCATIONS

      public static final String CORE_JAVA_BUILD_EXTERNAL_ANNOTATIONS_FROM_ALL_LOCATIONS
      Core option ID: Read external annotations from all build path entries.

      This option controls where the compiler will look for external annotations for enhanced null analysis

      When enabled, the compiler will search all buildpath entries of a given project to locate external annotation files (.eea) in order to superimpose null annotations over classes read from dependencies.

      Option id:
      "org.eclipse.jdt.core.builder.annotationPath.allLocations"
      Possible values:
      { "disabled", "enabled" }
      Default:
      "disabled"
      Since:
      3.27
      See Also:
      Category:
      CoreOptionID
    • COMPILER_PB_NULL_SPECIFICATION_VIOLATION

      public static final String COMPILER_PB_NULL_SPECIFICATION_VIOLATION
      Compiler option ID: Reporting Violations of Null Specifications.

      Depending on this option, the compiler will issue either an error or a warning whenever one of the following situations is detected:

      1. A method declared with a nonnull annotation returns a nullable expression.
      2. A nullable expression is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.
      3. A nullable expression is assigned to a local variable that is declared with a nonnull annotation.
      4. A method that overrides an inherited method declared with a nonnull annotation tries to relax that contract by specifying a nullable annotation (prohibition of contravariant return).
      5. A method that overrides an inherited method which has a nullable declaration for at least one of its parameters, tries to tighten that null contract by specifying a nonnull annotation for its corresponding parameter (prohibition of covariant parameters).
      6. A non-static field with a nonnull annotation is not definitely assigned at the end of each constructor.
      7. A static field with a nonnull annotation is not definitely assigned in static initializers.
      In the above an expression is considered as nullable if either it is statically known to evaluate to the value null, or if it is declared with a nullable annotation.

      The compiler options COMPILER_NONNULL_ANNOTATION_NAME and COMPILER_NULLABLE_ANNOTATION_NAME control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nullSpecViolation"
      Possible values:
      { "error", "warning" }
      Default:
      "error"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT

      public static final String COMPILER_PB_NULL_ANNOTATION_INFERENCE_CONFLICT
      Compiler option ID: Reporting conflicts between declared null annotation and inferred null value

      When enabled, the compiler will issue an error or a warning whenever one of the following situations is detected:

      1. A method declared with a nonnull annotation returns an expression that is statically known to evaluate to a null value on some flow.
      2. An expression that is statically known to evaluate to a null value on some flow is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.
      3. An expression that is statically known to evaluate to a null value on some flow is assigned to a local variable that is declared with a nonnull annotation.

      The compiler options COMPILER_NONNULL_ANNOTATION_NAME and COMPILER_NULLABLE_ANNOTATION_NAME control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "error"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NULL_UNCHECKED_CONVERSION

      public static final String COMPILER_PB_NULL_UNCHECKED_CONVERSION
      Compiler option ID: Reporting unchecked conversion from a type with unknown nullness to a null annotated type

      When enabled, the compiler will issue an error or a warning whenever one of the following situations is detected:

      1. A method declared with a nonnull annotation returns an expression for which insufficient nullness information is available for statically proving that no flow will pass a null value at runtime.
      2. An expression for which insufficient nullness information is available for statically proving that it will never evaluate to a null value at runtime is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.
      3. An expression for which insufficient nullness information is available for statically proving that it will never evaluate to a null value at runtime is assigned to a local variable that is declared with a nonnull annotation.

      Unchecked null conversion is usually a consequence of using other unannotated variables or methods.

      The compiler options COMPILER_NONNULL_ANNOTATION_NAME and COMPILER_NULLABLE_ANNOTATION_NAME control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES

      public static final String COMPILER_PB_PESSIMISTIC_NULL_ANALYSIS_FOR_FREE_TYPE_VARIABLES
      Compiler option ID: Reporting problems detected by pessimistic null analysis for free type variables.

      Unless set to "ignore", type variables not affected by any explicit null annotation are pessimistically analyzed in two directions: When reading a value of this type, it is assumed to be nullable. When this type appears as the required type (i.e., at the left hand side of an assignment or variable initialization, or as the method return type against which a return statement is being checked) the type is considered to require the nonnull property.

      Problems reported due to this pessimistic analysis are reported with the level given in this option.

      Since:
      3.12
      See Also:
      Category:
      CompilerOptionID
      Option id:
      "org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
    • COMPILER_PB_REDUNDANT_NULL_ANNOTATION

      public static final String COMPILER_PB_REDUNDANT_NULL_ANNOTATION
      Compiler option ID: Reporting Redundant Null Annotations.

      When enabled, the compiler will issue an error or a warning when a non-null annotation (see COMPILER_NONNULL_ANNOTATION_NAME) is applied although the same effect is already achieved by a default applicable at the current location. Such a default may be set by using the annotation specified by the option COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.8
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS

      public static final String COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
      Compiler option ID: Perform syntactic null analysis for fields.

      When enabled, the compiler will detect certain syntactic constellations where a null related warning against a field reference would normally be raised but can be suppressed at low risk given that the same field reference was known to be non-null immediately before.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields"
      Possible values:
      { "disabled", "enabled" }
      Default:
      "disabled"
      Since:
      3.9
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_INHERIT_NULL_ANNOTATIONS

      public static final String COMPILER_INHERIT_NULL_ANNOTATIONS
      Compiler option ID: Inheritance of null annotations.

      When enabled, the compiler will check for each method without any explicit null annotations: If it overrides a method which has null annotations, it will treat the current method as if it had the same annotations as the overridden method.

      Annotation inheritance will use the effective nullness of the overridden method after transitively applying inheritance and after applying any default nullness (see COMPILER_NONNULL_BY_DEFAULT_ANNOTATION_NAME) at the site of the overridden method.

      If different implicit null annotations (from a nonnull default and/or overridden methods) are applicable to the same type in a method signature, this is flagged as an error and an explicit null annotation must be used to disambiguate.

      Option id:
      "org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations"
      Possible values:
      { "disabled", "enabled" }
      Default:
      "disabled"
      Since:
      3.9
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED

      public static final String COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED
      Compiler option ID: Reporting Dropped Nonnull Parameter Annotations.

      When enabled, the compiler will issue an error or a warning against a parameter of a method that overrides an inherited method if all of the following hold:

      This particular situation bears the same inherent risk as any unannotated method parameter, because the compiler's null ananysis cannot decide wither null is or is not a legal value for this parameter. However, the annotation in the overridden method suggests that the parameter should also be annotated as non-null. If that is not intended or possible, it is recommended to annotate the parameter as nullable, in order to make this (legal) change of contract explicit.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.9
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION

      public static final String COMPILER_PB_NONNULL_TYPEVAR_FROM_LEGACY_INVOCATION
      Compiler option ID: Reporting Unsafe NonNull Interpretation Of Type Variables.

      When enabled, the compiler will issue an error or a warning against a method call if all of the following hold:

      • The method's declared return type is a type variable without any null annotation.
      • For the given invocation this type variable is substituted with a nonnull type.
      • The type declaring the method is provided by a third-party library.
      • No null annotations exist for this library type, neither in its class file nor using external annotations.

      This particular situation leverages the option to consistently substitute all occurrences of a type variable with a nonnull type, but it bears the risk that the library type may not be aware of null annotations thus lacking a necessary @Nullable annotation for a particular occurrence of a type variable.

      This option only has an effect if the option COMPILER_ANNOTATION_NULL_ANALYSIS is enabled and when the configured set of null annotations declares the target TYPE_USE

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.12
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_ANNOTATED_TYPE_ARGUMENT_TO_UNANNOTATED

      public static final String COMPILER_PB_ANNOTATED_TYPE_ARGUMENT_TO_UNANNOTATED
      Compiler option ID: Reporting Unsafe Conversion To Unannotated Type Argument.

      When enabled, the compiler will issue an error, warning or info when a value of a parameterized type with annotated type arguments is assigned to a variable / bound to a method argument, where the corresponding type argument is unannotated.

      This situation is problematic because it will enable using the less-annotated type to manipulate the given objects in ways that may violate contracts of the more-annotated type.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "info"
      Since:
      3.21
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_SOURCE

      public static final String COMPILER_SOURCE
      Compiler option ID: Setting Source Compatibility Mode.

      Specify whether which source level compatibility is used. From 1.4 on, 'assert' is a keyword reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM level should be set to "1.4" and the compliance mode should be "1.4".

      Source level 1.5 is necessary to enable generics, autoboxing, covariance, annotations, enumerations enhanced for loop, static imports and varargs.

      In source levels "1.5" and higher, the compliance and target settings should be set to the same version as the source level.

      Option id:
      "org.eclipse.jdt.core.compiler.source"
      Possible values:
      { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }
      Default:
      "1.3"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_COMPLIANCE

      public static final String COMPILER_COMPLIANCE
      Compiler option ID: Setting Compliance Level.

      Select the compliance level for the compiler. COMPILER_SOURCE and COMPILER_CODEGEN_TARGET_PLATFORM settings cannot be higher than the compiler compliance level. In "1.5" and higher compliance, source and target settings should match the compliance setting.

      Option id:
      "org.eclipse.jdt.core.compiler.compliance"
      Possible values:
      { "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "9", "10", "11" }
      Default:
      "1.4"
      Since:
      2.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_RELEASE

      public static final String COMPILER_RELEASE
      Compiler option ID: Use system libraries from release.

      When enabled, the compiler will compile against the system libraries from release of the specified compliance level

      Setting this option sets the COMPILER_CODEGEN_TARGET_PLATFORM) and COMPILER_SOURCE to the same level as the compiler compliance. This option is available to a project only when a supporting JDK is found in the project's build path

      Option id:
      "org.eclipse.jdt.core.compiler.release"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.14
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_TASK_PRIORITIES

      public static final String COMPILER_TASK_PRIORITIES
      Compiler option ID: Defining the Automatic Task Priorities.

      In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low) of the task markers issued by the compiler. If the default is specified, the priority of each task marker is "NORMAL".

      Task Priorities and task tags must have the same length. If task priorities are set, then task tags should also be set.

      Option id:
      "org.eclipse.jdt.core.compiler.taskPriorities"
      Possible values:
      { "<priority>[,<priority>]*" } where <priority> is one of "HIGH", "NORMAL" or "LOW"
      Default:
      "NORMAL,HIGH,NORMAL"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_TASK_TAGS

      public static final String COMPILER_TASK_TAGS
      Compiler option ID: Defining the Automatic Task Tags.

      When the tag list is not empty, the compiler will issue a task marker whenever it encounters one of the corresponding tags inside any comment in Java source code.

      Generated task messages will start with the tag, and range until the next line separator, comment ending, or tag.

      When a given line of code bears multiple tags, each tag will be reported separately. Moreover, a tag immediately followed by another tag will be reported using the contents of the next non-empty tag of the line, if any.

      Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by another letter or digit to be recognized ("fooToDo" will not be recognized as a task for tag "ToDo", but "foo#ToDo" will be detected for either tag "ToDo" or "#ToDo"). Respectively, a tag ending with a letter or digit cannot be followed by a letter or digit to be recognized ("ToDofoo" will not be recognized as a task for tag "ToDo", but "ToDo:foo" will be detected either for tag "ToDo" or "ToDo:").

      Task Priorities and task tags must have the same length. If task tags are set, then task priorities should also be set.

      Option id:
      "org.eclipse.jdt.core.compiler.taskTags"
      Possible values:
      { "<tag>[,<tag>]*" } where <tag> is a String without any wild-card or leading/trailing spaces
      Default:
      "TODO,FIXME,XXX"
      Since:
      2.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_TASK_CASE_SENSITIVE

      public static final String COMPILER_TASK_CASE_SENSITIVE
      Compiler option ID: Determining whether task tags are case-sensitive.

      When enabled, task tags are considered in a case-sensitive way.

      Option id:
      "org.eclipse.jdt.core.compiler.taskCaseSensitive"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.0
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_FORBIDDEN_REFERENCE

      public static final String COMPILER_PB_FORBIDDEN_REFERENCE
      Compiler option ID: Reporting Forbidden Reference to Type with Restricted Access.

      When enabled, the compiler will issue an error or a warning when referring to a type that is non accessible, as defined according to the access rule specifications.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.forbiddenReference"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "error"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_DISCOURAGED_REFERENCE

      public static final String COMPILER_PB_DISCOURAGED_REFERENCE
      Compiler option ID: Reporting Discouraged Reference to Type with Restricted Access.

      When enabled, the compiler will issue an error or a warning when referring to a type with discouraged access, as defined according to the access rule specifications.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.discouragedReference"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SUPPRESS_WARNINGS

      public static final String COMPILER_PB_SUPPRESS_WARNINGS
      Compiler option ID: Determining Effect of @SuppressWarnings.

      When enabled, the @SuppressWarnings annotation can be used to suppress some compiler warnings.

      When disabled, all @SupressWarnings annotations are ignored; i.e., warnings are reported.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.suppressWarnings"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS

      public static final String COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS
      Compiler option ID: Raise null related errors or warnings arising because of assert statements.

      When enabled, the compiler will flag all null related errors or warnings that have been enabled by the user, irrespective of whether a variable occurred in an assert statement.

      When disabled, the compiler will not flag null related errors or warnings on variables that got marked as maybe or definitely null in an assert statement upstream.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.7
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS

      public static final String COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS
      Compiler option ID: Further Determining the Effect of @SuppressWarnings if also COMPILER_PB_SUPPRESS_WARNINGS is enabled.

      When enabled, the @SuppressWarnings annotation can additionally be used to suppress optional compiler diagnostics that have been configured as ERROR.

      When disabled, all @SuppressWarnings annotations only affects warnings.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.6
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNHANDLED_WARNING_TOKEN

      public static final String COMPILER_PB_UNHANDLED_WARNING_TOKEN
      Compiler option ID: Reporting Unhandled Warning Token for @SuppressWarnings.

      When enabled, the compiler will issue an error or a warning when encountering a token it cannot handle inside a @SuppressWarnings annotation.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unhandledWarningToken"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.1
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_WARNING_TOKEN

      public static final String COMPILER_PB_UNUSED_WARNING_TOKEN
      Compiler option ID: Reporting Unnecessary @SuppressWarnings.

      When enabled, the compiler will issue an error or a warning when encountering @SuppressWarnings annotation for which no corresponding warning got detected in the code. This diagnostic is provided to help developers to get rid of transient @SuppressWarnings no longer needed. Note that @SuppressWarnings("all") is still silencing the warning for unnecessary @SuppressWarnings, as it is the master switch to silence ALL warnings.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedWarningToken"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_NULL_REFERENCE

      public static final String COMPILER_PB_NULL_REFERENCE
      Compiler option ID: Reporting Null Dereference.

      When enabled, the compiler will issue an error or a warning whenever a variable that is statically known to hold a null value is used to access a field or method.

      Assert statements are ignored unless COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.nullReference"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.2
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_POTENTIAL_NULL_REFERENCE

      public static final String COMPILER_PB_POTENTIAL_NULL_REFERENCE
      Compiler option ID: Reporting Potential Null Dereference.

      When enabled, the compiler will issue an error or a warning whenever a variable that has formerly been tested against null but is not (no more) statically known to hold a non-null value is used to access a field or method.

      Assert statements are ignored unless COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.potentialNullReference"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.3
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_REDUNDANT_NULL_CHECK

      public static final String COMPILER_PB_REDUNDANT_NULL_CHECK
      Compiler option ID: Reporting Redundant Null Check.

      When enabled, the compiler will issue an error or a warning whenever a variable that is statically known to hold a null or a non-null value is tested against null.

      Assert statements are ignored unless COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS is enabled.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.redundantNullCheck"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.3
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION

      public static final String COMPILER_PB_OVERRIDING_METHOD_WITHOUT_SUPER_INVOCATION
      Compiler option ID: Reporting Overriding method that doesn't call the super method invocation.

      When enabled, the compiler will issue an error or a warning if a method is overriding a method without calling the super invocation.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.3
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_REDUNDANT_SUPERINTERFACE

      public static final String COMPILER_PB_REDUNDANT_SUPERINTERFACE
      Compiler option ID: Reporting Redundant Superinterface.

      When enabled, the compiler will issue an error or a warning if a type explicitly implements an interface that is already implemented by any of its supertypes.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.4
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_COMPARING_IDENTICAL

      public static final String COMPILER_PB_COMPARING_IDENTICAL
      Compiler option ID: Reporting Comparison of Identical Expressions.

      When enabled, the compiler will issue an error or a warning if a comparison is involving identical operands (e.g 'x == x').

      Option id:
      "org.eclipse.jdt.core.compiler.problem.comparingIdentical"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.5
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD

      public static final String COMPILER_PB_MISSING_SYNCHRONIZED_ON_INHERITED_METHOD
      Compiler option ID: Reporting Missing Synchronized Modifier On Inherited Method.

      When enabled, the compiler will issue an error or a warning if a method overrides a synchronized method without having a synchronized modifier.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.5
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_UNUSED_OBJECT_ALLOCATION

      public static final String COMPILER_PB_UNUSED_OBJECT_ALLOCATION
      Compiler option ID: Reporting Allocation of an Unused Object.

      When enabled, the compiler will issue an error or a warning if an object is allocated but never used, neither by holding a reference nor by invoking one of the object's methods.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.6
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_REDUNDANT_TYPE_ARGUMENTS

      public static final String COMPILER_PB_REDUNDANT_TYPE_ARGUMENTS
      Compiler option ID: Reporting redundant specification of type arguments in class instance creation expressions.

      When enabled, the compiler will issue an error or a warning if type arguments are used in a class instance creation, when the '<>' operator can be used instead.

      This option only has an effect if the compiler compliance is 1.7 or greater.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments"
      Possible values:
      { "error", "warning", "info", "ignore" }
      Default:
      "ignore"
      Since:
      3.7.1
      See Also:
      Category:
      CompilerOptionID
    • CORE_JAVA_BUILD_ORDER

      public static final String CORE_JAVA_BUILD_ORDER
      Core option ID: Computing Project Build Order.

      Indicate whether JavaCore should enforce the project build order to be based on the classpath prerequisite chain. When requesting to compute, this takes over the platform default order (based on project references).

      Option id:
      "org.eclipse.jdt.core.computeJavaBuildOrder"
      Possible values:
      { "compute", "ignore" }
      Default:
      "ignore"
      See Also:
      Category:
      CoreOptionID
    • CORE_JAVA_BUILD_RESOURCE_COPY_FILTER

      public static final String CORE_JAVA_BUILD_RESOURCE_COPY_FILTER
      Core option ID: Specifying Filters for Resource Copying Control.

      Allow to specify some filters to control the resource copy process.

      Option id:
      "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"
      Possible values:
      { "<name>[,<name>]* } where <name> is a file name pattern (* and ? wild-cards allowed) or the name of a folder which ends with '/'
      Default:
      ""
      Since:
      2.0
      See Also:
      Category:
      CoreOptionID
    • CORE_JAVA_BUILD_DUPLICATE_RESOURCE

      public static final String CORE_JAVA_BUILD_DUPLICATE_RESOURCE
      Core option ID: Reporting Duplicate Resources.

      Indicate the severity of the problem reported when more than one occurrence of a resource is to be copied into the output location.

      Option id:
      "org.eclipse.jdt.core.builder.duplicateResourceTask"
      Possible values:
      { "error", "warning" }
      Default:
      "warning"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER

      public static final String CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER
      Core option ID: Cleaning Output Folder(s).

      Indicate whether the JavaBuilder is allowed to clean the output folders when performing full build operations.

      Option id:
      "org.eclipse.jdt.core.builder.cleanOutputFolder"
      Possible values:
      { "clean", "ignore" }
      Default:
      "clean"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER

      public static final String CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER
      Core option ID: Recreate Modified class files in Output Folder.

      Indicate whether the JavaBuilder should check for any changes to .class files in the output folders while performing incremental build operations. If changes are detected to managed .class files, then a full build is performed, otherwise the changes are left as is. Tools further altering generated .class files, like optimizers, should ensure this option remains set in its default state of ignore.

      Option id:
      "org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder"
      Possible values:
      { "enabled", "ignore" }
      Default:
      "ignore"
      Since:
      3.2
      See Also:
      Category:
      CoreOptionID
    • CORE_INCOMPLETE_CLASSPATH

      public static final String CORE_INCOMPLETE_CLASSPATH
      Core option ID: Reporting Incomplete Classpath.

      Indicate the severity of the problem reported when an entry on the classpath does not exist, is not legitimate or is not visible (for example, a referenced project is closed).

      Option id:
      "org.eclipse.jdt.core.incompleteClasspath"
      Possible values:
      { "error", "warning"}
      Default:
      "error"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_CIRCULAR_CLASSPATH

      public static final String CORE_CIRCULAR_CLASSPATH
      Core option ID: Reporting Classpath Cycle.

      Indicate the severity of the problem reported when a project is involved in a cycle.

      Option id:
      "org.eclipse.jdt.core.circularClasspath"
      Possible values:
      { "error", "warning" }
      Default:
      "error"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_INCOMPATIBLE_JDK_LEVEL

      public static final String CORE_INCOMPATIBLE_JDK_LEVEL
      Core option ID: Reporting Incompatible JDK Level for Required Binaries.

      Indicate the severity of the problem reported when a project prerequisites another project or library with an incompatible target JDK level (e.g. project targeting 1.1 vm, but compiled against 1.4 libraries).

      Option id:
      "org.eclipse.jdt.core.incompatibleJDKLevel"
      Possible values:
      { "error", "warning", "ignore" }
      Default:
      "ignore"
      Since:
      3.0
      See Also:
      Category:
      CoreOptionID
    • CORE_JAVA_BUILD_INVALID_CLASSPATH

      public static final String CORE_JAVA_BUILD_INVALID_CLASSPATH
      Core option ID: Abort if Invalid Classpath.

      Allow to toggle the builder to abort if the classpath is invalid.

      Option id:
      "org.eclipse.jdt.core.builder.invalidClasspath"
      Possible values:
      { "abort", "ignore" }
      Default:
      "abort"
      Since:
      2.0
      See Also:
      Category:
      CoreOptionID
    • CORE_ENCODING

      public static final String CORE_ENCODING
      Core option ID: Default Source Encoding Format.

      Get the default encoding format of source files. This value is immutable and preset to the result of ResourcesPlugin.getEncoding().

      It is offered as a convenience shortcut only.

      Option id:
      "org.eclipse.jdt.core.encoding"
      value:
      <immutable, platform default value>
      Since:
      2.0
      See Also:
      Category:
      CoreOptionID
    • CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS

      public static final String CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS
      Core option ID: Enabling Usage of Classpath Exclusion Patterns.

      When disabled, no entry on a project classpath can be associated with an exclusion pattern.

      Option id:
      "org.eclipse.jdt.core.classpath.exclusionPatterns"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS

      public static final String CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS
      Core option ID: Enabling Usage of Classpath Multiple Output Locations.

      When disabled, no entry on a project classpath can be associated with a specific output location, preventing thus usage of multiple output locations.

      Option id:
      "org.eclipse.jdt.core.classpath.multipleOutputLocations"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      2.1
      See Also:
      Category:
      CoreOptionID
    • CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE

      public static final String CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE
      Core option ID: Reporting an output location overlapping another source location.

      Indicate the severity of the problem reported when a source entry's output location overlaps another source entry.

      Option id:
      "org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource"
      Possible values:
      { "error", "warning", "ignore" }
      Default:
      "error"
      Since:
      3.6.4
      See Also:
    • CORE_MAIN_ONLY_PROJECT_HAS_TEST_ONLY_DEPENDENCY

      public static final String CORE_MAIN_ONLY_PROJECT_HAS_TEST_ONLY_DEPENDENCY
      Core option ID: Reporting if a project which has only main sources depends on a project with only test sources.

      Indicate the severity of the problem reported when a project that has one or more main source folders but no test source folders has a project on its build path that only has one or more test source folders, but no main source folders.

      Option id:
      "org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency"
      Possible values:
      { "error", "ignore" }
      Default:
      "error"
      Since:
      3.16
      See Also:
    • COMPILER_PB_ENABLE_PREVIEW_FEATURES

      public static final String COMPILER_PB_ENABLE_PREVIEW_FEATURES
      Compiler option ID: Enabling support for preview language features.

      When enabled, the compiler will activate the preview language features of this Java version.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.18
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_PB_REPORT_PREVIEW_FEATURES

      public static final String COMPILER_PB_REPORT_PREVIEW_FEATURES
      Compiler option ID: Reporting Preview features.

      When enabled, the compiler will issue a warning when a preview feature is used.

      Option id:
      "org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures"
      Possible values:
      { "warning", "info", "ignore" }
      Default:
      "warning"
      Since:
      3.18
      See Also:
      Category:
      CompilerOptionID
    • COMPILER_IGNORE_UNNAMED_MODULE_FOR_SPLIT_PACKAGE

      public static final String COMPILER_IGNORE_UNNAMED_MODULE_FOR_SPLIT_PACKAGE
      Compiler option ID: Ignore unnamed module for split package.

      With this option the compiler will deliberately accept programs violating JLS in a specific way. Instead the compiler will behave in accordance to the original, but unmaintained document "The State of the Module System", which indicates that different semantics had been intended.

      Option id:
      "org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.32
      See Also:
      Category:
      CompilerOptionID
    • TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC

      public static final String TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC
      Core option ID: Set the timeout value for retrieving the method's parameter names from javadoc.

      Timeout in milliseconds to retrieve the method's parameter names from javadoc.

      If the value is 0, the parameter names are not fetched and the raw names are returned.

      Option id:
      "org.eclipse.jdt.core.timeoutForParameterNameFromAttachedJavadoc"
      Possible values:
      "<n>", where n is an integer greater than or equal to 0
      Default:
      "50"
      Since:
      3.2
      See Also:
      Category:
      CoreOptionID
    • JAVA_FORMATTER

      public static final String JAVA_FORMATTER
      Core option ID: The ID of the formatter to use in formatting operations.
      Option id:
      "org.eclipse.jdt.core.javaFormatter"
      Default:
      "org.eclipse.jdt.core.defaultJavaFormatter"
      Since:
      3.11
      See Also:
      Category:
      CoreOptionID
    • FORMATTER_NEWLINE_OPENING_BRACE

      public static final String FORMATTER_NEWLINE_OPENING_BRACE
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_NEWLINE_CONTROL

      public static final String FORMATTER_NEWLINE_CONTROL
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_NEWLINE_ELSE_IF

      public static final String FORMATTER_NEWLINE_ELSE_IF
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_NEWLINE_EMPTY_BLOCK

      public static final String FORMATTER_NEWLINE_EMPTY_BLOCK
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_CLEAR_BLANK_LINES

      public static final String FORMATTER_CLEAR_BLANK_LINES
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_LINE_SPLIT

      public static final String FORMATTER_LINE_SPLIT
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_COMPACT_ASSIGNMENT

      public static final String FORMATTER_COMPACT_ASSIGNMENT
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_TAB_CHAR

      public static final String FORMATTER_TAB_CHAR
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_TAB_SIZE

      public static final String FORMATTER_TAB_SIZE
      Since:
      2.0
      See Also:
      Category:
      DeprecatedOptionID
    • FORMATTER_SPACE_CASTEXPRESSION

      public static final String FORMATTER_SPACE_CASTEXPRESSION
      Since:
      2.1
      See Also:
      Category:
      DeprecatedOptionID
    • CODEASSIST_VISIBILITY_CHECK

      public static final String CODEASSIST_VISIBILITY_CHECK
      Code assist option ID: Activate Visibility Sensitive Completion.

      When active, completion doesn't show that you can not see (for example, you can not see private methods of a super class).

      Option id:
      "org.eclipse.jdt.core.codeComplete.visibilityCheck"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      2.0
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_DEPRECATION_CHECK

      public static final String CODEASSIST_DEPRECATION_CHECK
      Code assist option ID: Activate Deprecation Sensitive Completion.

      When enabled, completion doesn't propose deprecated members and types.

      Option id:
      "org.eclipse.jdt.core.codeComplete.deprecationCheck"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.2
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_CAMEL_CASE_MATCH

      public static final String CODEASSIST_CAMEL_CASE_MATCH
      Code assist option ID: Activate Camel Case Sensitive Completion.

      When enabled, completion shows proposals whose name match the CamelCase pattern.

      Option id:
      "org.eclipse.jdt.core.codeComplete.camelCaseMatch"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.2
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_SUBSTRING_MATCH

      public static final String CODEASSIST_SUBSTRING_MATCH
      Deprecated.
      - this option has no effect
      Code assist option ID: Activate Substring Code Completion.

      When enabled, completion shows proposals in which the pattern can be found as a substring in a case-insensitive way.

      Option id:
      "org.eclipse.jdt.core.codeComplete.substringMatch"
      Since:
      3.12
      See Also:
      Category:
      DeprecatedOptionID
    • CODEASSIST_SUBWORD_MATCH

      public static final String CODEASSIST_SUBWORD_MATCH
      Code assist option ID: Activate Subword Code Completion.

      When enabled, completion shows proposals in which the pattern can be found as a subword in a case-insensitive way.

      Option id:
      "org.eclipse.jdt.core.codeComplete.subwordMatch"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.21
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_IMPLICIT_QUALIFICATION

      public static final String CODEASSIST_IMPLICIT_QUALIFICATION
      Code assist option ID: Automatic Qualification of Implicit Members.

      When active, completion automatically qualifies completion on implicit field references and message expressions.

      Option id:
      "org.eclipse.jdt.core.codeComplete.forceImplicitQualification"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      2.0
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_FIELD_PREFIXES

      public static final String CODEASSIST_FIELD_PREFIXES
      Code assist option ID: Define the Prefixes for Field Name.

      When the prefixes is non empty, completion for field name will begin with one of the proposed prefixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.fieldPrefixes"
      Possible values:
      { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_STATIC_FIELD_PREFIXES

      public static final String CODEASSIST_STATIC_FIELD_PREFIXES
      Code assist option ID: Define the Prefixes for Static Field Name.

      When the prefixes is non empty, completion for static field name will begin with one of the proposed prefixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.staticFieldPrefixes"
      Possible values:
      { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_STATIC_FINAL_FIELD_PREFIXES

      public static final String CODEASSIST_STATIC_FINAL_FIELD_PREFIXES
      Code assist option ID: Define the Prefixes for Static Final Field Name.

      When the prefixes is non empty, completion for static final field name will begin with one of the proposed prefixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes"
      Possible values:
      { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
      Default:
      ""
      Since:
      3.5
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_LOCAL_PREFIXES

      public static final String CODEASSIST_LOCAL_PREFIXES
      Code assist option ID: Define the Prefixes for Local Variable Name.

      When the prefixes is non empty, completion for local variable name will begin with one of the proposed prefixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.localPrefixes"
      Possible values:
      { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_ARGUMENT_PREFIXES

      public static final String CODEASSIST_ARGUMENT_PREFIXES
      Code assist option ID: Define the Prefixes for Argument Name.

      When the prefixes is non empty, completion for argument name will begin with one of the proposed prefixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.argumentPrefixes"
      Possible values:
      { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_FIELD_SUFFIXES

      public static final String CODEASSIST_FIELD_SUFFIXES
      Code assist option ID: Define the Suffixes for Field Name.

      When the suffixes is non empty, completion for field name will end with one of the proposed suffixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.fieldSuffixes"
      Possible values:
      { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_STATIC_FIELD_SUFFIXES

      public static final String CODEASSIST_STATIC_FIELD_SUFFIXES
      Code assist option ID: Define the Suffixes for Static Field Name.

      When the suffixes is non empty, completion for static field name will end with one of the proposed suffixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.staticFieldSuffixes"
      Possible values:
      "<suffix>[,<suffix>]*" < where <suffix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES

      public static final String CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES
      Code assist option ID: Define the Suffixes for Static Final Field Name.

      When the suffixes is non empty, completion for static final field name will end with one of the proposed suffixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes"
      Possible values:
      "<suffix>[<suffix>]*" < where <suffix> is a String without any wild-card
      Default:
      ""
      Since:
      3.5
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_LOCAL_SUFFIXES

      public static final String CODEASSIST_LOCAL_SUFFIXES
      Code assist option ID: Define the Suffixes for Local Variable Name.

      When the suffixes is non empty, completion for local variable name will end with one of the proposed suffixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.localSuffixes"
      Possible values:
      { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_ARGUMENT_SUFFIXES

      public static final String CODEASSIST_ARGUMENT_SUFFIXES
      Code assist option ID: Define the Suffixes for Argument Name.

      When the suffixes is non empty, completion for argument name will end with one of the proposed suffixes.

      Option id:
      "org.eclipse.jdt.core.codeComplete.argumentSuffixes"
      Possible values:
      { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
      Default:
      ""
      Since:
      2.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_FORBIDDEN_REFERENCE_CHECK

      public static final String CODEASSIST_FORBIDDEN_REFERENCE_CHECK
      Code assist option ID: Activate Forbidden Reference Sensitive Completion.

      When enabled, completion doesn't propose elements which match a forbidden reference rule.

      Option id:
      "org.eclipse.jdt.core.codeComplete.forbiddenReferenceCheck"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_DISCOURAGED_REFERENCE_CHECK

      public static final String CODEASSIST_DISCOURAGED_REFERENCE_CHECK
      Code assist option ID: Activate Discouraged Reference Sensitive Completion.

      When enabled, completion doesn't propose elements which match a discouraged reference rule.

      Option id:
      "org.eclipse.jdt.core.codeComplete.discouragedReferenceCheck"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "disabled"
      Since:
      3.1
      See Also:
      Category:
      CodeAssistOptionID
    • CODEASSIST_SUGGEST_STATIC_IMPORTS

      public static final String CODEASSIST_SUGGEST_STATIC_IMPORTS
      Code assist option ID: Activate Suggestion of Static Import.

      When enabled, completion proposals can contain static import pattern.

      Option id:
      "org.eclipse.jdt.core.codeComplete.suggestStaticImports"
      Possible values:
      { "enabled", "disabled" }
      Default:
      "enabled"
      Since:
      3.3
      See Also:
      Category:
      CodeAssistOptionID
    • DEFAULT_TASK_TAG

      public static final String DEFAULT_TASK_TAG
      Deprecated.
      Use DEFAULT_TASK_TAGS instead.
      Since:
      2.1
      See Also:
      Category:
      DeprecatedOptionValue
    • DEFAULT_TASK_PRIORITY

      public static final String DEFAULT_TASK_PRIORITY
      Deprecated.
      Since:
      2.1
      See Also:
      Category:
      DeprecatedOptionValue
    • DEFAULT_TASK_TAGS

      public static final String DEFAULT_TASK_TAGS
      Configurable option value: "TODO,FIXME,XXX".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • DEFAULT_TASK_PRIORITIES

      public static final String DEFAULT_TASK_PRIORITIES
      Configurable option value: "NORMAL,HIGH,NORMAL".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • GENERATE

      public static final String GENERATE
      Configurable option value: "generate".
      See Also:
      Category:
      OptionValue
    • DO_NOT_GENERATE

      public static final String DO_NOT_GENERATE
      Configurable option value: "do not generate".
      See Also:
      Category:
      OptionValue
    • PRESERVE

      public static final String PRESERVE
      Configurable option value: "preserve".
      See Also:
      Category:
      OptionValue
    • OPTIMIZE_OUT

      public static final String OPTIMIZE_OUT
      Configurable option value: "optimize out".
      See Also:
      Category:
      OptionValue
    • COMPILER_TASK_PRIORITY_HIGH

      public static final String COMPILER_TASK_PRIORITY_HIGH
      Configurable option value for COMPILER_TASK_PRIORITIES: "HIGH".
      Since:
      2.1
      See Also:
      Category:
      OptionValue
    • COMPILER_TASK_PRIORITY_LOW

      public static final String COMPILER_TASK_PRIORITY_LOW
      Configurable option value for COMPILER_TASK_PRIORITIES: "LOW".
      Since:
      2.1
      See Also:
      Category:
      OptionValue
    • COMPILER_TASK_PRIORITY_NORMAL

      public static final String COMPILER_TASK_PRIORITY_NORMAL
      Configurable option value for COMPILER_TASK_PRIORITIES: "NORMAL".
      Since:
      2.1
      See Also:
      Category:
      OptionValue
    • VERSION_1_1

      public static final String VERSION_1_1
      Configurable option value: "1.1".
      See Also:
      Category:
      OptionValue
    • VERSION_1_2

      public static final String VERSION_1_2
      Configurable option value: "1.2".
      See Also:
      Category:
      OptionValue
    • VERSION_1_3

      public static final String VERSION_1_3
      Configurable option value: "1.3".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • VERSION_1_4

      public static final String VERSION_1_4
      Configurable option value: "1.4".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • VERSION_1_5

      public static final String VERSION_1_5
      Configurable option value: "1.5".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • VERSION_1_6

      public static final String VERSION_1_6
      Configurable option value: "1.6".
      Since:
      3.2
      See Also:
      Category:
      OptionValue
    • VERSION_1_7

      public static final String VERSION_1_7
      Configurable option value: "1.7".
      Since:
      3.3
      See Also:
      Category:
      OptionValue
    • VERSION_1_8

      public static final String VERSION_1_8
      Configurable option value: "1.8".
      Since:
      3.10
      See Also:
      Category:
      OptionValue
    • VERSION_9

      public static final String VERSION_9
      Configurable option value: "9".
      Since:
      3.14
      See Also:
      Category:
      OptionValue
    • VERSION_10

      public static final String VERSION_10
      Configurable option value: "10".
      Since:
      3.14
      See Also:
      Category:
      OptionValue
    • VERSION_11

      public static final String VERSION_11
      Configurable option value: "11".
      Since:
      3.16
      See Also:
      Category:
      OptionValue
    • VERSION_12

      public static final String VERSION_12
      Configurable option value: "12".
      Since:
      3.18
      See Also:
      Category:
      OptionValue
    • VERSION_13

      public static final String VERSION_13
      Configurable option value: "13".
      Since:
      3.20
      See Also:
      Category:
      OptionValue
    • VERSION_14

      public static final String VERSION_14
      Configurable option value: "14".
      Since:
      3.22
      See Also:
      Category:
      OptionValue
    • VERSION_15

      public static final String VERSION_15
      Configurable option value: "15".
      Since:
      3.24
      See Also:
      Category:
      OptionValue
    • VERSION_16

      public static final String VERSION_16
      Configurable option value: "16".
      Since:
      3.26
      See Also:
      Category:
      OptionValue
    • VERSION_17

      public static final String VERSION_17
      Configurable option value: "17".
      Since:
      3.28
      See Also:
      Category:
      OptionValue
    • VERSION_18

      public static final String VERSION_18
      Configurable option value: "18".
      Since:
      3.30
      See Also:
      Category:
      OptionValue
    • VERSION_19

      public static final String VERSION_19
      Configurable option value: "19".
      Since:
      3.32
      See Also:
      Category:
      OptionValue
    • VERSION_20

      public static final String VERSION_20
      Configurable option value: "20".
      Since:
      3.34
      See Also:
      Category:
      OptionValue
    • VERSION_21

      public static final String VERSION_21
      Configurable option value: "21".
      Since:
      3.36
      See Also:
      Category:
      OptionValue
    • VERSION_CLDC_1_1

      public static final String VERSION_CLDC_1_1
      Configurable option value: "cldc1.1".
      Since:
      3.4
      See Also:
      Category:
      OptionValue
    • ABORT

      public static final String ABORT
      Configurable option value: "abort".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • ERROR

      public static final String ERROR
      Configurable option value: "error".
      See Also:
      Category:
      OptionValue
    • WARNING

      public static final String WARNING
      Configurable option value: "warning".
      See Also:
      Category:
      OptionValue
    • IGNORE

      public static final String IGNORE
      Configurable option value: "ignore".
      See Also:
      Category:
      OptionValue
    • INFO

      public static final String INFO
      Configurable option value: "info".
      Since:
      3.12
      See Also:
      Category:
      OptionValue
    • COMPUTE

      public static final String COMPUTE
      Configurable option value: "compute".
      See Also:
      Category:
      OptionValue
    • INSERT

      public static final String INSERT
      Configurable option value: "insert".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • DO_NOT_INSERT

      public static final String DO_NOT_INSERT
      Configurable option value: "do not insert".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • PRESERVE_ONE

      public static final String PRESERVE_ONE
      Configurable option value: "preserve one".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • CLEAR_ALL

      public static final String CLEAR_ALL
      Configurable option value: "clear all".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • NORMAL

      public static final String NORMAL
      Configurable option value: "normal".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • COMPACT

      public static final String COMPACT
      Configurable option value: "compact".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • TAB

      public static final String TAB
      Configurable option value: "tab".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • SPACE

      public static final String SPACE
      Configurable option value: "space".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • ENABLED

      public static final String ENABLED
      Configurable option value: "enabled".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • DISABLED

      public static final String DISABLED
      Configurable option value: "disabled".
      Since:
      2.0
      See Also:
      Category:
      OptionValue
    • CLEAN

      public static final String CLEAN
      Configurable option value: "clean".
      Since:
      2.1
      See Also:
      Category:
      OptionValue
    • PUBLIC

      public static final String PUBLIC
      Configurable option value: "public".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • PROTECTED

      public static final String PROTECTED
      Configurable option value: "protected".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • DEFAULT

      public static final String DEFAULT
      Configurable option value: "default".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • PRIVATE

      public static final String PRIVATE
      Configurable option value: "private".
      Since:
      3.0
      See Also:
      Category:
      OptionValue
    • NEVER

      public static final String NEVER
      Configurable option value: "never".
      Since:
      3.1
      See Also:
      Category:
      OptionValue
    • COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_NO_TAG

      public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_NO_TAG
      Configurable option value: "no_tag".
      Since:
      3.4
      See Also:
      Category:
      OptionValue
    • COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_RETURN_TAG

      public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_RETURN_TAG
      Configurable option value: "return_tag".
      Since:
      3.4
      See Also:
      Category:
      OptionValue
    • COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS

      public static final String COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS
      Configurable option value: "all_standard_tags".
      Since:
      3.4
      See Also:
      Category:
      OptionValue
    • JAVA_SOURCE_CONTENT_TYPE

      public static final String JAVA_SOURCE_CONTENT_TYPE
      Value of the content-type for Java source files. Use this value to retrieve the Java content type from the content type manager, and to add new Java-like extensions to this content type.
      Since:
      3.2
      See Also:
    • DEFAULT_JAVA_FORMATTER

      public static final String DEFAULT_JAVA_FORMATTER
      The ID of the Eclipse built-in formatter.
      Since:
      3.11
      See Also:
    • JAVA_FORMATTER_EXTENSION_POINT_ID

      public static final String JAVA_FORMATTER_EXTENSION_POINT_ID
      Name of the extension point for contributing a source code formatter
      Since:
      3.11
      See Also:
  • Constructor Details

    • JavaCore

      public JavaCore()
      Creates the Java core plug-in.

      The plug-in instance is created automatically by the Eclipse platform. Clients must not call.

      Since:
      3.0
  • Method Details

    • getAllVersions

      public static List<String> getAllVersions()
      Returns all JavaCore#VERSION_* levels in the order of their introduction. For e.g., VERSION_1_8 appears before VERSION_10
      Returns:
      all available versions
      Since:
      3.14
    • isSupportedJavaVersion

      public static boolean isSupportedJavaVersion(String version)
      Returns whether the given version of Java or Java Runtime is supported by the Java Development Toolkit. A true indicates that the given version is supported. For e.g., if the argument is 11.0.1 and getAllVersions() contains 11, the method returns true.
      Returns:
      a boolean indicating support for the given version of Java or Java Runtime.
      Since:
      3.16
    • addElementChangedListener

      public static void addElementChangedListener(IElementChangedListener listener)
      Adds the given listener for changes to Java elements. Has no effect if an identical listener is already registered.

      This listener will only be notified during the POST_CHANGE resource change notification and any reconcile operation (POST_RECONCILE).

      For finer control of the notification, use addElementChangedListener(IElementChangedListener,int), which allows to specify a different eventMask.

      Parameters:
      listener - the listener
      See Also:
    • addElementChangedListener

      public static void addElementChangedListener(IElementChangedListener listener, int eventMask)
      Adds the given listener for changes to Java elements. Has no effect if an identical listener is already registered. After completion of this method, the given listener will be registered for exactly the specified events. If they were previously registered for other events, they will be deregistered.

      Once registered, a listener starts receiving notification of changes to java elements in the model. The listener continues to receive notifications until it is replaced or removed.

      Listeners can listen for several types of event as defined in ElementChangeEvent. Clients are free to register for any number of event types however if they register for more than one, it is their responsibility to ensure they correctly handle the case where the same java element change shows up in multiple notifications. Clients are guaranteed to receive only the events for which they are registered.

      Parameters:
      listener - the listener
      eventMask - the bit-wise OR of all event types of interest to the listener
      Since:
      2.0
      See Also:
    • addJavaElementMarkerAttributes

      public static void addJavaElementMarkerAttributes(Map attributes, IJavaElement element)
      Configures the given marker attribute map for the given Java element. Used for markers, which denote a Java element rather than a resource.
      Parameters:
      attributes - the mutable marker attribute map (key type: String, value type: String)
      element - the Java element for which the marker needs to be configured
    • addPreProcessingResourceChangedListener

      public static void addPreProcessingResourceChangedListener(org.eclipse.core.resources.IResourceChangeListener listener)
      Deprecated.
      use addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE) instead
      Adds the given listener for POST_CHANGE resource change events to the Java core. The listener is guaranteed to be notified of the POST_CHANGE resource change event before the Java core starts processing the resource change event itself.

      Has no effect if an identical listener is already registered.

      Parameters:
      listener - the listener
      Since:
      3.0
      See Also:
    • addPreProcessingResourceChangedListener

      public static void addPreProcessingResourceChangedListener(org.eclipse.core.resources.IResourceChangeListener listener, int eventMask)
      Adds the given listener for resource change events of the given types to the Java core. The listener is guaranteed to be notified of the resource change event before the Java core starts processing the resource change event itself.

      If an identical listener is already registered, the given event types are added to the event types of interest to the listener.

      Supported event types are:

      • IResourceChangeEvent.PRE_BUILD
      • IResourceChangeEvent.POST_BUILD
      • IResourceChangeEvent.POST_CHANGE
      • IResourceChangeEvent.PRE_DELETE
      • IResourceChangeEvent.PRE_CLOSE
      This list may increase in the future.
      Parameters:
      listener - the listener
      eventMask - the bit-wise OR of all event types of interest to the listener
      Since:
      3.2
      See Also:
    • configureJavaElementMarker

      public void configureJavaElementMarker(org.eclipse.core.resources.IMarker marker, IJavaElement element) throws org.eclipse.core.runtime.CoreException
      Configures the given marker for the given Java element. Used for markers, which denote a Java element rather than a resource.
      Parameters:
      marker - the marker to be configured
      element - the Java element for which the marker needs to be configured
      Throws:
      org.eclipse.core.runtime.CoreException - if the IMarker.setAttribute on the marker fails
    • create

      public static IJavaElement create(String handleIdentifier)
      Returns the Java model element corresponding to the given handle identifier generated by IJavaElement.getHandleIdentifier(), or null if unable to create the associated element.
      Parameters:
      handleIdentifier - the given handle identifier
      Returns:
      the Java element corresponding to the handle identifier
    • create

      public static IJavaElement create(String handleIdentifier, WorkingCopyOwner owner)
      Returns the Java model element corresponding to the given handle identifier generated by IJavaElement.getHandleIdentifier(), or null if unable to create the associated element. If the returned Java element is an ICompilationUnit or an element inside a compilation unit, the compilation unit's owner is the given owner if such a working copy exists, otherwise the compilation unit is a primary compilation unit.
      Parameters:
      handleIdentifier - the given handle identifier
      owner - the owner of the returned compilation unit, ignored if the returned element is not a compilation unit, or an element inside a compilation unit
      Returns:
      the Java element corresponding to the handle identifier
      Since:
      3.0
    • create

      public static IJavaElement create(org.eclipse.core.resources.IFile file)
      Returns the Java element corresponding to the given file, or null if unable to associate the given file with a Java element.

      The file must be one of:

      • a file with one of the Java-like extensions - the element returned is the corresponding ICompilationUnit
      • a .class file - the element returned is the corresponding IClassFile
      • a ZIP archive (e.g. a .jar, a .zip file, etc.) - the element returned is the corresponding IPackageFragmentRoot

      Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.

      Parameters:
      file - the given file
      Returns:
      the Java element corresponding to the given file, or null if unable to associate the given file with a Java element
    • create

      public static IJavaElement create(org.eclipse.core.resources.IFolder folder)
      Returns the package fragment or package fragment root corresponding to the given folder, or null if unable to associate the given folder with a Java element.

      Note that a package fragment root is returned rather than a default package.

      Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.

      Parameters:
      folder - the given folder
      Returns:
      the package fragment or package fragment root corresponding to the given folder, or null if unable to associate the given folder with a Java element
    • create

      public static IJavaProject create(org.eclipse.core.resources.IProject project)
      Returns the Java project corresponding to the given project.

      Creating a Java Project has the side effect of creating and opening all of the project's parents if they are not yet open.

      Note that no check is done at this time on the existence or the java nature of this project.

      Parameters:
      project - the given project
      Returns:
      the Java project corresponding to the given project, null if the given project is null
    • create

      public static IJavaElement create(org.eclipse.core.resources.IResource resource)
      Returns the Java element corresponding to the given resource, or null if unable to associate the given resource with a Java element.

      The resource must be one of:

      • a project - the element returned is the corresponding IJavaProject
      • a file with one of the Java-like extensions - the element returned is the corresponding ICompilationUnit
      • a .class file - the element returned is the corresponding IClassFile
      • a ZIP archive (e.g. a .jar, a .zip file, etc.) - the element returned is the corresponding IPackageFragmentRoot
      • a folder - the element returned is the corresponding IPackageFragmentRoot or IPackageFragment
      • the workspace root resource - the element returned is the IJavaModel

      Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.

      Parameters:
      resource - the given resource
      Returns:
      the Java element corresponding to the given resource, or null if unable to associate the given resource with a Java element
    • create

      public static IJavaElement create(org.eclipse.core.resources.IResource resource, IJavaProject project)
      Returns the Java element corresponding to the given file, its project being the given project. Returns null if unable to associate the given resource with a Java element.

      The resource must be one of:

      • a project - the element returned is the corresponding IJavaProject
      • a file with one of the Java-like extensions - the element returned is the corresponding ICompilationUnit
      • a .class file - the element returned is the corresponding IClassFile
      • a ZIP archive (e.g. a .jar, a .zip file, etc.) - the element returned is the corresponding IPackageFragmentRoot
      • a folder - the element returned is the corresponding IPackageFragmentRoot or IPackageFragment
      • the workspace root resource - the element returned is the IJavaModel

      Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.

      Parameters:
      resource - the given resource
      Returns:
      the Java element corresponding to the given file, or null if unable to associate the given file with a Java element
      Since:
      3.3
    • create

      public static IJavaModel create(org.eclipse.core.resources.IWorkspaceRoot root)
      Returns the Java model.
      Parameters:
      root - the given root
      Returns:
      the Java model, or null if the root is null
    • createClassFileFrom

      public static IClassFile createClassFileFrom(org.eclipse.core.resources.IFile file)
      Creates and returns a class file element for the given .class file. Returns null if unable to recognize the class file.
      Parameters:
      file - the given .class file
      Returns:
      a class file element for the given .class file, or null if unable to recognize the class file
    • createCompilationUnitFrom

      public static ICompilationUnit createCompilationUnitFrom(org.eclipse.core.resources.IFile file)
      Creates and returns a compilation unit element for the given source file (i.e. a file with one of the Java-like extensions). Returns null if unable to recognize the compilation unit.
      Parameters:
      file - the given source file
      Returns:
      a compilation unit element for the given source file, or null if unable to recognize the compilation unit
    • createJarPackageFragmentRootFrom

      public static IPackageFragmentRoot createJarPackageFragmentRootFrom(org.eclipse.core.resources.IFile file)
      Creates and returns a handle for the given JAR file. The Java model associated with the JAR's project may be created as a side effect.
      Parameters:
      file - the given JAR file
      Returns:
      a handle for the given JAR file, or null if unable to create a JAR package fragment root. (for example, if the JAR file represents a non-Java resource)
    • getClasspathContainer

      public static IClasspathContainer getClasspathContainer(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) throws JavaModelException
      Answers the project specific value for a given classpath container. In case this container path could not be resolved, then will answer null. Both the container path and the project context are supposed to be non-null.

      The containerPath is a formed by a first ID segment followed with extra segments, which can be used as additional hints for resolution. If no container was ever recorded for this container path onto this project (using setClasspathContainer, then a ClasspathContainerInitializer will be activated if any was registered for this container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".

      There is no assumption that the returned container must answer the exact same containerPath when requested IClasspathContainer#getPath. Indeed, the containerPath is just an indication for resolving it to an actual container object.

      Classpath container values are persisted locally to the workspace, but are not preserved from a session to another. It is thus highly recommended to register a ClasspathContainerInitializer for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer").

      Parameters:
      containerPath - the name of the container, which needs to be resolved
      project - a specific project in which the container is being resolved
      Returns:
      the corresponding classpath container or null if unable to find one.
      Throws:
      JavaModelException - if an exception occurred while resolving the container, or if the resolved container contains illegal entries (contains CPE_CONTAINER entries or null entries).
      Since:
      2.0
      See Also:
    • getClasspathContainerInitializer

      public static ClasspathContainerInitializer getClasspathContainerInitializer(String containerID)
      Helper method finding the classpath container initializer registered for a given classpath container ID or null if none was found while iterating over the contributions to extension point to the extension point "org.eclipse.jdt.core.classpathContainerInitializer".

      A containerID is the first segment of any container path, used to identify the registered container initializer.

      Parameters:
      containerID - - a containerID identifying a registered initializer
      Returns:
      ClasspathContainerInitializer - the registered classpath container initializer or null if none was found.
      Since:
      2.1
    • getClasspathVariable

      public static org.eclipse.core.runtime.IPath getClasspathVariable(String variableName)
      Returns the path held in the given classpath variable. Returns null if unable to bind.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Note that classpath variables can be contributed registered initializers for, using the extension point "org.eclipse.jdt.core.classpathVariableInitializer". If an initializer is registered for a variable, its persisted value will be ignored: its initializer will thus get the opportunity to rebind the variable differently on each session.

      Parameters:
      variableName - the name of the classpath variable
      Returns:
      the path, or null if none
      See Also:
    • getClasspathVariableDeprecationMessage

      public static String getClasspathVariableDeprecationMessage(String variableName)
      Returns deprecation message of a given classpath variable.
      Returns:
      A string if the classpath variable is deprecated, null otherwise.
      Since:
      3.3
    • getClasspathVariableInitializer

      public static ClasspathVariableInitializer getClasspathVariableInitializer(String variable)
      Helper method finding the classpath variable initializer registered for a given classpath variable name or null if none was found while iterating over the contributions to extension point to the extension point "org.eclipse.jdt.core.classpathVariableInitializer".
      Parameters:
      variable - the given variable
      Returns:
      ClasspathVariableInitializer - the registered classpath variable initializer or null if none was found.
      Since:
      2.1
    • getClasspathVariableNames

      public static String[] getClasspathVariableNames()
      Returns the names of all known classpath variables.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Returns:
      the list of classpath variable names
      See Also:
    • getDefaultOptions

      public static Hashtable<String,String> getDefaultOptions()
      Returns a table of all known configurable options with their default values. These options allow to configure the behaviour of the underlying components. The client may safely use the result as a template that they can modify and then pass to setOptions.

      Helper constants have been defined on JavaCore for each of the option IDs (categorized in Code assist option ID, Compiler option ID and Core option ID) and some of their acceptable values (categorized in Option value). Some options accept open value sets beyond the documented constant values.

      Note: each release may add new options.

      Returns:
      a table of all known configurable options with their default values
    • getEncoding

      public static String getEncoding()
      Returns the workspace root default charset encoding.
      Returns:
      the name of the default charset encoding for workspace root.
      Since:
      3.0
      See Also:
      • IContainer.getDefaultCharset()
      • ResourcesPlugin.getEncoding()
    • getGeneratedResources

      public static org.eclipse.core.resources.IResource[] getGeneratedResources(IRegion region, boolean includesNonJavaResources)
      Returns an array that contains the resources generated by the Java builder when building the compilation units contained in the given region.

      The contents of the array is accurate only if the elements of the given region have been built.

      The given region can contain instances of:

      • org.eclipse.jdt.core.ICompilationUnit
      • org.eclipse.jdt.core.IPackageFragment
      • org.eclipse.jdt.core.IPackageFragmentRoot
      • org.eclipse.jdt.core.IJavaProject

      All other types of org.eclipse.jdt.core.IJavaElement are ignored.

      Parameters:
      region - the given region
      includesNonJavaResources - a flag that indicates if non-java resources should be included
      Returns:
      an array that contains the resources generated by the Java builder when building the compilation units contained in the given region, an empty array if none
      Throws:
      IllegalArgumentException - if the given region is null
      Since:
      3.3
    • getJavaCore

      public static JavaCore getJavaCore()
      Returns the single instance of the Java core plug-in runtime class. Equivalent to (JavaCore) getPlugin().
      Returns:
      the single instance of the Java core plug-in runtime class
    • getJavaLikeExtensions

      public static String[] getJavaLikeExtensions()
      Returns the list of known Java-like extensions. Java like extension are defined in the content type manager for the JAVA_SOURCE_CONTENT_TYPE.

      Note that a Java-like extension doesn't include the leading dot ('.'). Also note that the "java" extension is always defined as a Java-like extension.

      Returns:
      the list of known Java-like extensions.
      Since:
      3.2
    • getOption

      public static String getOption(String optionName)
      Helper method for returning one option value only. Equivalent to (String)JavaCore.getOptions().get(optionName) Note that it may answer null if this option does not exist.

      Helper constants have been defined on JavaCore for each of the option IDs (categorized in Code assist option ID, Compiler option ID and Core option ID) and some of their acceptable values (categorized in Option value). Some options accept open value sets beyond the documented constant values.

      Note: each release may add new options.

      Parameters:
      optionName - the name of an option
      Returns:
      the String value of a given option
      Since:
      2.0
      See Also:
    • getOptionForConfigurableSeverity

      public static String getOptionForConfigurableSeverity(int problemID)
      Returns the option that can be used to configure the severity of the compiler problem identified by problemID if any, null otherwise. Non-null return values are taken from the constants defined by this class whose names start with COMPILER_PB and for which the possible values of the option are defined by { "error", "warning", "info", "ignore" }. A null return value means that the provided problem ID is unknown or that it matches a problem whose severity cannot be configured.
      Parameters:
      problemID - one of the problem IDs defined by IProblem
      Returns:
      the option that can be used to configure the severity of the compiler problem identified by problemID if any, null otherwise
      Since:
      3.4
    • getOptionForConfigurableBuildPathProblemSeverity

      public static String getOptionForConfigurableBuildPathProblemSeverity(int id)
      Returns the option that can be used to configure the severity of the compiler build path problem identified by id if any, null otherwise. Non-null return values are taken from the constants defined by this class whose names start with CORE_ and for which the possible values of the option are defined by { "error", "warning", "info", "ignore" }. A null return value means that the provided id is unknown or that it matches a problem whose severity cannot be configured.
      Parameters:
      id - one of the build path problems defined in IJavaModelStatusConstants
      Returns:
      the option that can be used to configure the severity of the compiler problem identified by id if any, null otherwise
      Since:
      3.16
    • getOptions

      public static Hashtable<String,String> getOptions()
      Returns the table of the current options. Initially, all options have their default values, and this method returns a table that includes all known options.

      Helper constants have been defined on JavaCore for each of the option IDs (categorized in Code assist option ID, Compiler option ID and Core option ID) and some of their acceptable values (categorized in Option value). Some options accept open value sets beyond the documented constant values.

      Note: each release may add new options.

      Returns a default set of options even if the platform is not running.

      Returns:
      table of current settings of all options (key type: String; value type: String)
      See Also:
    • getPlugin

      public static org.eclipse.core.runtime.Plugin getPlugin()
      Returns the single instance of the Java core plug-in runtime class.
      Returns:
      the single instance of the Java core plug-in runtime class
    • getResolvedClasspathEntry

      public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry)
      This is a helper method, which returns the resolved classpath entry denoted by a given entry (if it is a variable entry). It is obtained by resolving the variable reference in the first segment. Returns null if unable to resolve using the following algorithm:
      • if variable segment cannot be resolved, returns null
      • finds a project, JAR or binary folder in the workspace at the resolved path location
      • if none finds an external JAR file or folder outside the workspace at the resolved path location
      • if none returns null

      Variable source attachment path and root path are also resolved and recorded in the resulting classpath entry.

      NOTE: This helper method does not handle classpath containers, for which should rather be used JavaCore#getClasspathContainer(IPath, IJavaProject).

      Parameters:
      entry - the given variable entry
      Returns:
      the resolved library or project classpath entry, or null if the given variable entry could not be resolved to a valid classpath entry
    • getResolvedVariablePath

      public static org.eclipse.core.runtime.IPath getResolvedVariablePath(org.eclipse.core.runtime.IPath variablePath)
      Resolve a variable path (helper method).
      Parameters:
      variablePath - the given variable path
      Returns:
      the resolved variable path or null if none
    • getSharedWorkingCopies

      public static IWorkingCopy[] getSharedWorkingCopies(IBufferFactory factory)
      Deprecated.
      Answers the shared working copies currently registered for this buffer factory. Working copies can be shared by several clients using the same buffer factory,see IWorkingCopy.getSharedWorkingCopy.
      Parameters:
      factory - the given buffer factory
      Returns:
      the list of shared working copies for a given buffer factory
      Since:
      2.0
    • getUserLibraryNames

      public static String[] getUserLibraryNames()
      Returns the names of all defined user libraries. The corresponding classpath container path is the name appended to the USER_LIBRARY_CONTAINER_ID.
      Returns:
      Return an array containing the names of all known user defined.
      Since:
      3.0
    • getWorkingCopies

      public static ICompilationUnit[] getWorkingCopies(WorkingCopyOwner owner)
      Returns the working copies that have the given owner. Only compilation units in working copy mode are returned. If the owner is null, primary working copies are returned.
      Parameters:
      owner - the given working copy owner or null for primary working copy owner
      Returns:
      the list of working copies for a given owner
      Since:
      3.0
    • initializeAfterLoad

      public static void initializeAfterLoad(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Initializes JavaCore internal structures to allow subsequent operations (such as the ones that need a resolved classpath) to run full speed. A client may choose to call this method in a background thread early after the workspace has started so that the initialization is transparent to the user.

      However calling this method is optional. Services will lazily perform initialization when invoked. This is only a way to reduce initialization overhead on user actions, if it can be performed before at some appropriate moment.

      This initialization runs across all Java projects in the workspace. Thus the workspace root scheduling rule is used during this operation.

      This method may return before the initialization is complete. The initialization will then continue in a background thread.

      This method can be called concurrently.

      Parameters:
      monitor - a progress monitor, or null if progress reporting and cancellation are not desired
      Throws:
      org.eclipse.core.runtime.CoreException - if the initialization fails, the status of the exception indicates the reason of the failure
      Since:
      3.1
    • isClasspathVariableReadOnly

      public static boolean isClasspathVariableReadOnly(String variableName)
      Returns whether a given classpath variable is read-only or not.
      Returns:
      true if the classpath variable is read-only, false otherwise.
      Since:
      3.3
    • isJavaLikeFileName

      public static boolean isJavaLikeFileName(String fileName)
      Returns whether the given file name's extension is a Java-like extension.
      Returns:
      whether the given file name's extension is a Java-like extension
      Since:
      3.2
      See Also:
    • isReferencedBy

      public static boolean isReferencedBy(IJavaElement element, org.eclipse.core.resources.IMarker marker) throws org.eclipse.core.runtime.CoreException
      Returns whether the given marker references the given Java element. Used for markers, which denote a Java element rather than a resource.
      Parameters:
      element - the element
      marker - the marker
      Returns:
      true if the marker references the element, false otherwise
      Throws:
      org.eclipse.core.runtime.CoreException - if the IMarker.getAttribute on the marker fails
    • isReferencedBy

      public static boolean isReferencedBy(IJavaElement element, org.eclipse.core.resources.IMarkerDelta markerDelta) throws org.eclipse.core.runtime.CoreException
      Returns whether the given marker delta references the given Java element. Used for markers deltas, which denote a Java element rather than a resource.
      Parameters:
      element - the element
      markerDelta - the marker delta
      Returns:
      true if the marker delta references the element
      Throws:
      org.eclipse.core.runtime.CoreException - if the IMarkerDelta.getAttribute on the marker delta fails
    • newAccessRule

      public static IAccessRule newAccessRule(org.eclipse.core.runtime.IPath filePattern, int kind)
      Creates and returns a new access rule with the given file pattern and kind.

      The rule kind is one of IAccessRule.K_ACCESSIBLE, IAccessRule.K_DISCOURAGED, or IAccessRule.K_NON_ACCESSIBLE, optionally combined with IAccessRule.IGNORE_IF_BETTER, e.g. IAccessRule.K_NON_ACCESSIBLE | IAccessRule.IGNORE_IF_BETTER.

      Parameters:
      filePattern - the file pattern this access rule should match
      kind - one of IAccessRule.K_ACCESSIBLE, IAccessRule.K_DISCOURAGED, or IAccessRule.K_NON_ACCESSIBLE, optionally combined with IAccessRule.IGNORE_IF_BETTER
      Returns:
      a new access rule
      Since:
      3.1
      See Also:
    • newClasspathAttribute

      public static IClasspathAttribute newClasspathAttribute(String name, String value)
      Creates and returns a new classpath attribute with the given name and the given value.
      Returns:
      a new classpath attribute
      Since:
      3.1
    • newContainerEntry

      public static IClasspathEntry newContainerEntry(org.eclipse.core.runtime.IPath containerPath)
      Creates and returns a new classpath entry of kind CPE_CONTAINER for the given path. This method is fully equivalent to calling newContainerEntry(containerPath, new IAccessRule[0], new IClasspathAttribute[0], false).
      Parameters:
      containerPath - the path identifying the container, it must be formed of two segments
      Returns:
      a new container classpath entry
      Since:
      2.0
      See Also:
    • newContainerEntry

      public static IClasspathEntry newContainerEntry(org.eclipse.core.runtime.IPath containerPath, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_CONTAINER for the given path. This method is fully equivalent to calling newContainerEntry(containerPath, new IAccessRule[0], new IClasspathAttribute[0], isExported).
      Parameters:
      containerPath - the path identifying the container, it must be formed of at least one segment (ID+hints)
      isExported - a boolean indicating whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new container classpath entry
      Since:
      2.0
      See Also:
    • newContainerEntry

      public static IClasspathEntry newContainerEntry(org.eclipse.core.runtime.IPath containerPath, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_CONTAINER for the given path. The path of the container will be used during resolution so as to map this container entry to a set of other classpath entries the container is acting for.

      A container entry allows to express indirect references to a set of libraries, projects and variable entries, which can be interpreted differently for each Java project where it is used. A classpath container entry can be resolved using JavaCore.getResolvedClasspathContainer, and updated with JavaCore.classpathContainerChanged

      A container is exclusively resolved by a ClasspathContainerInitializer registered onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".

      A container path must be formed of at least one segment, where:

      • the first segment is a unique ID identifying the target container, there must be a container initializer registered onto this ID through the extension point "org.eclipse.jdt.core.classpathContainerInitializer".
      • the remaining segments will be passed onto the initializer, and can be used as additional hints during the initialization phase.

      Example of an ClasspathContainerInitializer for a classpath container denoting a default JDK container:

       containerEntry = JavaCore.newContainerEntry(new Path("MyProvidedJDK/default"));
      
       <extension
          point="org.eclipse.jdt.core.classpathContainerInitializer">
          <containerInitializer
             id="MyProvidedJDK"
             class="com.example.MyInitializer"/>
       

      The access rules determine the set of accessible source and class files in the container. If the list of access rules is empty, then all files in this container are accessible. See IAccessRule for a detailed description of access rules. Note that if an entry defined by the container defines access rules, then these access rules are combined with the given access rules. The given access rules are considered first, then the entry's access rules are considered.

      The extraAttributes list contains name/value pairs that must be persisted with this entry. If no extra attributes are provided, an empty array must be passed in.
      Note that this list should not contain any duplicate name.

      The isExported flag indicates whether this entry is contributed to dependent projects. If not exported, dependent projects will not see any of the classes from this entry. If exported, dependent projects will concatenate the accessible files patterns of this entry with the accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry with the non accessible files patterns of the project.

      Note that this operation does not attempt to validate classpath containers or access the resources at the given paths.

      Parameters:
      containerPath - the path identifying the container, it must be formed of at least one segment (ID+hints)
      accessRules - the possibly empty list of access rules for this entry
      extraAttributes - the possibly empty list of extra attributes to persist with this entry
      isExported - a boolean indicating whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new container classpath entry
      Since:
      3.1
      See Also:
    • newTypeHierarchy

      public static ITypeHierarchy newTypeHierarchy(IRegion region, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
      Creates and returns a type hierarchy for all types in the given region, considering subtypes within that region and considering types in the working copies with the given owner. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.

      Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.

      Parameters:
      monitor - the given progress monitor
      region - the given region
      owner - the owner of working copies that take precedence over their original compilation units, or null if the primary working copy owner should be used
      Returns:
      a type hierarchy for all types in the given region, considering subtypes within that region
      Throws:
      JavaModelException - if an element in the region does not exist or if an exception occurs while accessing its corresponding resource
      IllegalArgumentException - if region is null
      Since:
      3.1
    • newLibraryEntry

      public static IClasspathEntry newLibraryEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath)
      Creates and returns a new non-exported classpath entry of kind CPE_LIBRARY for the JAR or folder identified by the given absolute path. This specifies that all package fragments within the root will have children of type IClassFile. This method is fully equivalent to calling newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IClasspathAttribute[0], false).
      Parameters:
      path - the path to the library
      sourceAttachmentPath - the absolute path of the corresponding source archive or folder, or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. Since 3.4, this path can also denote a path external to the workspace. and will be automatically converted to null.
      sourceAttachmentRootPath - the location of the root of the source files within the source archive or folder or null if this location should be automatically detected.
      Returns:
      a new library classpath entry
    • newLibraryEntry

      public static IClasspathEntry newLibraryEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_LIBRARY for the JAR or folder identified by the given absolute path. This specifies that all package fragments within the root will have children of type IClassFile.

      This method is fully equivalent to calling newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IClasspathAttribute[0], isExported).

      Parameters:
      path - the path to the library
      sourceAttachmentPath - the absolute path of the corresponding source archive or folder, or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. and will be automatically converted to null. Since 3.4, this path can also denote a path external to the workspace.
      sourceAttachmentRootPath - the location of the root of the source files within the source archive or folder or null if this location should be automatically detected.
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new library classpath entry
      Since:
      2.0
    • newLibraryEntry

      public static IClasspathEntry newLibraryEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath sourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_LIBRARY for the JAR or folder identified by the given absolute path. This specifies that all package fragments within the root will have children of type IClassFile.

      A library entry is used to denote a prerequisite JAR or root folder containing binaries. The target JAR can either be defined internally to the workspace (absolute path relative to the workspace root), or externally to the workspace (absolute path in the file system). The target root folder can also be defined internally to the workspace (absolute path relative to the workspace root), or - since 3.4 - externally to the workspace (absolute path in the file system). Since 3.5, the path to the library can also be relative to the project using ".." as the first segment.

      e.g. Here are some examples of binary path usage

      • "c:\jdk1.2.2\jre\lib\rt.jar" - reference to an external JAR on Windows
      • "/Project/someLib.jar" - reference to an internal JAR on Windows or Linux
      • "/Project/classes/" - reference to an internal binary folder on Windows or Linux
      • "/home/usr/classes" - reference to an external binary folder on Linux
      • "../../lib/someLib.jar" - reference to an external JAR that is a sibling of the workspace on either platform
      Note that on non-Windows platform, a path "/some/lib.jar" is ambiguous. It can be a path to an external JAR (its file system path being "/some/lib.jar") or it can be a path to an internal JAR ("some" being a project in the workspace). Such an ambiguity is solved when the classpath entry is used (e.g. in IJavaProject.getPackageFragmentRoots()). If the resource "lib.jar" exists in project "some", then it is considered an internal JAR. Otherwise it is an external JAR.

      Also note that this operation does not attempt to validate or access the resources at the given paths.

      The access rules determine the set of accessible class files in the library. If the list of access rules is empty then all files in this library are accessible. See IAccessRule for a detailed description of access rules.

      The extraAttributes list contains name/value pairs that must be persisted with this entry. If no extra attributes are provided, an empty array must be passed in.
      Note that this list should not contain any duplicate name.

      The isExported flag indicates whether this entry is contributed to dependent projects. If not exported, dependent projects will not see any of the classes from this entry. If exported, dependent projects will concatenate the accessible files patterns of this entry with the accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry with the non accessible files patterns of the project.

      Since 3.5, if the library is a ZIP archive, the "Class-Path" clause (if any) in the "META-INF/MANIFEST.MF" is read and referenced ZIP archives are added to the resolved classpath.

      Parameters:
      path - the path to the library
      sourceAttachmentPath - the absolute path of the corresponding source archive or folder, or null if none. Note, since 3.0, an empty path is allowed to denote no source attachment. and will be automatically converted to null. Since 3.4, this path can also denote a path external to the workspace.
      sourceAttachmentRootPath - the location of the root of the source files within the source archive or folder or null if this location should be automatically detected.
      accessRules - the possibly empty list of access rules for this entry
      extraAttributes - the possibly empty list of extra attributes to persist with this entry
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new library classpath entry
      Since:
      3.1
    • newProjectEntry

      public static IClasspathEntry newProjectEntry(org.eclipse.core.runtime.IPath path)
      Creates and returns a new non-exported classpath entry of kind CPE_PROJECT for the project identified by the given absolute path.

      This method is fully equivalent to calling newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], false).

      Parameters:
      path - the absolute path of the binary archive
      Returns:
      a new project classpath entry
    • newProjectEntry

      public static IClasspathEntry newProjectEntry(org.eclipse.core.runtime.IPath path, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_PROJECT for the project identified by the given absolute path.

      This method is fully equivalent to calling newProjectEntry(path, new IAccessRule[0], true, new IClasspathAttribute[0], isExported).

      Parameters:
      path - the absolute path of the prerequisite project
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new project classpath entry
      Since:
      2.0
    • newProjectEntry

      public static IClasspathEntry newProjectEntry(org.eclipse.core.runtime.IPath path, IAccessRule[] accessRules, boolean combineAccessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_PROJECT for the project identified by the given absolute path.

      A project entry is used to denote a prerequisite project on a classpath. The referenced project will be contributed as a whole, either as sources (in the Java Model, it contributes all its package fragment roots) or as binaries (when building, it contributes its whole output location).

      A project reference allows to indirect through another project, independently from its internal layout.

      The prerequisite project is referred to using an absolute path relative to the workspace root.

      The access rules determine the set of accessible class files in the project. If the list of access rules is empty then all files in this project are accessible. See IAccessRule for a detailed description of access rules.

      The combineAccessRules flag indicates whether access rules of one (or more) exported entry of the project should be combined with the given access rules. If they should be combined, the given access rules are considered first, then the entry's access rules are considered.

      The extraAttributes list contains name/value pairs that must be persisted with this entry. If no extra attributes are provided, an empty array must be passed in.
      Note that this list should not contain any duplicate name.

      The isExported flag indicates whether this entry is contributed to dependent projects. If not exported, dependent projects will not see any of the classes from this entry. If exported, dependent projects will concatenate the accessible files patterns of this entry with the accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry with the non accessible files patterns of the project.

      Parameters:
      path - the absolute path of the prerequisite project
      accessRules - the possibly empty list of access rules for this entry
      combineAccessRules - whether the access rules of the project's exported entries should be combined with the given access rules
      extraAttributes - the possibly empty list of extra attributes to persist with this entry
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new project classpath entry
      Since:
      3.1
    • newRegion

      public static IRegion newRegion()
      Returns a new empty region.
      Returns:
      a new empty region
    • newSourceEntry

      public static IClasspathEntry newSourceEntry(org.eclipse.core.runtime.IPath path)
      Creates and returns a new classpath entry of kind CPE_SOURCE for all files in the project's source folder identified by the given absolute workspace-relative path.

      The convenience method is fully equivalent to:

       newSourceEntry(path, new IPath[] {}, new IPath[] {}, null);
       
      Parameters:
      path - the absolute workspace-relative path of a source folder
      Returns:
      a new source classpath entry
      See Also:
    • newSourceEntry

      public static IClasspathEntry newSourceEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] exclusionPatterns)
      Creates and returns a new classpath entry of kind CPE_SOURCE for the project's source folder identified by the given absolute workspace-relative path but excluding all source files with paths matching any of the given patterns.

      The convenience method is fully equivalent to:

       newSourceEntry(path, new IPath[] {}, exclusionPatterns, null);
       
      Parameters:
      path - the absolute workspace-relative path of a source folder
      exclusionPatterns - the possibly empty list of exclusion patterns represented as relative paths
      Returns:
      a new source classpath entry
      Since:
      2.1
      See Also:
    • newSourceEntry

      public static IClasspathEntry newSourceEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath specificOutputLocation)
      Creates and returns a new classpath entry of kind CPE_SOURCE for the project's source folder identified by the given absolute workspace-relative path but excluding all source files with paths matching any of the given patterns, and associated with a specific output location (that is, ".class" files are not going to the project default output location).

      The convenience method is fully equivalent to:

       newSourceEntry(path, new IPath[] {}, exclusionPatterns, specificOutputLocation);
       
      Parameters:
      path - the absolute workspace-relative path of a source folder
      exclusionPatterns - the possibly empty list of exclusion patterns represented as relative paths
      specificOutputLocation - the specific output location for this source entry (null if using project default output location)
      Returns:
      a new source classpath entry
      Since:
      2.1
      See Also:
    • newSourceEntry

      public static IClasspathEntry newSourceEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath specificOutputLocation)
      Creates and returns a new classpath entry of kind CPE_SOURCE for the project's source folder identified by the given absolute workspace-relative path but excluding all source files with paths matching any of the given patterns, and associated with a specific output location (that is, ".class" files are not going to the project default output location).

      The convenience method is fully equivalent to:

       newSourceEntry(path, new IPath[] {}, exclusionPatterns, specificOutputLocation, new IClasspathAttribute[] {});
       
      Parameters:
      path - the absolute workspace-relative path of a source folder
      inclusionPatterns - the possibly empty list of inclusion patterns represented as relative paths
      exclusionPatterns - the possibly empty list of exclusion patterns represented as relative paths
      specificOutputLocation - the specific output location for this source entry (null if using project default output location)
      Returns:
      a new source classpath entry
      Since:
      3.0
      See Also:
    • newSourceEntry

      public static IClasspathEntry newSourceEntry(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IPath[] inclusionPatterns, org.eclipse.core.runtime.IPath[] exclusionPatterns, org.eclipse.core.runtime.IPath specificOutputLocation, IClasspathAttribute[] extraAttributes)
      Creates and returns a new classpath entry of kind CPE_SOURCE for the project's source folder identified by the given absolute workspace-relative path using the given inclusion and exclusion patterns to determine which source files are included, and the given output path to control the output location of generated files.

      The source folder is referred to using an absolute path relative to the workspace root, e.g. /Project/src. A project's source folders are located with that project. That is, a source classpath entry specifying the path /P1/src is only usable for project P1.

      The inclusion patterns determines the initial set of source files that are to be included; the exclusion patterns are then used to reduce this set. When no inclusion patterns are specified, the initial file set includes all relevant files in the resource tree rooted at the source entry's path. On the other hand, specifying one or more inclusion patterns means that all and only files matching at least one of the specified patterns are to be included. If exclusion patterns are specified, the initial set of files is then reduced by eliminating files matched by at least one of the exclusion patterns. Inclusion and exclusion patterns look like relative file paths with wildcards and are interpreted relative to the source entry's path. File patterns are case-sensitive can contain '**', '*' or '?' wildcards (see IClasspathEntry.getExclusionPatterns() for the full description of their syntax and semantics). The resulting set of files are included in the corresponding package fragment root; all package fragments within the root will have children of type ICompilationUnit.

      For example, if the source folder path is /Project/src, there are no inclusion filters, and the exclusion pattern is com/xyz/tests/**, then source files like /Project/src/com/xyz/Foo.java and /Project/src/com/xyz/utils/Bar.java would be included, whereas /Project/src/com/xyz/tests/T1.java and /Project/src/com/xyz/tests/quick/T2.java would be excluded.

      Additionally, a source entry can be associated with a specific output location. By doing so, the Java builder will ensure that the generated ".class" files will be issued inside this output location, as opposed to be generated into the project default output location (when output location is null). Note that multiple source entries may target the same output location. The output location is referred to using an absolute path relative to the workspace root, e.g. "/Project/bin", it must be located inside the same project as the source folder.

      Also note that all sources/binaries inside a project are contributed as a whole through a project entry (see JavaCore.newProjectEntry). Particular source entries cannot be selectively exported.

      The extraAttributes list contains name/value pairs that must be persisted with this entry. If no extra attributes are provided, an empty array must be passed in.
      Note that this list should not contain any duplicate name.

      Parameters:
      path - the absolute workspace-relative path of a source folder
      inclusionPatterns - the possibly empty list of inclusion patterns represented as relative paths
      exclusionPatterns - the possibly empty list of exclusion patterns represented as relative paths
      specificOutputLocation - the specific output location for this source entry (null if using project default ouput location)
      extraAttributes - the possibly empty list of extra attributes to persist with this entry
      Returns:
      a new source classpath entry with the given exclusion patterns
      Since:
      3.1
      See Also:
    • newVariableEntry

      public static IClasspathEntry newVariableEntry(org.eclipse.core.runtime.IPath variablePath, org.eclipse.core.runtime.IPath variableSourceAttachmentPath, org.eclipse.core.runtime.IPath sourceAttachmentRootPath)
      Creates and returns a new non-exported classpath entry of kind CPE_VARIABLE for the given path. This method is fully equivalent to calling newVariableEntry(variablePath, variableSourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IClasspathAttribute[0], false).
      Parameters:
      variablePath - the path of the binary archive; first segment is the name of a classpath variable
      variableSourceAttachmentPath - the path of the corresponding source archive, or null if none; if present, the first segment is the name of a classpath variable (not necessarily the same variable as the one that begins variablePath)
      sourceAttachmentRootPath - the location of the root of the source files within the source archive or null if variableSourceAttachmentPath is also null
      Returns:
      a new library classpath entry
    • newVariableEntry

      public static IClasspathEntry newVariableEntry(org.eclipse.core.runtime.IPath variablePath, org.eclipse.core.runtime.IPath variableSourceAttachmentPath, org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_VARIABLE for the given path. This method is fully equivalent to calling newVariableEntry(variablePath, variableSourceAttachmentPath, sourceAttachmentRootPath, new IAccessRule[0], new IClasspathAttribute[0], isExported).
      Parameters:
      variablePath - the path of the binary archive; first segment is the name of a classpath variable
      variableSourceAttachmentPath - the path of the corresponding source archive, or null if none; if present, the first segment is the name of a classpath variable (not necessarily the same variable as the one that begins variablePath)
      variableSourceAttachmentRootPath - the location of the root of the source files within the source archive or null if variableSourceAttachmentPath is also null
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new variable classpath entry
      Since:
      2.0
    • newVariableEntry

      public static IClasspathEntry newVariableEntry(org.eclipse.core.runtime.IPath variablePath, org.eclipse.core.runtime.IPath variableSourceAttachmentPath, org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath, IAccessRule[] accessRules, IClasspathAttribute[] extraAttributes, boolean isExported)
      Creates and returns a new classpath entry of kind CPE_VARIABLE for the given path. The first segment of the path is the name of a classpath variable. The trailing segments of the path will be appended to resolved variable path.

      A variable entry allows to express indirect references on a classpath to other projects or libraries, depending on what the classpath variable is referring.

      It is possible to register an automatic initializer (ClasspathVariableInitializer), which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer". After resolution, a classpath variable entry may either correspond to a project or a library entry.

      e.g. Here are some examples of variable path usage

      • "JDTCORE" where variable JDTCORE is bound to "c:/jars/jdtcore.jar". The resolved classpath entry is denoting the library "c:\jars\jdtcore.jar"
      • "JDTCORE" where variable JDTCORE is bound to "/Project_JDTCORE". The resolved classpath entry is denoting the project "/Project_JDTCORE"
      • "PLUGINS/com.example/example.jar" where variable PLUGINS is bound to "c:/eclipse/plugins". The resolved classpath entry is denoting the library "c:\eclipse\plugins\com.example\example.jar"

      The access rules determine the set of accessible class files in the project or library. If the list of access rules is empty then all files in this project or library are accessible. See IAccessRule for a detailed description of access rules.

      The extraAttributes list contains name/value pairs that must be persisted with this entry. If no extra attributes are provided, an empty array must be passed in.
      Note that this list should not contain any duplicate name.

      The isExported flag indicates whether this entry is contributed to dependent projects. If not exported, dependent projects will not see any of the classes from this entry. If exported, dependent projects will concatenate the accessible files patterns of this entry with the accessible files patterns of the projects, and they will concatenate the non accessible files patterns of this entry with the non accessible files patterns of the project.

      Note that this operation does not attempt to validate classpath variables or access the resources at the given paths.

      Parameters:
      variablePath - the path of the binary archive; first segment is the name of a classpath variable
      variableSourceAttachmentPath - the path of the corresponding source archive, or null if none; if present, the first segment is the name of a classpath variable (not necessarily the same variable as the one that begins variablePath)
      variableSourceAttachmentRootPath - the location of the root of the source files within the source archive or null if variableSourceAttachmentPath is also null
      accessRules - the possibly empty list of access rules for this entry
      extraAttributes - the possibly empty list of extra attributes to persist with this entry
      isExported - indicates whether this entry is contributed to dependent projects in addition to the output location
      Returns:
      a new variable classpath entry
      Since:
      3.1
    • getReferencedClasspathEntries

      public static IClasspathEntry[] getReferencedClasspathEntries(IClasspathEntry libraryEntry, IJavaProject project)
      Returns an array of classpath entries that are referenced directly or indirectly by a given classpath entry. For the entry kind IClasspathEntry.CPE_LIBRARY, the method returns the libraries that are included in the Class-Path section of the MANIFEST.MF file. If a referenced JAR file has further references to other library entries, they are processed recursively and added to the list. For entry kinds other than IClasspathEntry.CPE_LIBRARY, this method returns an empty array.

      When a non-null project is passed, any additional attributes that may have been stored previously in the project's .classpath file are retrieved and populated in the corresponding referenced entry. If the project is null, the raw referenced entries are returned without any persisted attributes. For more details on storing referenced entries, see IJavaProject.setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, IProgressMonitor).

      Parameters:
      libraryEntry - the library entry whose referenced entries are sought
      project - project where the persisted referenced entries to be retrieved from. If null persisted attributes are not attempted to be retrieved.
      Returns:
      an array of classpath entries that are referenced directly or indirectly by the given entry. If not applicable, returns an empty array.
      Since:
      3.6
    • removeClasspathVariable

      public static void removeClasspathVariable(String variableName)
      Removed the given classpath variable. Does nothing if no value was set for this classpath variable.

      This functionality cannot be used while the resource tree is locked.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Parameters:
      variableName - the name of the classpath variable
      See Also:
    • removeClasspathVariable

      public static void removeClasspathVariable(String variableName, org.eclipse.core.runtime.IProgressMonitor monitor)
      Removed the given classpath variable. Does nothing if no value was set for this classpath variable.

      This functionality cannot be used while the resource tree is locked.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Parameters:
      variableName - the name of the classpath variable
      monitor - the progress monitor to report progress
      See Also:
    • removeElementChangedListener

      public static void removeElementChangedListener(IElementChangedListener listener)
      Removes the given element changed listener. Has no effect if an identical listener is not registered.
      Parameters:
      listener - the listener
    • removeJavaLikeExtension

      public static String removeJavaLikeExtension(String fileName)
      Removes the file extension from the given file name, if it has a Java-like file extension. Otherwise the file name itself is returned. Note this removes the dot ('.') before the extension as well.
      Parameters:
      fileName - the name of a file
      Returns:
      the fileName without the Java-like extension
      Since:
      3.2
    • removePreProcessingResourceChangedListener

      public static void removePreProcessingResourceChangedListener(org.eclipse.core.resources.IResourceChangeListener listener)
      Removes the given pre-processing resource changed listener.

      Has no effect if an identical listener is not registered.

      Parameters:
      listener - the listener
      Since:
      3.0
    • rebuildIndex

      public static void rebuildIndex(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Deletes the index, then rebuilds any portions of the index that are currently needed by the workspace.
      Parameters:
      monitor - a progress monitor, or null if progress reporting and cancellation are not desired
      Throws:
      org.eclipse.core.runtime.CoreException
      Since:
      3.13
    • run

      public static void run(org.eclipse.core.resources.IWorkspaceRunnable action, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Runs the given action as an atomic Java model operation.

      After running a method that modifies java elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify java elements and only have element changed event notifications reported at the end of the entire batch.

      If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to java elements by the action.

      If this method is called in the dynamic scope of another such call, this method simply runs the action.

      Parameters:
      action - the action to perform
      monitor - a progress monitor, or null if progress reporting and cancellation are not desired
      Throws:
      org.eclipse.core.runtime.CoreException - if the operation failed.
      Since:
      2.1
    • run

      public static void run(org.eclipse.core.resources.IWorkspaceRunnable action, org.eclipse.core.runtime.jobs.ISchedulingRule rule, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
      Runs the given action as an atomic Java model operation.

      After running a method that modifies java elements, registered listeners receive after-the-fact notification of what just transpired, in the form of a element changed event. This method allows clients to call a number of methods that modify java elements and only have element changed event notifications reported at the end of the entire batch.

      If this method is called outside the dynamic scope of another such call, this method runs the action and then reports a single element changed event describing the net effect of all changes done to java elements by the action.

      If this method is called in the dynamic scope of another such call, this method simply runs the action.

      The supplied scheduling rule is used to determine whether this operation can be run simultaneously with workspace changes in other threads. See IWorkspace.run(...) for more details.

      Parameters:
      action - the action to perform
      rule - the scheduling rule to use when running this operation, or null if there are no scheduling restrictions for this operation.
      monitor - a progress monitor, or null if progress reporting and cancellation are not desired
      Throws:
      org.eclipse.core.runtime.CoreException - if the operation failed.
      Since:
      3.0
    • callReadOnly

      public static <T, E extends Exception> T callReadOnly(JavaCore.JavaCallable<T,E> callable) throws E
      Calls the argument and returns its result or its Exception. The argument's call() is supposed to query Java model and must not modify it. This method will try to run Java Model queries in optimized way (Using caches during the operation). It is safe to nest multiple calls - but not necessary.
      Parameters:
      callable - A JavaCallable that can throw an Exception
      Returns:
      the result
      Throws:
      E - An Exception that is thrown by the callable.
      Since:
      3.37
    • runReadOnly

      public static <T, E extends Exception> void runReadOnly(JavaCore.JavaRunnable<E> runnable) throws E
      Runs the argument and will forward its Exception. The argument's run() is supposed to query Java model and must not modify it. This method will try to run Java Model queries in optimized way (caching things during the operation). It is safe to nest multiple calls - but not necessary.
      Parameters:
      runnable - A JavaRunnable that can throw an Exception
      Throws:
      E - An Exception that is thrown by the runnable.
      Since:
      3.37
    • setClasspathContainer

      public static void setClasspathContainer(org.eclipse.core.runtime.IPath containerPath, IJavaProject[] affectedProjects, IClasspathContainer[] respectiveContainers, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
      Bind a container reference path to some actual containers (IClasspathContainer). This API must be invoked whenever changes in container need to be reflected onto the JavaModel. Containers can have distinct values in different projects, therefore this API considers a set of projects with their respective containers.

      containerPath is the path under which these values can be referenced through container classpath entries (IClasspathEntry#CPE_CONTAINER). A container path is formed by a first ID segment followed with extra segments, which can be used as additional hints for the resolution. The container ID is used to identify a ClasspathContainerInitializer registered on the extension point "org.eclipse.jdt.core.classpathContainerInitializer".

      There is no assumption that each individual container value passed in argument (respectiveContainers) must answer the exact same path when requested IClasspathContainer#getPath. Indeed, the containerPath is just an indication for resolving it to an actual container object. It can be delegated to a ClasspathContainerInitializer, which can be activated through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer").

      In reaction to changing container values, the JavaModel will be updated to reflect the new state of the updated container. A combined Java element delta will be notified to describe the corresponding classpath changes resulting from the container update. This operation is batched, and automatically eliminates unnecessary updates (new container is same as old one). This operation acquires a lock on the workspace's root.

      This functionality cannot be used while the workspace is locked, since it may create/remove some resource markers.

      Classpath container values are persisted locally to the workspace, but are not preserved from a session to another. It is thus highly recommended to register a ClasspathContainerInitializer for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer").

      Note: setting a container to null will cause it to be lazily resolved again whenever its value is required. In particular, this will cause a registered initializer to be invoked again.

      Parameters:
      containerPath - - the name of the container reference, which is being updated
      affectedProjects - - the set of projects for which this container is being bound
      respectiveContainers - - the set of respective containers for the affected projects
      monitor - a monitor to report progress
      Throws:
      JavaModelException
      Since:
      2.0
      See Also:
    • setClasspathVariable

      public static void setClasspathVariable(String variableName, org.eclipse.core.runtime.IPath path) throws JavaModelException
      Sets the value of the given classpath variable. The path must have at least one segment.

      This functionality cannot be used while the resource tree is locked.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Parameters:
      variableName - the name of the classpath variable
      path - the path
      Throws:
      JavaModelException
      See Also:
    • setClasspathVariable

      public static void setClasspathVariable(String variableName, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
      Sets the value of the given classpath variable. The path must not be null. Since 3.5, the path to a library can also be relative to the project using ".." as the first segment.

      This functionality cannot be used while the resource tree is locked.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Updating a variable with the same value has no effect.

      Parameters:
      variableName - the name of the classpath variable
      path - the path
      monitor - a monitor to report progress
      Throws:
      JavaModelException
      See Also:
    • setClasspathVariables

      public static void setClasspathVariables(String[] variableNames, org.eclipse.core.runtime.IPath[] paths, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException
      Sets the values of all the given classpath variables at once. Null paths can be used to request corresponding variable removal. Since 3.5, the path to a library can also be relative to the project using ".." as the first segment.

      A combined Java element delta will be notified to describe the corresponding classpath changes resulting from the variables update. This operation is batched, and automatically eliminates unnecessary updates (new variable is same as old one). This operation acquires a lock on the workspace's root.

      This functionality cannot be used while the workspace is locked, since it may create/remove some resource markers.

      Classpath variable values are persisted locally to the workspace, and are preserved from session to session.

      Updating a variable with the same value has no effect.

      Parameters:
      variableNames - an array of names for the updated classpath variables
      paths - an array of path updates for the modified classpath variables (null meaning that the corresponding value will be removed
      monitor - a monitor to report progress
      Throws:
      JavaModelException
      Since:
      2.0
      See Also:
    • setComplianceOptions

      public static void setComplianceOptions(String compliance, Map options)
      Sets the default compiler options inside the given options map according to the given compliance.

      The given compliance must be one of those supported by the compiler, that is one of the acceptable values for option COMPILER_COMPLIANCE.

      The list of modified options is currently:

      If the given compliance is unknown, the given map is unmodified.

      Parameters:
      compliance - the given compliance
      options - the given options map
      Since:
      3.3
    • setOptions

      public static void setOptions(Hashtable<String,String> newOptions)
      Sets the current table of options. All and only the options explicitly included in the given table are remembered; all previous option settings are forgotten, including ones not explicitly mentioned.

      Helper constants have been defined on JavaCore for each of the option IDs (categorized in Code assist option ID, Compiler option ID and Core option ID) and some of their acceptable values (categorized in Option value). Some options accept open value sets beyond the documented constant values.

      Note: each release may add new options.
      Parameters:
      newOptions - the new options (key type: String; value type: String), or null to reset all options to their default values
      See Also:
    • latestSupportedJavaVersion

      public static String latestSupportedJavaVersion()
      Returns the latest version of Java supported by the Java Model. This is usually the last entry from getAllVersions().
      Returns:
      the latest Java version support by Java Model
      Since:
      3.16
    • compareJavaVersions

      public static int compareJavaVersions(String first, String second)
      Compares two given versions of the Java platform. The versions being compared must both be one of the supported values mentioned in COMPILER_CODEGEN_TARGET_PLATFORM, both values from COMPILER_COMPLIANCE, or both values from COMPILER_SOURCE.
      Parameters:
      first - first version to be compared
      second - second version to be compared
      Returns:
      the value 0 if both versions are the same; a value less than 0 if first is smaller than second; and a value greater than 0 if first is higher than second
      Since:
      3.12
    • getReferencedModules

      public static String[] getReferencedModules(IJavaProject project) throws org.eclipse.core.runtime.CoreException
      Returns an array of module names referenced by this project indirectly. This is a helper method that can be used to construct a Java module description of an existing project. The referenced modules can either be system modules or user modules found in project build path in the form of libraries. The prerequisites for this to be effective are:
      • the project is already in compliance level 9 or above.
      • the system library on the build path of the project is a modularized Java Runtime.
      Parameters:
      project - the project whose referenced modules to be computed
      Returns:
      an array of String containing module names
      Throws:
      org.eclipse.core.runtime.CoreException
      Since:
      3.14
    • getAutomaticModuleDescription

      public static IModuleDescription getAutomaticModuleDescription(IJavaElement element) throws JavaModelException, IllegalArgumentException
      Returns the IModuleDescription that the given java element contains when regarded as an automatic module. The element must be an IPackageFragmentRoot or an IJavaProject.

      The returned module descriptor has a name (getElementName()) following the specification of java.lang.module.ModuleFinder.of(Path...), but it contains no other useful information.

      Returns:
      the IModuleDescription representing this java element as an automatic module, never null.
      Throws:
      IllegalArgumentException - if the provided element is neither IPackageFragmentRoot nor IJavaProject
      JavaModelException
      Since:
      3.14
    • defaultRootModules

      public static List<String> defaultRootModules(Iterable<IPackageFragmentRoot> allSystemRoots)
      Filter the given set of system roots by the rules for root modules from JEP 261.
      Parameters:
      allSystemRoots - all physically available system modules, represented by their package fragment roots
      Returns:
      the list of names of default root modules
      Since:
      3.14
    • compileWithAttributes

      public static byte[] compileWithAttributes(IModuleDescription module, Map<String,String> classFileAttributes) throws JavaModelException, IllegalArgumentException
      Compile the given module description in the context of its enclosing Java project and add class file attributes using the given map of attribute values.

      In this map, the following keys are supported

      IAttributeNamesConstants.MODULE_MAIN_CLASS
      The associated value will be used for the ModuleMainClass attribute.
      IAttributeNamesConstants.MODULE_PACKAGES
      If the associated value is an empty string, then the compiler will generate a ModulePackages attribute with a list of packages that is computed from
      • all exports directives
      • all opens directives
      • the implementation classes of all provides directives.
      If the associated value is not empty, it must be a comma-separated list of package names, which will be added to the computed list.

      No other keys are supported in this version, but more keys may be added in the future.

      Parameters:
      module - handle for the module-info.java file to be compiled.
      classFileAttributes - map of attribute names and values to be used during class file generation
      Returns:
      the compiled byte code
      Throws:
      IllegalArgumentException - if the map of classFileAttributes contains an unsupported key.
      JavaModelException
      Since:
      3.14
    • getModuleNameFromJar

      public static String getModuleNameFromJar(File file)
      Returns the module name computed for a jar. If the file is a jar and contains a module-info.class, the name specified in it is used, otherwise, the algorithm for automatic module naming is used, which first looks for a module name in the Manifest.MF and as last resort computes it from the file name.
      Parameters:
      file - the jar to examine
      Returns:
      null if file is not a file, otherwise the module name.
      Since:
      3.14
    • getRequiredModulesFromJar

      public static Set<String> getRequiredModulesFromJar(File file)
      Returns the names of the modules required by the module-info.class in the jar. If the file is not jar or a jar that has no module-info.class is present, the empty set is returned.
      Parameters:
      file - the jar to examine
      Returns:
      set of module names.
      Since:
      3.14
    • stop

      public void stop(BundleContext context) throws Exception
      Specified by:
      stop in interface BundleActivator
      Overrides:
      stop in class org.eclipse.core.runtime.Plugin
      Throws:
      Exception
    • start

      public void start(BundleContext context) throws Exception
      Specified by:
      start in interface BundleActivator
      Overrides:
      start in class org.eclipse.core.runtime.Plugin
      Throws:
      Exception