### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java,v retrieving revision 1.56 diff -u -r1.56 ClasspathDirectory.java --- batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java 7 Jan 2010 20:18:49 -0000 1.56 +++ batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java 12 Aug 2010 03:03:19 -0000 @@ -115,6 +115,13 @@ if (binaryExists) { try { ClassFileReader reader = ClassFileReader.read(this.path + qualifiedBinaryFileName); + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115, package names are to be treated case sensitive. + String typeSearched = qualifiedPackageName.length() > 0 ? + qualifiedPackageName.replace(File.separatorChar, '/') + "/" + fileName //$NON-NLS-1$ + : fileName; + if (!CharOperation.equals(reader.getName(), typeSearched.toCharArray())) { + reader = null; + } if (reader != null) return new NameEnvironmentAnswer( reader, #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.208 diff -u -r1.208 BatchCompilerTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 1 Jun 2010 15:23:24 -0000 1.208 +++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 12 Aug 2010 03:05:46 -0000 @@ -3109,6 +3109,7 @@ this.runConformTest( new String[] { "p/Y.java", + "package p;\n" + "public class Y { public static final String S = \"\"; }", }, "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Y.java\"" @@ -11410,4 +11411,358 @@ "", true); } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "p/Y.java", + "package p;\n" + + "public class Y { public class I {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runConformTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307a(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "P/Y.java", + "package P;\n" + + "public class Y { public class I {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "P" + File.separator + "Y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runNegativeTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n" + + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" + + " import p.Y.I;\n" + + " ^^^\n" + + "The import p.Y cannot be resolved\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I i;\n" + + " ^\n" + + "I cannot be resolved to a type\n" + + "----------\n" + + "2 problems (2 errors)", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307b(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "p/y.java", + "package p;\n" + + "public class y { public class I {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runNegativeTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n" + + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" + + " import p.Y.I;\n" + + " ^^^\n" + + "The import p.Y cannot be resolved\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I i;\n" + + " ^\n" + + "I cannot be resolved to a type\n" + + "----------\n" + + "2 problems (2 errors)", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307c(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "p/Y.java", + "package p;\n" + + "public class Y { public class i {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runNegativeTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n" + + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" + + " import p.Y.I;\n" + + " ^^^^^\n" + + "The import p.Y.I cannot be resolved\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I i;\n" + + " ^\n" + + "I cannot be resolved to a type\n" + + "----------\n" + + "2 problems (2 errors)", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307d(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "p/Y.java", + "package P;\n" + + "public class Y { public class I {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "p" + File.separator + "Y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runNegativeTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n" + + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" + + " import p.Y.I;\n" + + " ^^^\n" + + "The import p.Y cannot be resolved\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I i;\n" + + " ^\n" + + "I cannot be resolved to a type\n" + + "----------\n" + + "2 problems (2 errors)", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115 +public void test0307e(){ + final String javaClassspath = System.getProperty("java.class.path"); + final String javaUserDir = System.getProperty("user.dir"); + try { + System.setProperty("user.dir", OUTPUT_DIR); + this.runConformTest( + new String[] { + "p/Y.java", + "package P;\n" + + "public class Y { public class I {}; }", + }, + "\"" + OUTPUT_DIR + File.separator + "P" + File.separator + "Y.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "", + "", + true); + System.setProperty("java.class.path", ""); + this.runNegativeTest( + new String[] { + "X.java", + "import p.Y.I;\n" + + "public class X {\n" + + " I i;\n" + + " public static void main(String[] args) {\n" + + " System.out.print(\"\");\n" + + " }\n" + + "}", + }, + "\"" + OUTPUT_DIR + File.separator + "X.java\"" + + " -1.5 -g -preserveAllLocals -proceedOnError -referenceInfo ", + "",// this is not the runtime output + "no classpath defined, using default directory instead\n" + + "----------\n" + + "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 1)\n" + + " import p.Y.I;\n" + + " ^^^\n" + + "The import p.Y cannot be resolved\n" + + "----------\n" + + "2. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" + + " I i;\n" + + " ^\n" + + "I cannot be resolved to a type\n" + + "----------\n" + + "2 problems (2 errors)", + false); + final String userDir = System.getProperty("user.dir"); + File f = new File(userDir, "X.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete X"); + } + f = new File(userDir, "p" + File.separator + "Y.java"); + if (!Util.delete(f)) { + System.out.println("Could not delete Y"); + } + + } finally { + System.setProperty("java.class.path", javaClassspath); + System.setProperty("user.dir", javaUserDir); + } +} }