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.RECOVERED
ASTParser#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, * orNote that previously existing find type API methods: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 ornull
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, * ornull
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 ornull
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, * ornull
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 ornull
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, * ornull
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 ornull
if none is found * @see IType#getFullyQualifiedName(char) * @since 3.2 */ IType findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner, IProgressMonitor progressMonitor) throws JavaModelException;
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, ornull
if 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, ornull
if 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, * ornull
if none */ public final void setLocalElement(IJavaElement localElement) /** * Sets the other elements of this search match. * * @param otherElements the other elements of the match, * ornull
if 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-1
if 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-1
if the character * position does not correspond to a source line in the original * source file or-2
if 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 ifcolumn
is 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; *-2
if line/column number information is not known * for this compilation unit or-1
the inputs are not valid * @since 3.2 */ public int getPosition(int line, int column) /** * Returns the line number corresponding to the given source character * position in the original source string. The initial line of the * compilation unit is numbered 1, and each line extends through the * last character of the end-of-line delimiter. The very last line extends * through the end of the source string and has no line delimiter. * For example, the source stringclass A\n{\n}
has 3 lines * corresponding to inclusive character ranges [0,7], [8,9], and [10,10]. * Returns -1 for a character position that does not correspond to any * source line, or -2 if no line number information is available for this * compilation unit. * * @param position a 0-based character position, possibly * negative or out of range * @return the 1-based line number, or-1
if the character * position does not correspond to a source line in the original * source file or-2
if line number information is not known for this * compilation unit * @see ASTParser * @since 3.2 */ public int getLineNumber(int position)
IMethod#getRawParameterNames()
that returns the invented names arg0...argn for a binary method.IOpenable#findRecommendedLineSeparator()
that finds the line separator for the given Java element.JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS: - old default value = "enabled" - new default value = "disabled" JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS__DEPRECATED_REF - old default value = "enabled" - new default value = "disabled" JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS__NOT_VISIBLE_REF - old default value = "enabled" - new default value = "disabled" JavaCore.COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY - old default value = "private" - new default value = "public" JavaCore.COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY - old default value = "private" - new default value = "public"
/** * Return the index in the whole comments list {@link #getCommentList() } * of the first leading comments associated with the given node. * * @param node the node * @return 0-based index of first leading comment or -1 if node has * no associated comment before its start position. * @since 3.2 */ public int firstLeadingCommentIndex(ASTNode node) /** * Return the index in the whole comments list {@link #getCommentList() } * of the last trailing comments associated with the given node. * * @param node the node * @return 0-based index of last trailing comment or -1 if node has * no associated comment after its end position. * @since 3.2 */ public int lastTrailingCommentIndex(ASTNode node) /** * Returns the column number corresponding to the given source character * position in the original source string. Column number are zero-based. * Return zero if it is beyond the valid range. * * @param position a 0-based character position, possibly * negative or out of range * @return the 0-based coloumn number, or0
if the character * position does not correspond to a source line in the original * source file or if column number information is not known for this * compilation unit * @see ASTParser * @since 3.2 */ public int columnNumber(final int position) /** * Given a line number and column number, returns the corresponding * position in the original source string. * Returns 0 if no line number information is available for this * compilation unit or the requested line number is less than one. * Returns the total size of the source string ifline
* is greater than the actual number lines in the unit. * Returns 0 ifcolumn
is less than 0, * or the position of the last character of the line ifcolumn
* is beyond the legal range. * * @param line the one-based line number * @param column the zero-based column number * @return the 0-based character position in the source string; * returns0
if line/column number information is not known * for this compilation unit or the inputs are not valid * @since 3.2 */ public int getPosition(int line, int column)
This is matching the format of the JDT/Core buildnotes. But the code can be easily customized for a different format.
compilationParticipant
extension point as well as
CompilationParticipant
and ReconcileContext
classes.)
Note that this support is still work in progress and it is subject to change.
Ability to participate in building will be added later.
/** * Returns the completed token. * This token is either the identifier or Java language keyword * or the string literal under, immediately preceding, * the original request offset. If the original request offset * is not within or immediately after an identifier or keyword or * a string literal then the returned value is <code>null</code>. * * @return completed token or <code>null</code> * @since 3.2 */ public char[] getToken() /** * Returns the kind of completion token being proposed. * * The set of different kinds of completion token is * expected to change over time. It is strongly recommended * that clients do not assume that the kind is one of the * ones they know about, and code defensively for the * possibility of unexpected future growth. * * @return the kind; one of the kind constants declared on * this class whose name starts with <code>TOKEN_KIND</code>, * or possibly a kind unknown to the caller * @since 3.2 */ public int getTokenKind() /** * Returns the character index of the start of the * subrange in the source file buffer containing the * relevant token being completed. This * token is either the identifier or Java language keyword * under, or immediately preceding, the original request * offset. If the original request offset is not within * or immediately after an identifier or keyword, then the * position returned is original request offset and the * token range is empty. * * @return character index of token start position (inclusive) * @since 3.2 */ public int getTokenStart() /** * Returns the character index of the end (exclusive) of the subrange * in the source file buffer containing the * relevant token. When there is no relevant token, the * range is empty * (<code>getTokenEnd() == getTokenStart()</code>). * * @return character index of token end position (exclusive) * @since 3.2 */ public int getTokenEnd() /** * Returns the offset position in the source file buffer * after which code assist is requested. * * @return offset position in the source file buffer * @since 3.2 */ public int getOffset()
/** * Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. * CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. * * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern * uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field * names follow the lower CamelCase convention. * * The pattern may contain trailing lowercase characters, which will be match in a case sensitive way. These characters must * appear in sequence in the name, after the last matching capital of the pattern. For instance, 'NPExcep' will match * 'NullPointerException', but not 'NullPointerExCEPTION'. * * For example: * - pattern = "NPE" * name = NullPointerException * result => true * - pattern = "npe" * name = NullPointerException * result => false * * @see CharOperation#camelCaseMatch(char[], char[]) * Implementation has been entirely copied from this method except for array lengthes * which were obviously replaced with calls to {@link String#length()}. * * @param pattern the given pattern * @param name the given name * @return true if the pattern matches the given name, false otherwise */ public static final boolean camelCaseMatch(String pattern, String name) /** * Answers true if a sub-pattern matches the subpart of the given name using CamelCase rules, or false otherwise. * CamelCase matching does NOT accept explicit wild-cards '*' and '?' and is inherently case sensitive. * Can match only subset of name/pattern, considering end positions as non-inclusive. * The subpattern is defined by the patternStart and patternEnd positions. * * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern * uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field * names follow the lower CamelCase convention. * * The pattern may contain trailing lowercase characters, which will be match in a case sensitive way. These characters must * appear in sequence in the name, after the last matching capital of the pattern. For instance, 'NPExcep' will match * 'NullPointerException', but not 'NullPointerExCEPTION'. * * For example: * - pattern = "NPE" * patternStart = 1 * patternEnd = 3 * name = NullPointerException * nameStart = 0 * nameEnd = 20 * result => true * - pattern = "npe" * patternStart = 1 * patternEnd = 3 * name = NullPointerException * nameStart = 0 * nameEnd = 20 * result => false * * @see CharOperation#camelCaseMatch(char[], int, int, char[], int, int) * Implementation has been entirely copied from this method except for array lengthes * which were obviously replaced with calls to {@link String#length()} and * for array direct access which were replaced with calls to {@link String#charAt(int)}. * * @param pattern the given pattern * @param patternStart the given pattern start * @param patternEnd the given pattern end * @param name the given name * @param nameStart the given name start * @param nameEnd the given name end * @return true if a sub-pattern matches the subpart of the given name, false otherwise */ public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd) /** * Validate compatibility between given string pattern and match rule. * * Optimized (ie. returned match rule is modified) combinations are: * - {@link #R_PATTERN_MATCH} without any '*' or '?' in string pattern: * pattern match bit is unset, * - {@link #R_PATTERN_MATCH} and {@link #R_PREFIX_MATCH} bits simultaneously set: * prefix match bit is unset, * - {@link #R_PATTERN_MATCH} and {@link #R_CAMELCASE_MATCH} bits simultaneously set: * camel case match bit is unset, * - {@link #R_CAMELCASE_MATCH} with invalid combination of uppercase and lowercase characters: * camel case match bit is unset and replaced with prefix match pattern, * - {@link #R_CAMELCASE_MATCH} combined with {@link #R_PREFIX_MATCH} and {@link #R_CASE_SENSITIVE} * bits is reduced to only {@link #R_CAMELCASE_MATCH} as Camel Case search is already prefix and case sensitive. * * Rejected (ie. returned match rule -1) combinations are: * - {@link #R_REGEXP_MATCH} with any other match mode bit set. * * @param stringPattern The string pattern * @param matchRule The match rule * @return Optimized valid match rule or -1 if an incompatibility was detected. */ public static int validateMatchRule(String stringPattern, int matchRule) {
/** * CODEASSIST / Activate Camel Case Sensitive Completion * When active, completion show proposals whose name match to the CamelCase pattern. * - option id: "org.eclipse.jdt.core.codeComplete.camelCaseMatch" * - possible values: { "enabled", "disabled" } * - default: "disabled" */ JavaCore#CODEASSIST_CAMEL_CASE_MATCHCurrently this option is disabled by default. The default value of this option will be set to enabled when JDT/Text will be able to manage this kind of proposal (see bug 114098)
@pa|
will give @param
proposal only in javadoc of method or generic type declarations,{@co|
will give {@code }
proposal only if your compiler compliance has been set to 1.5 or over,@see
, @throws
, @exception
, {@link}
,
{@linplain}
or {@value}
tags will behave like completion in java code. Type qualification for
types will be inserted depending on "Add import instead of qualified name" Code Assist preferences.
/** * This is an example of completion inside text area: S| */ public class Sample {}will propose both
String
and Sample
, but also {@link String }
and
{@link Sample }
.
Currently each proposal is available either as java code type name or direclty inserted as a {@link} tag.
This part is still under work and final behavior should depend on a new JDT/UI preferences.../** * This is an example of completion inside text area: #m| */ public class Sample { void method() {} }will propose
{@link #method() }
.
CompletionContext
:
/** * Tell user whether completion takes place in a javadoc comment or not. * * @return boolean true if completion takes place in a javadoc comment, false otherwise. * @since 3.2 */ public boolean isInJavadoc() {...} /** * Tell user whether completion takes place in text area of a javadoc comment or not. * * @return boolean true if completion takes place in a text area of a javadoc comment, false otherwise. * @since 3.2 */ public boolean isInJavadocText() {...} /** * Tell user whether completion takes place in a formal reference of a javadoc tag or not. * Tags with formal reference are: * - @see * - @throws * - @exception * - {@link Object} * - {@linkplain Object} * - {@value} when compiler compliance is set at leats to 1.5 * * @return boolean true if completion takes place in formal reference of a javadoc tag, false otherwise. * @since 3.2 */ public boolean isInJavadocFormalReference() {...}
org.eclipse.jdt.core.IMember#ISourceRange getJavadocRange() throws JavaModelException
. This API can be used
to retrieve the source range of a javadoc comment attached to the corresponding member.
* COMPILER / 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, errors are fatal, whether they are optional or not. * - option id: "org.eclipse.jdt.core.compiler.problem.fatalOptionalError" * - possible values: { "enabled", "disabled" } * - default: "enabled"
IJavaElementDelta#F_CATEGORIES
. This flag is set when one or more categories of an element
are added/changed/removed.SearchPattern
(see bug 110060):
/** * Match rule: The search pattern contains a Camel Case expression. * For example,NPE
type string pattern will match *NullPointerException
type. * @see CharOperation#camelCaseMatch(char[], char[]) for a detailed explanation * of Camel Case matching. * * Can be combined to {@link #R_PREFIX_MATCH} match rule. For example, * when prefix match rule is combined with Camel Case match rule, *"nPE"
pattern will matchnPException
. * * Match rule {@link #R_PATTERN_MATCH} may also be combined but both rules * will not be used simultaneously as they are mutually exclusive. * Used match rule depends on whether string pattern contains specific pattern * characters (e.g. '*' or '?') or not. If it does, then only Pattern match rule * will be used, otherwise only Camel Case match will be used. * For example, with"NPE"
string pattern, search will only use * Camel Case match rule, but withN*P*E*
string pattern, it will * use only Pattern match rule. * * @since 3.2 */ public static final int R_CAMELCASE_MATCH = 0x0080;
* COMPILER / 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", "ignore" } * - default: "warning"
org.eclipse.jdt.core.ToolFactory#createDefaultClassFileReader(java.io.InputStream,int)
that allows to the creation of an org.eclipse.jdt.core.util.IClassFileReader object using an input stream.
JavaCore#addPreProcessingResourceChangedListener(IResourceChangeListener,int)
that allows to register an IResourceChangedListener
for a given event type that runs
before JDT Core.IMember#getCategories()
and to get the children of a type for a given category
IType#getChildrenForCategory(String)
.* Answers true if the pattern matches the given name using CamelCase rules, or false otherwise. * char[] CamelCase matching does NOT accept explicit wild-cards '*' and '?'. * * CamelCase denotes the convention of writing compound names without spaces, and capitalizing every term. * This function recognizes both upper and lower CamelCase, depending whether the leading character is capitalized * or not. The leading part of an upper CamelCase pattern is assumed to contain a sequence of capitals which are appearing * in the matching name; e.g. 'NPE' will match 'NullPointerException', but not 'NewPerfData'. A lower CamelCase pattern * uses a lowercase first character. In Java, type names follow the upper CamelCase convention, whereas method or field * names follow the lower CamelCase convention. * * The pattern may contain trailing lowercase characters, which will be match in a case sensitive way. These characters must * appear in sequence in the name, after the last matching capital of the pattern. For instance, 'NPExcep' will match * 'NullPointerException', but not 'NullPointerExCEPTION'. public static final boolean camelCaseMatch(char[] pattern, char[] name) public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd)
@SuppressWarnings("unchecked")
* COMPILER / 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", "ignore" } * - default: "ignore"
CategorizedProblem
to extend IProblem
definitions with notion of
problem category and marker type. This will enable other pluggable tool to participate in various compilation stages
and report domain specific problems through the existing API (IProblem
based). It is recommended that
clients do not directly implement IProblem
but instead do extend the abstract class CategorizedProblem
.
/**
* Returns an integer identifying the category of this problem. Categories, like problem IDs are
* defined in the context of some marker type. Custom implementations of CategorizedProblem
* may choose arbitrary values for problem/category IDs, as long as they are associated with a different
* marker type.
* @return id - an integer identifying the category of this problem
*/
public abstract int getCategoryID();
/** * Returns the marker type associated to this problem, if it was persisted into a marker by the JavaBuilder * Standard Java problems are associated to marker type "org.eclipse.jdt.core.problem"), standard tasks * are associated to marker type "org.eclipse.jdt.core.task". * @return the type of the marker which would be associated to the problem * @see org.eclipse.jdt.core.IJavaModelMarker#JAVA_MODEL_PROBLEM_MARKER * @see org.eclipse.jdt.core.IJavaModelMarker#TASK_MARKER */ public abstract String getMarkerType();
IJavaElementDelta#F_AST_AFFECTED
and IJavaElementDelta#getCompilationUnitAST()
.
The Java element delta's flag is set to F_AST_AFFECTED
when a reconcile operation affects the AST
created in the last reconcile operation. In this case the AST should be re-acquired using getCompilationUnitAST()
.
IJavaProject#encodeClasspathEntry(IClasspathEntry)
and decodeClasspathEntry(String)
.
IClassFile#becomeWorkingCopy(...)
that returns an ICompilationUnit
in working copy mode on the given class file. See its Javadoc for more details.List l = (ArrayList) someList;
List foo(List someList) { return (ArrayList) someList;}
* COMPILER / Reporting Raw Type Reference * When enabled, the compiler will signal 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. * The severity of the problem is controlled with option "org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation". * - option id: "org.eclipse.jdt.core.compiler.problem.rawTypeReference" * - possible values: { "enabled", "disabled" } * - default: "disabled"
...
// System.out.println(""); //$NON-NLS-1$
...
String s = "Hello, World"; //$NON-NLS-1$ This won't be removed //$NON-NLS-2$ at all
becomes:
String s = "Hello, World"; //$NON-NLS-1$ This won't be removed at all