| jdt core - build notes 3.2.x 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 TARGET_321 branch.
This present document covers all changes since Release 3.1 (also see a summary of API changes).
Maintenance of previous releases of JDT/Core is performed in parallel branches: R3.1.x, R3.0.x, R2.1.x, R2.0.x, R1.0.x. |
NuPoEx type string pattern will match NullPointerException type but will not match NoPermissionException.
* BUILDER / 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"
BuildContext#recordNewProblems(...) now need to declare the problems
marker type as being managed for this problems to be persisted as markers by the Java builder. Declaring a managed marker type is
done using the 'managedMarker' sequence in the 'compilationParticipant' extension point.@SuppressWarnings("cast") for silencing unnecessary cast diagnostics.Preferences>Java>Compiler>Building>Treat configurable errors like fatal errors...int i = i = 0;i = i = 0;i = ++i;CategorizedProblem#getExtraMarkerAttributeNames() and getExtraMarkerAttributeValues() to allow to
specify extra attributes in problem markers.JAR files are now read more selectively, and thus interesting portions remain in the cache longer without consuming lots of memory. User editing experience is thus significantly improved on large workspaces containing big JARs. As a consequence, our experiments show that the memory requirement for developing Eclipse in Eclipse can be lowered to 128MB only (i.e. passing -Xmx128m to the VM) as opposed to 256MB as currently specified in the eclipse.ini file.
IMethodBinding#isOverriding() API introduced during 3.2 in DOM AST, as it doesn't meet
client expectation, who isn't even using it (also see bug 90660).
* COMPILER / 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", "ignore" }
* - default: "ignore"
Fall-through warnings can be silenced using @SuppressWarnings("fallthrough").
* CODEASSIST / Activate Deprecation Sensitive Completion
* When active, completion doesn't show deprecated members and types.
* - option id: "org.eclipse.jdt.core.codeComplete.deprecationCheck"
* - possible values: { "enabled", "disabled" }
* - default: "disable"
*
Window>Preferences>Java>Compiler>Errors/Warnings>Potential programming problems>Null reference.
Also see bug 110030 for details.
@SuppressWarnings("null").org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER
org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION
org.eclipse.jdt.core.CorrectionEngine#getAllWarningTokens() to
get all the valid warning tokens, which can be used into @SuppressWarnings
annotations. See bug
126326 for details.@SuppressWarnings("restriction").
Note: if certain restrictions are configured as errors, the annotation has no effect. org.eclipse.jdt.core.formatter.CodeFormatter#createIndentationString(int) to return the indentation string corresponding to the given indentation level.org.eclipse.jdt.core.formatter.IndentManipulation to deal with indentations.org.eclipse.jdt.core.dom.IVariableBinding#isParameter() in order to fix bug 106545.BindingKey#toSignature() to transform a binding key into a resolved signature.WorkingCopyOwner#newWorkingCopy(String,IClasspathEntry[],IProblemRequestor,IProgressMonitor)
for editing compilation units outside the workspace.IClasspathAttribute#OPTIONAL
extra attribute. The possible values for this attribute are "true" or "false".
When not present, "false" is assumed. If the value of this attribute is "true",
the classpath entry is optional. ASTNode.RECOVEREDASTParser#setStatementsRecovery(boolean enabled)ICompilationUnit#reconcile(int astLevel, boolean forceProblemDetection, boolean enableStatementsRecovery, WorkingCopyOwner owner, IProgressMonitor monitor)discouraged and
forbidden, so as to suppress warnings about access rules restrictions.IAccessRule#IGNORE_IF_BETTER that indicates that the rule should be ignored if a better rule is found.
E.g. if a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER matches type p.X and a rule K_DISCOURAGED
that also matches p.X is found after the first one, then p.X will be reported as discouraged.ImportRewrite#setImportOrder(), ImportRewrite#setOnDemandImportThreshold() and
ImportRewrite#setStaticOnDemandImportThreshold(). For compatibility reasons the actual configuration option values stay in
JDT.UIorg.eclipse.jdt.core.dom.ImportRewrite). The import rewriter is used to add new imports according
to a user specified import order. See bug 73054 for details.org.eclipse.jdt.core.dom.Modifier#isPublic(), org.eclipse.jdt.core.dom.Modifier#isStatic(), ...). See bug 122460 for details.org.eclipse.jdt.core.IJavaElement#String getAttachedJavadoc(IProgressMonitor monitor). See bug 122506 for details.
The former API org.eclipse.jdt.core.IJavaElement#String getAttachedJavadoc(IProgressMonitor monitor, String defaultEncoding) has been deprecated.org.eclipse.jdt.core.dom.ITypeBinding#getComponentType() in order to retrieve the binding
corresponding to the component type of the array binding. See bug 120264 for details.
This API is still subject to change before 3.2 release.
* COMPILER / 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", "ignore" }
* - default: "ignore"
JavaCore.CODEASSIST_TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC has been deprecated and it will be removed
after M4. Use JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC instead.
/**
* Same functionality as {@link #findType(String)} but also look for secondary
* types if given name does not match a compilation unit name.
*
* @param fullyQualifiedName the given fully qualified name
* @param progressMonitor the progress monitor to report progress to,
* or null if no progress monitor is provided
* @exception JavaModelException if this project does not exist or if an
* exception occurs while accessing its corresponding resource
* @return the first type found following this project's classpath
* with the given fully qualified name or null if none is found
* @see IType#getFullyQualifiedName(char)
* @since 3.2
*/
IType findType(String fullyQualifiedName, IProgressMonitor progressMonitor) throws JavaModelException;
/**
* Same functionality as {@link #findType(String, WorkingCopyOwner)}
* but also look for secondary types if given name does not match
* a compilation unit name.
*
* @param fullyQualifiedName the given fully qualified name
* @param owner the owner of the returned type's compilation unit
* @param progressMonitor the progress monitor to report progress to,
* or null if no progress monitor is provided
* @exception JavaModelException if this project does not exist or if an
* exception occurs while accessing its corresponding resource
* @return the first type found following this project's classpath
* with the given fully qualified name or null if none is found
* @see IType#getFullyQualifiedName(char)
* @since 3.2
*/
IType findType(String fullyQualifiedName, WorkingCopyOwner owner, IProgressMonitor progressMonitor) throws JavaModelException;
/**
* Same functionality as {@link #findType(String, String)} but also look for
* secondary types if given name does not match a compilation unit name.
*
* @param packageName the given package name
* @param typeQualifiedName the given type qualified name
* @param progressMonitor the progress monitor to report progress to,
* or null if no progress monitor is provided
* @exception JavaModelException if this project does not exist or if an
* exception occurs while accessing its corresponding resource
* @return the first type found following this project's classpath
* with the given fully qualified name or null if none is found
* @see IType#getFullyQualifiedName(char)
* @since 3.2
*/
IType findType(String packageName, String typeQualifiedName, IProgressMonitor progressMonitor) throws JavaModelException;
/**
* Same functionality as {@link #findType(String, String, WorkingCopyOwner)}
* but also look for secondary types if given name does not match a compilation unit name.
*
* @param packageName the given package name
* @param typeQualifiedName the given type qualified name
* @param owner the owner of the returned type's compilation unit
* @param progressMonitor the progress monitor to report progress to,
* or null if no progress monitor is provided
* @exception JavaModelException if this project does not exist or if an
* exception occurs while accessing its corresponding resource
* @return the first type found following this project's classpath
* with the given fully qualified name or null if none is found
* @see IType#getFullyQualifiedName(char)
* @since 3.2
*/
IType findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner, IProgressMonitor progressMonitor) throws JavaModelException;
Note that previously existing find type API methods:
IJavaproject#findType(String)IJavaproject#findType(String, WorkingCopyOwner)IJavaproject#findType(String, String)IJavaproject#findType(String, String, WorkingCopyOwner)SearchParticipant#removeIndex(IPath) to remove both index file
from a given location and its corresponding Index in IndexManager cache.
IJavaProject#setRawClasspath(IClasspathEntry[], IPath, boolean, IProgressMonitor)
to change the output location as well as the classpath without touching resources.IJavaProject#setRawClasspath(IClasspathEntry[], boolean, IProgressMonitor)
to set the classpath without touching the .classpath file.org.eclipse.jdt.core.compiler.CharOperation#equals(char[], char[], int, int, boolean).org.eclipse.jdt.core.compiler.CharOperation#replace(char[], char[], char, int, int).IMember#getOccurrenceCount() to return the relative position of the member in the source.WorkingCopyOwner#newWorkingCopy(String,IProgressMonitor) to create a new working copy
without an underlying resource./** * Returns the local element of this search match. * This may be a local variable which declaring type is the referenced one * or a type parameter which extends it. * * @return the element of the search match, ornullif none or there's * no more specific local element than the element itself ({@link SearchMatch#getElement()}). */ public final IJavaElement getLocalElement() /** * Returns other enclosing elements of this search match. * * If {@link #getLocalElement()} is notnull, these may be other * local elements such as additional local variables of a multiple local * variables declaration. Otherwise, these may be other elements such as * additional fields of a multiple fields declaration. * * @return the other elements of the search match, ornullif none */ public final IJavaElement[] getOtherElements() /** * Sets the local element of this search match. * * @param localElement A more specific local element that corresponds to the match, * ornullif none */ public final void setLocalElement(IJavaElement localElement) /** * Sets the other elements of this search match. * * @param otherElements the other elements of the match, * ornullif none */ public final void setOtherElements(IJavaElement[] otherElements)
JavaCore#initializeAfterLoad(IProgressMonitor) used to schedule a job to do its work.
It now does it in the same thread. Note this is not an API change as the spec allows both scenarii.
JavaCore#getJavaLikeExtensions(), isJavaLikeFileName(String), and removeJavaLikeExtension(String)
to get the available Java-like extensions (from the Java source content-type), checking if a file is a Java-like file, and removing
the Java-like extension from a file name.
/** * Returns the column number corresponding to the given source character * position in the original source string. Column number are zero-based. * Return-1if it is beyond the valid range or-2* if the column number information is unknown. * * @param position a 0-based character position, possibly * negative or out of range * @return the 0-based column number, or-1if the character * position does not correspond to a source line in the original * source file or-2if column number information is unknown for this * compilation unit * @see ASTParser * @since 3.2 */ public int getColumnNumber(final int position) /** * Given a line number and column number, returns the corresponding * position in the original source string. * Returns -2 if no line number information is available for this * compilation unit. * Returns the total size of the source string ifline* is greater than the actual number lines in the unit. * Returns -1 ifcolumnis less than 0, * or the position of the last character of the line ifcolumn* is beyond the legal range, or the given line number is less than one. * * @param line the one-based line number * @param column the zero-based column number * @return the 0-based character position in the source string; *-2if line/column number information is not known * for this compilation unit or-1the inputs are not valid * @since