| jdt core - build notes 3.4 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.
For more information on 3.4 planning, please refer to JDT/Core release plan,
the next milestone plan,
the overall official plan,
or the build schedule.
This present document covers all changes since Release 3.3 (also see a summary of API changes).
Maintenance of previous releases of JDT/Core is performed in parallel branches: R3.3.x, R3.2.x, R3.1.x, R3.0.x, R2.1.x, R2.0.x, R1.0.x. |
* FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER
* FORMATTER / Option to insert a new line after an annotation on a member (package, class, method, field declaration)
* - option id: "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member"
* - possible values: { INSERT, DO_NOT_INSERT }
* - default: INSERT
*
* FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER
* FORMATTER / Option to insert a new line after an annotation on a parameter
* - option id: "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
* - possible values: { INSERT, DO_NOT_INSERT }
* - default: DO_NOT_INSERT
*
* FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE
* FORMATTER / Option to insert a new line after an annotation on a local variable
* - option id: "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable"
* - possible values: { INSERT, DO_NOT_INSERT }
* - default: INSERT
The addition of new lines after annotations has been discussed in bug 122247
* COMPILER / Reporting Unused Declared Thrown Unchecked Exceptions
* When enabled, the compiler will report unused declared thrown
* exceptions for all exceptions, including unchecked ones. When
* disabled, only checked exceptions will be considered.
*
* The severity of the problem is controlled with option
* "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException".
* - option id: "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeUncheckedExceptions"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
(note that the specification for unusedDeclaredThrownException has been
amended accordingly; see bug 100278)
IJavaSearchConstants API constants for fine grained search
(see bug 155013).limitTo
parameter while calling SearchPattern.createPattern(...) methods.Here is the exhaustive list of these fine grain search flags:
/**
* Return only type references used as the type of a field declaration.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int FIELD_DECLARATION_TYPE_REFERENCE = 0x40;
/**
* Return only type references used as the type of a local variable declaration.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE = 0x80;
/**
* Return only type references used as the type of a method parameter
* declaration.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int PARAMETER_DECLARATION_TYPE_REFERENCE = 0x100;
/**
* Return only type references used as a super type or as a super interface.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int SUPERTYPE_TYPE_REFERENCE = 0x200;
/**
* Return only type references used in a throws clause.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int THROWS_CLAUSE_TYPE_REFERENCE = 0x400;
/**
* Return only type references used in a cast expression.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int CAST_TYPE_REFERENCE = 0x800;
/**
* Return only type references used in a catch header.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int CATCH_TYPE_REFERENCE = 0x1000;
/**
* Return only type references used in class instance creation.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* Example:
* public class Test {
* Test() {}
* static Test bar() {
* return new Test();
* }
* }
*
* Searching references to the type Test using this flag in the
* above snippet will match only the reference in italic.
*
* Note that array creations are not returned when using this flag.
*
* @since 3.4
* @category limitTo
*/
int CLASS_INSTANCE_CREATION_TYPE_REFERENCE = 0x2000;
/**
* Return only type references used as a method return type.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int RETURN_TYPE_REFERENCE = 0x4000;
/**
* Return only type references used in an import declaration.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int IMPORT_DECLARATION_TYPE_REFERENCE = 0x8000;
/**
* Return only type references used as an annotation.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int ANNOTATION_TYPE_REFERENCE = 0x10000;
/**
* Return only type references used as a type argument in a parameterized
* type or a parameterized method.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int TYPE_ARGUMENT_TYPE_REFERENCE = 0x20000;
/**
* Return only type references used as a type variable bound.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int TYPE_VARIABLE_BOUND_TYPE_REFERENCE = 0x40000;
/**
* Return only type references used as a wildcard bound.
*
* When this flag is set, only {@link TypeReferenceMatch} matches will be
* returned.
*
* @since 3.4
* @category limitTo
*/
int WILDCARD_BOUND_TYPE_REFERENCE = 0x80000;
/**
* Return only super field accesses or super method invocations (e.g. using the
* super qualifier).
*
* When this flag is set, the kind of returned matches will depend on the
* specified nature of the searched element:
* . for the {@link #FIELD} nature, only {@link FieldReferenceMatch}
* matches will be returned,
* . for the {@link #METHOD} nature, only {@link MethodReferenceMatch}
* matches will be returned.
*
* @since 3.4
* @category limitTo
*/
int SUPER_REFERENCE = 0x1000000;
/**
* Return only qualified field accesses or qualified method invocations.
*
* When this flag is set, the kind of returned matches will depend on the
* specified nature of the searched element:
* . for the {@link #FIELD} nature, only {@link FieldReferenceMatch}
* matches will be returned,
* . for the {@link #METHOD} nature, only {@link MethodReferenceMatch}
* matches will be returned.
*
* @since 3.4
* @category limitTo
*/
int QUALIFIED_REFERENCE = 0x2000000;
/**
* Return only primary field accesses or primary method invocations (e.g. using
* the this qualifier).
*
* When this flag is set, the kind of returned matches will depend on the
* specified nature of the searched element:
* . for the {@link #FIELD} nature, only {@link FieldReferenceMatch}
* matches will be returned,
* . for the {@link #METHOD} nature, only {@link MethodReferenceMatch}
* matches will be returned.
*
* @since 3.4
* @category limitTo
*/
int THIS_REFERENCE = 0x4000000;
/**
* Return only field accesses or method invocations without any qualification.
*
* When this flag is set, the kind of returned matches will depend on the
* specified nature of the searched element:
* . for the {@link #FIELD} nature, only {@link FieldReferenceMatch}
* matches will be returned,
* . for the {@link #METHOD} nature, only {@link MethodReferenceMatch}
* matches will be returned.
*
* @since 3.4
* @category limitTo
*/
int IMPLICIT_THIS_REFERENCE = 0x8000000;
@SuppressWarnings to only complain if the relevant warnings were effectively
enabled when compiling. So if you turn off certain warnings, then the compiler is not going to suggest getting rid of existing @SuppressWarnings
in your code, until you will have enabled these back, and the compiler will have proved that there is no occurrence of them.
IMethod#getDefaultValue() to retrieve the default value of an annotation method.IMemberValuePair#K_SIMPLE_NAME to indicate that the value kind of the value is a simple name reference.IJavaProject#findElement(String, WorkingCopyOwner) to retrieve a IJavaElement from a binding key.
* COMPILER / 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", "ignore" }
* - default: "ignore"
(see bug 77918)
CodeFormatter#format(int, String, IRegion[], int, String) to allow the formatting of a set of
org.eclipse.jface.text.IRegions.@SupressWarnings(...) annotations which were necessary a while ago, but are no longer useful.
Note that @SuppressWarnings("all") is still silencing the warning for unnecessary @SuppressWarnings,
as it is the master switch to silence ALL warnings.
Also added option: JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN and problem ID
IProblem.UnusedWarningToken.
* COMPILER / 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(see bug 127533)@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", "ignore" } * - default: "warning"
public interface IAnnotation extends IJavaElement, ISourceReference {
String getElementName();
IMemberValuePair[] getMemberValuePairs() throws JavaModelException;
ISourceRange getNameRange() throws JavaModelException;
int getOccurrenceCount();
}
public interface IMemberValuePair {
int K_INT = 1;
int K_BYTE = 2;
int K_SHORT = 3;
int K_CHAR = 4;
int K_FLOAT = 5;
int K_DOUBLE = 6;
int K_LONG = 7;
int K_BOOLEAN = 8;
int K_STRING = 9;
int K_ANNOTATION = 10;
int K_CLASS = 11;
int K_QUALIFIED_NAME = 12;
int K_UNKNOWN = 13;
String getMemberName();
Object getValue();
int getValueKind();
}
public interface IAnnotatable {
IAnnotation getAnnotation(String name);
IAnnotation[] getAnnotations() throws JavaModelException;
} IField, IMethod, IType, IPackageDeclaration, and ILocalVariable
now implement this interface.
public interface IJavaElement extends IAdaptable {
...
int ANNOTATION = 16;
...
}
public interface IJavaElementDelta {
...
public int F_ANNOTATIONS = 0x400000;
public IJavaElementDelta[] getAnnotationDeltas();
...
} CompletionRequestor#CompletionRequestor(boolean ignoreAll) to be able to ignore all completion kinds by default instead of propose all completion kinds by default.
if statement with an instanceof expression as condition.instanceof type are proposed and the receiver is casted to this type.
Object x = ... ;
if (x instanceof IType) {
x.get|code assist
The method IType#getFullyQualifiedName() will be proposed and the receiver will be casted to IType.
The completion string will be '((IType)x).getFullyQualifiedName()'.CompletionProposal#METHOD_REF_WITH_CASTED_RECEIVER and
CompletionProposal#FIELD_REF_WITH_CASTED_RECEIVER.
public class CompletionProposal {
...
/**
* Completion is a reference to a method with a casted receiver.
* This kind of completion might occur in a context like
* <code>"receiver.fo^();"</code> and complete it to
* <code>""((X)receiver).foo();"</code>.
* <p>
* The following additional context information is available
* for this kind of completion proposal at little extra cost:
* <ul>
* <li>{@link #getDeclarationSignature()} -
* the type signature of the type that declares the method that is referenced
* </li>
* <li>{@link #getFlags()} -
* the modifiers flags of the method that is referenced
* </li>
* <li>{@link #getName()} -
* the simple name of the method that is referenced
* </li>
* <li>{@link #getReceiverSignature()} -
* the type signature of the receiver type. It's the type of the cast expression.
* </li>
* <li>{@link #getSignature()} -
* the method signature of the method that is referenced
* </li>
* </ul>
* </p>
*
* @see #getKind()
*
* @since 3.4
*/
public static final int METHOD_REF_WITH_CASTED_RECEIVER;
/**
* Completion is a reference to a field with a casted receiver.
* This kind of completion might occur in a context like
* <code>"recevier.ref^ = 0;"</code> and complete it to
* <code>"((X)receiver).refcount = 0;"</code>.
* <p>
* The following additional context information is available
* for this kind of completion proposal at little extra cost:
* <ul>
* <li>{@link #getDeclarationSignature()} -
* the type signature of the type that declares the field that is referenced
* </li>
* <li>{@link #getFlags()} -
* the modifiers flags (including ACC_ENUM) of the field that is referenced
* </li>
* <li>{@link #getName()} -
* the simple name of the field that is referenced
* </li>
* <li>{@link #getReceiverSignature()} -
* the type signature of the receiver type. It's the type of the cast expression.
* </li>
* <li>{@link #getSignature()} -
* the type signature of the field's type (as opposed to the
* signature of the type in which the referenced field
* is declared)
* </li>
*
* </ul>
* </p>
*
* @see #getKind()
*
* @since 3.4
*/
public static final int FIELD_REF_WITH_CASTED_RECEIVER;
/**
* Returns the type signature or package name of the relevant
* receiver in the context, or <code>null</code> if none.
* <p>
* This field is available for the following kinds of
* completion proposals:
* <ul>
* <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - type signature
* of the type that cast the receiver of the field that is referenced</li>
* <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - type signature
* of the type that cast the receiver of the method that is referenced</li>
* </ul>
* For kinds of completion proposals, this method returns
* <code>null</code>. Clients must not modify the array
* returned.
* </p>
*
* @return a type signature or a package name (depending
* on the kind of completion), or <code>null</code> if none
* @see Signature
*
* @since 3.4
*/
public char[] getReceiverSignature() {}
/**
* Returns the character index of the start of the
* subrange in the source file buffer containing the
* relevant receiver of the member being completed. This
* receiver is an expression.
*
* <p>
* This field is available for the following kinds of
* completion proposals:
* <ul>
* <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li>
* <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li>
* </ul>
* For kinds of completion proposals, this method returns <code>0</code>.
* </p>
*
* @return character index of receiver start position (inclusive)
*
* @since 3.4
*/
public int getReceiverStart() {}
/**
* Returns the character index of the end (exclusive) of the subrange
* in the source file buffer containing the
* relevant receiver of the member being completed.
*
* * <p>
* This field is available for the following kinds of
* completion proposals:
* <ul>
* <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li>
* <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li>
* </ul>
* For kinds of completion proposals, this method returns <code>0</code>.
* </p>
*
* @return character index of receiver end position (exclusive)
*
* @since 3.4
*/
public int getReceiverEnd() {}
...
}
/** * Notifies this participant that a build has finished for the project. * This will be sent, even if buildStarting() was not sent when no source files needed to be compiled * or the build failed. * Only sent to participants interested in the project. * @param project the project about to build * @since 3.4 */ public void buildFinished(IJavaProject project)
@SuppressWarnings("unused").
Also added option: JavaCore.COMPILER_PB_UNUSED_TYPE_ARGUMENTS_FOR_METHOD_INVOCATION and problem ID
IProblem.UnusedTypeArgumentsForMethodInvocation.
* COMPILER / 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", "ignore" }
* - default: "warning"
SearchPattern#R_CAMELCASE_SAME_PART_COUNT_MATCH.
/**
* Match rule: The search pattern contains a Camel Case expression with
* a strict expected number of parts.
*
* Examples:
* . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types,
* but not 'HashMapEntry'
* . 'HMap' type string pattern will still match previous 'HashMap' and
* 'HtmlMapper' types, but not 'HighMagnitude'
*
* This rule is not intended to be combined with any other match rule. In case
* of other match rule flags are combined with this one, then match rule validation
* will return a modified rule in order to perform a better appropriate search request
* (see {@link #validateMatchRule(String, int)} for more details).
*
* @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed
* explanation of Camel Case matching.
*
* @since 3.4
*/
public static final int R_CAMELCASE_SAME_PART_COUNT_MATCH = 0x0100;
Note that this constant replace previous one R_CAMEL_CASE_MATCH
added while fixing bug 124624.R_CAMELCASE_MATCH is no longer deprecated as, finally,
Camel Case match rule flags are not supposed to be combined with other ones (e.g.
R_PREFIX_MATCH or R_PATTERN_MATCH).
SearchPattern#validateMatchRule(String, int)
has been modified to include the new #R_CAMELCASE_SAME_PART_COUNT_MATCH constant:
/**
* Validate compatibility between given string pattern and match rule.
*
* In certain circumstances described in the table below, the returned match rule is
* modified in order to provide a more efficient search pattern:
* 1. when the {@link #R_REGEXP_MATCH} flag is set, then the pattern is
* rejected as this kind of match is not supported yet and -1
* s returned).
* 2. when the string pattern has no pattern characters (e.g. '*' or '?')
* and the pattern match flag is set (i.e. the match rule has the {@link #R_PATTERN_MATCH}
* flag), then the pattern match flag is reset.
* Reversely, when the string pattern has pattern characters and the pattern
* match flag is not set, then the pattern match flag is set.
* 3. >when the {@link #R_PATTERN_MATCH} flag is set then, other
* {@link #R_PREFIX_MATCH}, {@link #R_CAMELCASE_MATCH} or
* {@link #R_CAMELCASE_SAME_PART_COUNT_MATCH} flags are reset
* if they are tentatively combined.
* 4. when the {@link #R_CAMELCASE_MATCH} flag is set, then other
* {@link #R_PREFIX_MATCH} or {@link #R_CAMELCASE_SAME_PART_COUNT_MATCH}
* flags are reset if they are tentatively combined.
* Reversely, if the string pattern cannot be a camel case pattern (i.e. contains
* invalid Java identifier characters or does not have at least two uppercase
* characters - one for method camel case patterns), then the CamelCase
* match flag is replaced with a prefix match flag.
* 5. when the {@link #R_CAMELCASE_SAME_PART_COUNT_MATCH} flag is set,
* then ({@link #R_PREFIX_MATCH} flag is reset if it's tentatively
* combined.
* Reversely, if the string pattern cannot be a camel case pattern (i.e. contains
* invalid Java identifier characters or does not have at least two uppercase
* characters - one for method camel case patterns), then the CamelCase
* part count match flag is reset.
* Note: the rules are validated in the documented order. For example, it means
* that as soon as the string pattern contains one pattern character, the pattern
* match flag will be set and all other match flags reset: validation of rule 2)
* followed by rule 3)...
*
* @param stringPattern The string pattern
* @param matchRule The match rule
* @return Optimized valid match rule or -1 if an incompatibility was detected.
* @since 3.2
*/
public static int validateMatchRule(String stringPattern, int matchRule) {
...
}
CharOperation and SearchPattern Camel Case API methods
added while fixing bug 124624)
have been modified to clarify the behavior of the additional boolean parameter.
/**
*...
* CamelCase can be restricted to match only the same count of parts. When this
* restriction is specified the given pattern and the given name must have exactly
* the same number of parts (i.e. the same number of uppercase characters).
* For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and
* 'HatMapper' but not 'HashMapEntry'.
*...
* . pattern = "HM".toCharArray()
* name = "HashMapEntry".toCharArray()
* result => (samePartCount == false)
*...
* @param samePartCount flag telling whether the pattern and the name should
* have the same count of parts or not.
* For example:
* . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types,
* but not 'HashMapEntry'
* . 'HMap' type string pattern will still match previous 'HashMap' and
* 'HtmlMapper' types, but not 'HighMagnitude'
* @return true if the pattern matches the given name, false otherwise
* @since 3.4
*/
public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean samePartCount) {
...
}
/**
*...
* CamelCase can be restricted to match only the same count of parts. When this
* restriction is specified the given pattern and the given name must have exactly
* the same number of parts (i.e. the same number of uppercase characters).
* For instance, 'HM' , 'HaMa' and 'HMap' patterns will match 'HashMap' and
* 'HatMapper' but not 'HashMapEntry'.
*...
* . pattern = "HM".toCharArray()
* patternStart = 0
* patternEnd = 2
* name = "HashMapEntry".toCharArray()
* nameStart = 0
* nameEnd = 12
* result => (samePartCount == false)
*...
* @param samePartCount flag telling whether the pattern and the name should
* have the same count of parts or not.
* For example:
* . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types,
* but not 'HashMapEntry'
* . 'HMap' type string pattern will still match previous 'HashMap' and
* 'HtmlMapper' types, but not 'HighMagnitude'
* @return true if a sub-pattern matches the sub-part of the given name, false otherwise
* @since 3.4
*/
public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean prefixMatch) {
...
}
Note that similar modifications have been done on SearchPattern
corresponding methods:
public static final boolean camelCaseMatch(String pattern, String name, boolean samePartCount) {
...
}
public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean samePartCount) {
...
}
CompletionProposal#getRequiredProposals().TYPE_REF proposals can now have a TYPE_REF proposal as required proposal
package p;
public class X {
public static void bar() {}
}
package q;
public class Y {
public void foo() {
X.bar
}
}
When the completion occurs after X.bar the method X#bar() is proposed with a required proposal to complete the not yet imported type.
IJavaElementDelta#F_RESOLVED_CLASSPATH_CHANGED. This flag is set when the resolved classpath of a Java project changes.
This is independent from IJavaElementDelta#F_CLASSPATH_CHANGED which indicates that the raw classpath has changed.SearchPattern#R_CAMELCASE_MATCH constant is no longer deprecated andSearchPattern#R_CAMEL_CASE_MATCH will surely be renamed in next milestone.org.eclipse.jdt.core.JavaCore#VERSION_CLDC_1_1 in order to support the cldc1.1 target inside the IDE.
COMPILER / 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 "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException".
Note: this option has no effect until the doc comment support is enabled
according to the option "org.eclipse.jdt.core.compiler.doc.comment.support".
- option id: "org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocReference"
- possible values: { "enabled", "disabled" }
- default: "enabled"
See bug 73244
for details.
org.eclipse.jdt.core.compiler.CharOperation:
/** * 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 '?' 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 lowercase characters, which will be match in a case * sensitive way. These characters must appear in sequence in the name. * For instance, 'NPExcep' will match 'NullPointerException', but not * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not * 'NoPointerException'. * * Digit characters are treated in a special way. They can be used in the pattern * but are not always considered as leading character. For instance, both * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. * * CamelCase may or may not match prefixes depending on the given parameter. * When the prefix match parameter isNote that same methods have been added ontrue, the given pattern can * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' * patterns will all match 'HashMap', 'HatMapper' and 'HashMapEntry'. * Reversely, if the prefix match parameter isfalse, then pattern * and name must have exactly the same number of parts, and their last * parts must be identical if they contain lowercase characters. * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain * lowercase characters, then the name may end with lowercase characters. * So, 'HM' pattern will match both 'HashMap' and 'HatMapper' but will not * match 'HashMapEntry'. * * Examples: * 1. pattern = { 'N', 'P', 'E' } * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * result => true * 2. pattern = { 'N', 'P', 'E' } * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * result => true * 3. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * result => true * 4. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * result => false * 5. pattern = { 'n', p', 'e' } * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * result => false * 6. pattern = { 'I', 'P', 'L', '3' } * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } * result => true * 7. pattern = { 'H', M' } * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } * result => (prefixMatch == true) * 8. pattern = { 'H', M', 'a', 'p' } * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } * result => (prefixMatch == true) * * @param pattern the given pattern * @param name the given name * @param prefixMatch flag telling whether the pattern can match name prefix or not. * . For example, when it'strue: * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, * but not 'HashMapEntry' * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. * . and, when it'sfalse: * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' * and 'HashMapEntry' * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' * types. * * @return true if the pattern matches the given name, false otherwise * @since 3.4 */ public static final boolean camelCaseMatch(char[] pattern, char[] name, boolean prefixMatch) { ... } /** * Answers true if a sub-pattern matches the sub-part of the given name using * CamelCase rules, or false otherwise. char[] 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 sub-pattern 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 lowercase characters, which will be match in a case * sensitive way. These characters must appear in sequence in the name. * For instance, 'NPExcep' will match 'NullPointerException', but not * 'NullPointerExCEPTION' or 'NuPoEx' will match 'NullPointerException', but not * 'NoPointerException'. * * Digit characters are treated in a special way. They can be used in the pattern * but are not always considered as leading character. For instance, both * 'UTF16DSS' and 'UTFDSS' patterns will match 'UTF16DocumentScannerSupport'. * * CamelCase may or may not match prefixes depending on the given parameter. * When the prefix match parameter istrue, the given pattern can * match only a prefix of the given name. For instance, 'HM' , 'HaMa' and 'HMap' * patterns will all match 'HashMap', 'HatMapper' and 'HashMapEntry'. * Reversely, if the prefix match parameter isfalse, then pattern * and name must have exactly the same number of parts, and their last * parts must be identical if they contain lowercase characters. * For instance, 'HMap' and 'HaMap' patterns will match 'HashMap' but neither * 'HashMapEntry' nor 'HatMapper'. Note that when the last part does not contain * lowercase characters, then the name may end with lowercase characters. * So, 'HM' pattern will match both 'HashMap' and 'HatMapper' but will not * match 'HashMapEntry'. * * Examples: * 1. pattern = { 'N', 'P', 'E' } * patternStart = 0 * patternEnd = 3 * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * nameStart = 0 * nameEnd = 20 * result => true * 2. pattern = { 'N', 'P', 'E' } * patternStart = 0 * patternEnd = 3 * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * nameStart = 0 * nameEnd = 21 * result => true * 3. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } * patternStart = 0 * patternEnd = 6 * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * nameStart = 0 * nameEnd = 20 * result => true * 4. pattern = { 'N', 'u', 'P', 'o', 'E', 'x' } * patternStart = 0 * patternEnd = 6 * name = { 'N', 'o', 'P', 'e', 'r', 'm', 'i', 's', 's', 'i', 'o', 'n', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * nameStart = 0 * nameEnd = 21 * result => false * 5. pattern = { 'n', p', 'e' } * patternStart = 0 * patternEnd = 3 * name = { 'N', 'u','l', 'l', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'E', 'x', 'c', 'e', 'p', 't', 'i', 'o', 'n' } * nameStart = 20 * nameEnd = 9 * result => false * 6. pattern = { 'I', 'P', 'L', '3' } * patternStart = 0 * patternEnd = 4 * name = { 'I', 'P', 'e', 'r', 's', 'p', 'e', 'c', 't', 'i', 'v', 'e', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '3' } * nameStart = 0 * nameEnd = 21 * result => true * 7. pattern = { 'H', M' } * patternStart = 0 * patternEnd = 2 * name = { 'H', 'a', 's', 'h', 'M', 'a', 'p', 'E', 'n', 't', 'r', 'y' } * nameStart = 0 * nameEnd = 12 * result => (prefixMatch == true) * 8. pattern = { 'H', M', 'a', 'p' } * patternStart = 0 * patternEnd = 4 * name = { 'H', 'a', 't', 'M', 'a', 'p', 'p', 'e', 'r' } * nameStart = 0 * nameEnd = 9 * result => (prefixMatch == true) * * @param pattern the given pattern * @param patternStart the start index of the pattern, inclusive * @param patternEnd the end index of the pattern, exclusive * @param name the given name * @param nameStart the start index of the name, inclusive * @param nameEnd the end index of the name, exclusive * @param prefixMatch flag telling whether the pattern can match name prefix or not. * . For example, when it'strue: * - 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types, * but not 'HashMapEntry' * - 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'. * . and, when it'sfalse: * - 'HM' type string pattern will match both 'HashMap' and 'HtmlMapper' * and 'HashMapEntry' * - 'HMap' type string pattern will match both 'HashMap' and 'HtmlMapper' * types. * * @return true if a sub-pattern matches the sub-part of the given name, false otherwise * @since 3.4 */ public static final boolean camelCaseMatch(char[] pattern, int patternStart, int patternEnd, char[] name, int nameStart, int nameEnd, boolean prefixMatch) { ... }
SearchPattern but with
String parameters instead of char[] ones (javadoc comments
are identical):
public static final boolean camelCaseMatch(String pattern, String name, boolean prefixMatch) {
...
}
public static final boolean camelCaseMatch(String pattern, int patternStart, int patternEnd, String name, int nameStart, int nameEnd, boolean prefixMatch) {
...
}
Note also that methods camelCaseMatch(String, int, int, String, int, int)
of CharOperation and SearchPattern classes have been
deprecated to avoid too many 'camelCaseMatch*' methods on these classes.
SearchPattern
constants while using Camel Case one (see bug 200400).SearchPattern#R_CAMELCASE_MATCH constant has been deprecated andSearchPattern#R_CAMEL_CASE_MATCH:
/**
* Match rule: The search pattern contains a Camel Case expression with
* a strict number of parts and preventing automatic prefix matching for the last
* part (if it consists of multiple letters).
*
* Examples:
* . 'HM' type string pattern will match 'HashMap' and 'HtmlMapper' types,
* but not 'HashMapEntry'
* . 'HMap' type string pattern will match 'HashMap' type but not 'HtmlMapper'.
*
* This Camel Case match rule does not allow prefix match but accept insensitive
* case. For instance, 'HashMap' or 'HASHMAP' patterns using this Camel Case
* rule will match both 'HashMap' but not 'HashMapEntry'.
*
* This rule still can be combined to prefix match to accept prefix matches
* ('HashMap' pattern matching 'HashMapEntry' name). It can also be combined
* to case sensitive match to reject case insensitive matches ('HAMA' pattern
* will not match 'HashMap' name).
*
* If {@link #R_PATTERN_MATCH} rule is also combined, then the real used
* match rule will depend 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 with 'N*P*E*' string pattern, it will
* use only Pattern match rule.
*
* @see CharOperation#camelCaseMatch(char[], char[], boolean) for a detailed
* explanation of Camel Case matching.
*
* @since 3.4
*/
public static final int R_CAMEL_CASE_MATCH = 0x0100;
This change was necessary has the obsolete R_CAMELCASE_MATCH could
not support correctly additional constants as R_PREFIX_MATCH or
R_CASE_SENSITIVE.R_CAMEL_CASE_MATCH | R_PREFIX_MATCH
JavaProject.setOption(String, String) behavior has been slightly changed consequent upon following bugs fixing:
null is now accepted for the option value and remove the corresponding preference from the project,org.eclipse.jdt.core.compiler.IProblem.
For earlier build notes, also see build notes up to Release 3.3.