Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 57641 Details for
Bug 161996
[compiler][batch][options] ecj can't cope with [] brackets in classpath names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fixed small problem in unit test
eclipse-square-bracket-classpath-fix-with-test-3.2.1.patch (text/plain), 7.15 KB, created by
Ben Konrath
on 2007-01-27 00:59:17 EST
(
hide
)
Description:
fixed small problem in unit test
Filename:
MIME Type:
Creator:
Ben Konrath
Created:
2007-01-27 00:59:17 EST
Size:
7.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.60.2.1 >diff -u -r1.60.2.1 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 2 Jul 2006 10:15:22 -0000 1.60.2.1 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 27 Jan 2007 05:57:09 -0000 >@@ -3039,6 +3039,23 @@ > "/out/p cannot be used as output directory\n", > true); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=161996 >+public void test057(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "/** */\n" + >+ "public class X {\n" + >+ "}", >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" >+ + " -cp " + "\"" + OUTPUT_DIR + File.separator + "[square][bracket].jar" + "\"" >+ + " -d \"" + OUTPUT_DIR + "\"", >+ "", >+ "", >+ true); >+} >+ > public static Class testClass() { > return BatchCompilerTest.class; > } >#P org.eclipse.jdt.core >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 >retrieving revision 1.254.4.1 >diff -u -r1.254.4.1 Main.java >--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 2 Jul 2006 10:11:58 -0000 1.254.4.1 >+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 27 Jan 2007 05:57:12 -0000 >@@ -28,9 +28,11 @@ > import java.text.MessageFormat; > import java.util.ArrayList; > import java.util.Arrays; >+import java.util.Collections; > import java.util.Date; > import java.util.HashMap; > import java.util.Iterator; >+import java.util.LinkedList; > import java.util.Locale; > import java.util.Map; > import java.util.MissingResourceException; >@@ -40,8 +42,8 @@ > > import org.eclipse.jdt.core.compiler.CategorizedProblem; > import org.eclipse.jdt.core.compiler.CharOperation; >-import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.core.compiler.IProblem; >+import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.internal.compiler.ClassFile; > import org.eclipse.jdt.internal.compiler.CompilationResult; > import org.eclipse.jdt.internal.compiler.Compiler; >@@ -59,9 +61,9 @@ > import org.eclipse.jdt.internal.compiler.problem.DefaultProblem; > import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; > import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; >+import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; > import org.eclipse.jdt.internal.compiler.util.Messages; > import org.eclipse.jdt.internal.compiler.util.SuffixConstants; >-import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; > import org.eclipse.jdt.internal.compiler.util.Util; > > public class Main implements ProblemSeverities, SuffixConstants { >@@ -2989,56 +2991,74 @@ > ArrayList currentRuleSpecs = new ArrayList(defaultSize); > StringTokenizer tokenizer = new StringTokenizer(currentPath, > File.pathSeparator + "[]", true); //$NON-NLS-1$ >+ LinkedList list = new LinkedList(Collections.list(tokenizer)); >+ > // state machine >- final int start = 0; >- final int readyToClose = 1; >- // 'path' 'path1[rule];path2' >- final int readyToCloseEndingWithRules = 2; >- // 'path[rule]' 'path1;path2[rule]' >- final int readyToCloseOrOtherEntry = 3; >- // 'path[rule];' 'path;' 'path1;path2;' >- final int rulesNeedAnotherRule = 4; >- // 'path[rule1;' >- final int rulesStart = 5; >- // 'path[' 'path1;path2[' >- final int rulesReadyToClose = 6; >- // 'path[rule' 'path[rule1;rule2' >+ // process list in reverse order, start refers to end of list >+ final int start = 0; >+ final int rulesStart = 1; >+ // ']' '];path' >+ final int rulesReadyToCloseOrOtherRule = 2; >+ // 'rule]' 'rule1;rule2]' >+ final int rulesNeedAnotherRule = 3; >+ // ';rule2]' ';rule2;rule3];path' >+ final int readyForPath = 4; >+ // '[rule]' '[rule1;rule2]' >+ final int readyToCloseOrOtherEntry = 5; >+ // 'path[rule]' 'path' 'path1;path2' >+ final int readyForPathOrRules = 6; >+ // ';path[rule]' ';path' > final int error = 99; > int state = start; >+ > String token = null; >- while (tokenizer.hasMoreTokens()) { >- token = tokenizer.nextToken(); >+ while (!list.isEmpty()) { >+ token = (String)list.removeLast(); > if (token.equals(File.pathSeparator)) { > switch (state) { > case start: > break; >- case readyToClose: >- case readyToCloseEndingWithRules: > case readyToCloseOrOtherEntry: >- state = readyToCloseOrOtherEntry; >+ Collections.reverse(currentRuleSpecs); > addNewEntry(paths, currentClasspathName, currentRuleSpecs, customEncoding, isSourceOnly); > currentRuleSpecs.clear(); >+ state = readyForPathOrRules; > break; >- case rulesReadyToClose: >+ case rulesReadyToCloseOrOtherRule: > state = rulesNeedAnotherRule; > break; >+ case rulesNeedAnotherRule: >+ break; >+ case readyForPathOrRules: >+ break; > default: > state = error; > } > } else if (token.equals("[")) { //$NON-NLS-1$ > switch (state) { >- case readyToClose: >- state = rulesStart; >+ case start: >+ case readyForPath: >+ case readyForPathOrRules: >+ currentClasspathName = getPath(list, token); >+ state = readyToCloseOrOtherEntry; > break; >- default: >+ case rulesReadyToCloseOrOtherRule: >+ state = readyForPath; >+ break; >+ default: > state = error; > } > } else if (token.equals("]")) { //$NON-NLS-1$ > switch (state) { >- case rulesReadyToClose: >- state = readyToCloseEndingWithRules; >+ case start: >+ case readyForPathOrRules: >+ state = rulesStart; > break; >- default: >+ case readyForPath: >+ currentClasspathName = getPath(list, token); >+ state = readyToCloseOrOtherEntry; >+ break; >+ default: > state = error; > } > >@@ -3046,24 +3066,26 @@ > // regular word > switch (state) { > case start: >- case readyToCloseOrOtherEntry: >- state = readyToClose; >- currentClasspathName = token; >+ case readyForPath: >+ case readyForPathOrRules: >+ currentClasspathName = getPath(list, token); >+ state = readyToCloseOrOtherEntry; > break; >- case rulesNeedAnotherRule: > case rulesStart: >- state = rulesReadyToClose; >+ case rulesNeedAnotherRule: > currentRuleSpecs.add(token); >+ state = rulesReadyToCloseOrOtherRule; > break; > default: > state = error; > } > } > } >+ > switch(state) { >- case readyToClose : >- case readyToCloseEndingWithRules : >- case readyToCloseOrOtherEntry : >+ case readyForPathOrRules: >+ case readyToCloseOrOtherEntry: >+ Collections.reverse(currentRuleSpecs); > addNewEntry(paths, currentClasspathName, currentRuleSpecs, customEncoding, isSourceOnly); > break; > default : >@@ -3071,4 +3093,13 @@ > this.logger.logIncorrectClasspath(currentPath); > } > } >+ >+private String getPath(LinkedList list, String path) { >+ while (!list.isEmpty()) { >+ if (File.pathSeparator.equalsIgnoreCase((String)list.getLast())) >+ break; >+ path = (String)list.removeLast() + path; >+ } >+ return path; >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 161996
:
52549
|
52550
|
57640
| 57641 |
57669
|
57670
|
57722
|
57723
|
58003