2006-10-29 01:58:05 +00:00
|
|
|
Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java
|
|
|
|
===================================================================
|
|
|
|
RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v
|
2007-02-21 18:52:39 +00:00
|
|
|
retrieving revision 1.254.4.2
|
|
|
|
diff -u -r1.254.4.2 Main.java
|
|
|
|
--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 20 Oct 2006 14:11:48 -0000 1.254.4.2
|
|
|
|
+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 16 Feb 2007 18:40:23 -0000
|
|
|
|
@@ -2723,6 +2723,10 @@
|
2006-10-29 01:58:05 +00:00
|
|
|
ArrayList currentRuleSpecs = new ArrayList(defaultSize);
|
|
|
|
StringTokenizer tokenizer = new StringTokenizer(currentPath,
|
|
|
|
File.pathSeparator + "[]", true); //$NON-NLS-1$
|
2007-02-01 21:13:34 +00:00
|
|
|
+ ArrayList tokens = new ArrayList();
|
|
|
|
+ while (tokenizer.hasMoreTokens()) {
|
|
|
|
+ tokens.add(tokenizer.nextToken());
|
|
|
|
+ }
|
2006-10-29 01:58:05 +00:00
|
|
|
// state machine
|
2007-02-01 21:13:34 +00:00
|
|
|
final int start = 0;
|
|
|
|
final int readyToClose = 1;
|
2007-02-21 18:52:39 +00:00
|
|
|
@@ -2737,14 +2741,20 @@
|
2007-02-01 21:13:34 +00:00
|
|
|
// 'path[' 'path1;path2['
|
|
|
|
final int rulesReadyToClose = 6;
|
|
|
|
// 'path[rule' 'path[rule1;rule2'
|
|
|
|
+ final int bracketOpened = 7;
|
|
|
|
+ // '.*[.*'
|
|
|
|
+ final int bracketClosed = 8;
|
|
|
|
+ // '.*([.*])+'
|
2006-10-29 01:58:05 +00:00
|
|
|
final int error = 99;
|
|
|
|
int state = start;
|
|
|
|
String token = null;
|
2007-02-21 18:52:39 +00:00
|
|
|
- while (tokenizer.hasMoreTokens() && state != error) {
|
2006-10-29 01:58:05 +00:00
|
|
|
- token = tokenizer.nextToken();
|
2007-02-21 18:52:39 +00:00
|
|
|
+ int cursor = 0, tokensNb = tokens.size(), bracket = -1;
|
|
|
|
+ while (cursor < tokensNb && state != error) {
|
|
|
|
+ token = (String) tokens.get(cursor++);
|
2006-10-29 01:58:05 +00:00
|
|
|
if (token.equals(File.pathSeparator)) {
|
|
|
|
switch (state) {
|
|
|
|
case start:
|
2007-02-21 18:52:39 +00:00
|
|
|
+ case bracketOpened:
|
2006-10-29 01:58:05 +00:00
|
|
|
break;
|
2007-02-01 21:13:34 +00:00
|
|
|
case readyToClose:
|
|
|
|
case readyToCloseEndingWithRules:
|
2007-02-21 18:52:39 +00:00
|
|
|
@@ -2757,14 +2767,21 @@
|
2007-02-01 21:13:34 +00:00
|
|
|
case rulesReadyToClose:
|
2006-10-29 01:58:05 +00:00
|
|
|
state = rulesNeedAnotherRule;
|
|
|
|
break;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ case bracketClosed:
|
|
|
|
+ cursor = bracket + 1;
|
|
|
|
+ state = rulesStart;
|
2006-10-29 01:58:05 +00:00
|
|
|
+ break;
|
|
|
|
default:
|
|
|
|
state = error;
|
|
|
|
}
|
|
|
|
} else if (token.equals("[")) { //$NON-NLS-1$
|
|
|
|
switch (state) {
|
2007-02-01 21:13:34 +00:00
|
|
|
case readyToClose:
|
2006-10-29 01:58:05 +00:00
|
|
|
- state = rulesStart;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ bracket = cursor - 1;
|
|
|
|
+ case bracketClosed:
|
|
|
|
+ state = bracketOpened;
|
2006-10-29 01:58:05 +00:00
|
|
|
break;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ case bracketOpened:
|
|
|
|
default:
|
2006-10-29 01:58:05 +00:00
|
|
|
state = error;
|
|
|
|
}
|
2007-02-21 18:52:39 +00:00
|
|
|
@@ -2773,6 +2790,10 @@
|
2007-02-01 21:13:34 +00:00
|
|
|
case rulesReadyToClose:
|
|
|
|
state = readyToCloseEndingWithRules;
|
2006-10-29 01:58:05 +00:00
|
|
|
break;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ case bracketOpened:
|
|
|
|
+ state = bracketClosed;
|
2006-10-29 01:58:05 +00:00
|
|
|
+ break;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ case bracketClosed:
|
|
|
|
default:
|
2006-10-29 01:58:05 +00:00
|
|
|
state = error;
|
|
|
|
}
|
2007-02-21 18:52:39 +00:00
|
|
|
@@ -2789,10 +2810,22 @@
|
2007-02-01 21:13:34 +00:00
|
|
|
state = rulesReadyToClose;
|
2006-10-29 01:58:05 +00:00
|
|
|
currentRuleSpecs.add(token);
|
|
|
|
break;
|
2007-02-21 18:52:39 +00:00
|
|
|
+ case bracketClosed:
|
|
|
|
+ for (int i = bracket; i < cursor ; i++) {
|
|
|
|
+ currentClasspathName += (String) tokens.get(i);
|
|
|
|
+ }
|
|
|
|
+ state = readyToClose;
|
|
|
|
+ break;
|
2007-02-01 21:13:34 +00:00
|
|
|
+ case bracketOpened:
|
2007-02-21 18:52:39 +00:00
|
|
|
+ break;
|
2006-10-29 01:58:05 +00:00
|
|
|
default:
|
|
|
|
state = error;
|
|
|
|
}
|
|
|
|
}
|
2007-02-01 21:13:34 +00:00
|
|
|
+ if (state == bracketClosed && cursor == tokensNb) {
|
|
|
|
+ cursor = bracket + 1;
|
|
|
|
+ state = rulesStart;
|
|
|
|
+ }
|
2006-10-29 01:58:05 +00:00
|
|
|
}
|
|
|
|
switch(state) {
|
2007-02-21 18:52:39 +00:00
|
|
|
case readyToClose:
|
|
|
|
@@ -2801,6 +2834,8 @@
|
|
|
|
addNewEntry(paths, currentClasspathName, currentRuleSpecs,
|
|
|
|
customEncoding, isSourceOnly);
|
2006-10-29 01:58:05 +00:00
|
|
|
break;
|
2007-02-21 18:52:39 +00:00
|
|
|
+ case bracketOpened:
|
|
|
|
+ case bracketClosed:
|
2006-10-29 01:58:05 +00:00
|
|
|
default :
|
2007-02-01 21:13:34 +00:00
|
|
|
// we go on anyway
|
2006-10-29 01:58:05 +00:00
|
|
|
this.logger.logIncorrectClasspath(currentPath);
|