### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.core
Index: search/org/eclipse/jdt/core/search/SearchPattern.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java,v
retrieving revision 1.74
diff -u -r1.74 SearchPattern.java
--- search/org/eclipse/jdt/core/search/SearchPattern.java 28 Nov 2007 08:04:11 -0000 1.74
+++ search/org/eclipse/jdt/core/search/SearchPattern.java 25 Jan 2008 17:13:07 -0000
@@ -746,11 +746,6 @@
return new AndPattern(leftPattern, rightPattern);
}
-/**
- * Field pattern are formed by [declaringType.]name[ type]
- * e.g. java.lang.String.serialVersionUID long
- * field*
- */
private static SearchPattern createFieldPattern(String patternString, int limitTo, int matchRule) {
Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
@@ -867,24 +862,6 @@
matchRule);
}
-/**
- * Method pattern are formed by:
- * [declaringType '.'] ['<' typeArguments '>'] selector ['(' parameterTypes ')'] [returnType]
- *
e.g.
- * - java.lang.Runnable.run() void
- * - main(*)
- * - <String>toArray(String[])
- *
- * Constructor pattern are formed by:
- * [declaringQualification '.'] ['<' typeArguments '>'] type ['(' parameterTypes ')']
- *
e.g.
- * - java.lang.Object()
- * - Main(*)
- * - <Exception>Sample(Exception)
- *
- * Type arguments have the same pattern that for type patterns
- * @see #createTypePattern(String,int,int,char)
- */
private static SearchPattern createMethodOrConstructorPattern(String patternString, int limitTo, int matchRule, boolean isConstructor) {
Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);
@@ -918,7 +895,6 @@
case TerminalTokens.TokenNameLESS:
argCount++;
if (selector == null || lastToken == TerminalTokens.TokenNameDOT) {
- if (typeArgumentsString != null) return null; // invalid syntax
typeArgumentsString = scanner.getCurrentTokenString();
mode = InsideTypeArguments;
break;
@@ -932,7 +908,7 @@
selector = null;
break;
case TerminalTokens.TokenNameDOT:
- if (typeArgumentsString != null) return null; // invalid syntax
+ if (!isConstructor && typeArgumentsString != null) return null; // invalid syntax
if (declaringType == null) {
if (selector == null) return null; // invalid syntax
declaringType = selector;
@@ -1295,6 +1271,63 @@
* createSearchPattern("java.lang.Runnable", TYPE, IMPLEMENTORS, true);
*
* @param stringPattern the given pattern
+ *
+ * - Type pattern can have the following syntax:
+ *
[qualification '.']type ['<' typeArguments '>']
+ * Some samples:
+ *
+ * - java.lang.Object
+ * - Runnable
+ * - List<String>
+ *
+ *
+ *
+ * Type arguments can be specified to search references to parameterized types
+ * using following syntax:
+ * '<' { [ '?' {'extends'|'super'} ] type ( ',' [ '?' {'extends'|'super'} ] type )* | '?' } '>'
+ *
+ * Note that:
+ *
+ * - '*' is not valid inside type arguments definition <>
+ * - '?' is treated as a wildcard when it is inside <> (i.e. it must be put on first position of the type argument)
+ *
+ *
+ *
+ * - Method pattern can have the following syntax:
+ *
[declaringType '.'] ['<' typeArguments '>'] selector ['(' parameterTypes ')'] [returnType]
+ * Type arguments have the same pattern that for type patterns
+ * Some samples:
+ *
+ * - java.lang.Runnable.run() void
+ * - main(*)
+ * - <String>toArray(String[])
+ *
+ *
+ *
+ *
+ * - Constructor pattern can have the following syntax:
+ *
['<' typeArguments '>'] [declaringQualification '.'] type ['(' parameterTypes ')']
+ * Type arguments have the same pattern that for type patterns
+ * Some samples:
+ *
+ * - java.lang.Object()
+ * - Test(*)
+ * - <Exception>Sample(Exception)
+ *
+ *
+ *
+ *
+ * - Field pattern can have the following syntax:
+ *
[declaringType.]name[ type]
+ * Some samples:
+ *
+ * - java.lang.String.serialVersionUID long
+ * - field*
+ *
+ *
+ *
+ *
+ *
* @param searchFor determines the nature of the searched elements
*
* - {@link IJavaSearchConstants#CLASS}: only look for classes
@@ -1808,19 +1841,7 @@
}
return null;
}
-/**
- * Type pattern are formed by [qualification '.']type [typeArguments].
- * e.g. java.lang.Object
- * Runnable
- * List<String>
- *
- * @since 3.1
- * Type arguments can be specified to search references to parameterized types.
- * and look as follow: '<' { [ '?' {'extends'|'super'} ] type ( ',' [ '?' {'extends'|'super'} ] type )* | '?' } '>'
- * Please note that:
- * - '*' is not valid inside type arguments definition <>
- * - '?' is treated as a wildcard when it is inside <> (i.e. it must be put on first position of the type argument)
- */
+
private static SearchPattern createTypePattern(String patternString, int limitTo, int matchRule, char indexSuffix) {
Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/);