| jdt core - build notes 3.1 stream |
| java development tooling core |
|
Here are the build notes for the Eclipse JDT/Core plug-in project
org.eclipse.jdt.core,
describing bug resolution and substantial changes in the HEAD branch.
This present document covers all changes since Release 3.0 (also see a summary of API changes).
Maintenance of previous releases of JDT/Core is performed in parallel branches: R3.0.x, R2.1.x, R2.0.x, R1.0.x. |
NOTE:
All other warning tokens are not longer supported by @SuppressWarnings; considering that for some diagnosis, it is simpler to just fix the code than silence some warning. In Italic the old warning token is specified.
Warning tokens also supported by javac are in red (also see declared warning tokens).
"com/test/X.java" is now an invalid access rule pattern, and
"com/test/X" is a valid access rule pattern.Y<complete here> // p.q.X.Y is proposed.As all member types are proposed, code assist does not propose types of the wrong kind. Only classes are proposed inside an extends clause, only interfaces inside an implements clause and only annotations in annotation reference (It was necessary before to be able to propose a top level type which contains these types).
JavaCore#initializeAfterLoad(IProgressMonitor) to allow
a client to force the initialization of internal structures.
COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING and
COMPILER_PB_MISSING_JAVADOC_TAGS_OVERRIDING JavaCore options have been changed from "enabled" to "disabled".JavaCore.new*Entry method have been updated to clearly specify this behavior:
* 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.
JavaConventions.validateClasspathEntry(IJavaProject,IClasspathEntry,boolean,boolean) has been modified
to verify this point. It now returns an invalid status (new IJavaStatus(IJavaModelStatusConstants.NAME_COLLISION,...))
when duplicate names are found in extra attributes.
@SuppressWarnings annotations.
Note that this warning can itself be turned off using @SuppressWarnings("warningToken").
* COMPILER / 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", "ignore" }
* - default: "warning"
p.q.X<<complete here>> // p.q.X<T,U> is proposed. p.q.X<Object, <complete here>> //p.q.X<T,U> is proposed
@Annot(<complete here>) // p.Annot is proposed. @Annot(foo1=0, <complete here>) // p.Annot is proposed.
X$1$A.class, it will simply be X$1A.class".
@SuppressWarnings annotations.
Note that this warning can itself be turned off using @SuppressWarnings("warningToken").
* COMPILER / 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", "ignore" }
* - default: "ignore"
* COMPILER / Determine whether @SuppressWarnings is effective
* 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"
CorrectionEngine for computing the warning token corresponding to an optional warning ID.
/** * Returns a token which can be used to suppress a given warning using *@SuppressWarningsannotation, for a given problem ID * ({@link IProblem }). If a particular problem is not suppressable, *nullwill be returned. * * Note:@SuppressWarningscan only suppress warnings, * which means that if some problems got promoted to ERROR using custom compiler * settings ({@link IJavaProject#setOption(String, String)}), the *@SuppressWarningsannotation will be ineffective. * * Note:@SuppressWarningscan be argumented with *"all"so as to suppress all possible warnings at once. * * Note: The tokens returned are not necessarily standardized across Java * compilers. If you were to use one of these tokens in an @SuppressWarnings * annotation in the Java source code, the effects (if any) may vary from * compiler to compiler. * * @param problemID * the ID of a given warning to suppress * @return a String which can be used in@SuppressWarningsannotation, * ornullif unable to suppress this warning. * @since 3.1 */ public static String getWarningToken(int problemID)
@SuppressWarnings, see list below. Note that
these are subject to changing in the near future.
SearchMatch#isImplicit()SearchMatch#setImplicit(boolean)"all", "deprecation",
"serial", "unchecked", "finally".
/*
* CODEASSIST / Hide Proposals for Restricted Completions
* When value is "never", never hide proposals for restricted completions.
* When value is "error", hide proposals for restricted completions if insertion of these completions would create a compile error.
* When value is "warning", hide proposals for restricted completions if insertion of these completions would create a compile error or warning.
* To configure the severity of restrictions, "org.eclipse.jdt.core.compiler.problem.forbiddenReference"
* option must be used for forbidden reference and "org.eclipse.jdt.core.compiler.problem.discouragedReference"
* option must be used for discouraged reference.
* - option id: "org.eclipse.jdt.core.codeComplete.restrictionsCheck"
* - possible values: { "never", "error", "warning" }
* - default: "error"
*/
public static final String CODEASSIST_HIDE_RESTRICTED_REFERENCES;
BindingKey#getDeclaringTypeSignature() and
BindingKey#toSignature() as they were found error prone. See bug 93105
for details.ListRewrite#createMoveTarget(first, last, replacingNode, editGroup)).
See bug 91938 for details.
java.lang.RuntimeException and java.lang.Error eagerly
during compilation when assessing unchecked exception diagnosis. This allows Java class library developpers to be
more minimalistic.
org.eclipse.jdt.core/perf/completion=300: add an entry to performance.log if CompletionEngine.complete() take more than 300msorg.eclipse.jdt.core/perf/selection=300 add an entry to performance.log if SelectionEngine.select() take more than 300msorg.eclipse.jdt.core/perf/javadeltalistener=500 add an entry to performance.log if the call to the listener take more than 500msorg.eclipse.jdt.core/perf/variableinitializer=5000 add an entry to performance.log if the initialization take more than 5000msorg.eclipse.jdt.core/perf/containerinitializer=5000 add an entry to performance.log if the initialization take more than 5000msorg.eclipse.jdt.core/perf/reconcile=1000 add an entry to performance.log if ComplationUnit.reconcile() take more than 1000ms@MyAnnotation(<complete here> @MyAnnotation(foo=<complete here>
org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONSorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTSorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INDENTATION_SIZEorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#MIXED. This new constant is used for the option:
org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR.org.eclipse.jdt.core.dom.ITypeBinding#getDeclaringMethod(). See bug 86580 for details.org.eclipse.jdt.core.formatter.CodeFormatter#K_SINGLE_LINE_COMMENTorg.eclipse.jdt.core.formatter.CodeFormatter#K_MULTI_LINE_COMMENTorg.eclipse.jdt.core.formatter.CodeFormatter#K_JAVA_DOCorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_CLEAR_BLANK_LINESorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_HEADERorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_HTMLorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_SOURCEorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMATorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTIONorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INDENT_ROOT_TAGSorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGSorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETERorg.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_LINE_LENGTHIClasspathAttribute#JAVADOC_LOCATION_ATTRIBUTE_NAME.BindingKey#createArrayTypeBindingKey(String typeKey, int arrayDimension)BindingKey#createTypeBindingKey(String typeName).BindingKey#createParameterizedTypeBindingKey(String genericTypeKey, String[] argumentTypeKeys).createTypeVariableBindingKey(String typeVariableName, String declaringKey)BindingKey#createWildcardTypeBindingKey(String typeKey, char kind)IField#isEnumConstant()org.eclipse.jdt.core.IAccessRule
int K_ACCESSIBLE;int K_NON_ACCESSIBLE;int K_DISCOURAGED;IPath getPattern();int getKind();org.eclipse.jdt.core.JavaCore
String COMPILER_PB_DISCOURAGED_REFERENCE;IAccessRule newAccessRule(IPath pattern, int kind);IClasspathEntry newContainerEntry(
IPath containerPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported);IClasspathEntry newLibraryEntry(
IPath path,
IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported);IClasspathEntry newProjectEntry(
IPath path,
IAccessRule[] accessRules,
boolean combineAccessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported);IClasspathEntry newVariableEntry(
IPath variablePath,
IPath variableSourceAttachmentPath,
IPath variableSourceAttachmentRootPath,
IAccessRule[] accessRules,
IClasspathAttribute[] extraAttributes,
boolean isExported);org.eclipse.jdt.core.IClasspathEntry
boolean combineAccessRules();
IAccessRule[] getAccessRules();
MyClass, in following Javadoc comment:
/** * @see MyClass This is my class */will open editor on MyClass.java file.
Colors c;
swith(c) {
case BLUE:
case RED; // select RED
}
Signature#WILDCARD_TYPE_SIGNATURE.Signature#getTypeSignatureKind(char[]) and Signature#getTypeSignatureKind(String)
now return Signature#WILDCARD_TYPE_SIGNATURE if the signature is a wildcard : * or +Ljava.lang.Object; or -Ljava.lang.Object;
X x = zzz<complete here>In this example the expected type is
X. It is not mandatory to a proposal
to respect this expectation and it is possible that there is no completion proposal.
public class CompletionContext {
public char[][] getExpectedTypesSignatures() {...}
public char[][] getExpectedTypesKeys() {...}
}
Client must override CompletionRequestor#acceptContext(..) to know the context.
This method call ocurs after the call to beginReporting() and before the call to any
accept(CompletionProposal) method.
public class CompletionRequestor {
...
public void acceptContext(CompletionContext context) {..}
...
}
@Deprecated annotations, and treats them equivalent
to doc comment /** @deprecated */.
@Deprecated annotation (to encourage using annotations instead of doc comment tag).
Corresponding problem IDs are: IProblem.FieldMissingDeprecatedAnnotation,
IProblem.MethodMissingDeprecatedAnnotation,
IProblem.TypeMissingDeprecatedAnnotation.
* COMPILER / 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 has no corresponding @Deprecated annotation.
* - option id: "org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
MethodRefParameter:
/** * The "varargs" structural property of this node type (added in JLS3 API). * @since 3.1 */ public static final SimplePropertyDescriptor VARARGS_PROPERTY; /** * Returns whether this method reference parameter is for * the last parameter of a variable arity method (added in JLS3 API). ** Note that the binding for the type
* * @returnFooin the vararg method * reference#fun(Foo...)is always for the type as * written; i.e., the type binding forFoo. However, if you * navigate from the MethodRef to its method binding to the * type binding for its last parameter, the type binding for the vararg * parameter is always an array type (i.e.,Foo[]) reflecting * the way vararg methods get compiled. *trueif this is a variable arity parameter, * andfalseotherwise * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 */ public boolean isVarargs(); /** * Sets whether this method reference parameter is for the last parameter of * a variable arity method (added in JLS3 API). * * @param variableAritytrueif this is a variable arity * parameter, andfalseotherwise * @since 3.1 */ public void setVarargs(boolean variableArity);