### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v retrieving revision 1.161 diff -u -r1.161 ReconcilerTests.java --- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 1 Nov 2010 14:45:35 -0000 1.161 +++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 6 Nov 2010 17:21:09 -0000 @@ -5184,4 +5184,47 @@ deleteProject(project14); } } +// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329593 +public void testJsr14TargetProjectWith14JRE() throws CoreException, IOException { + IJavaProject project14 = null; + try { + project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin"); + project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); + project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); + project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4); + + createFolder("/Reconciler1415/src/p1"); + String source = + "package p1;\n" + + "public class X {\n" + + " public void foo() {\n" + + " Class type = null;\n" + + " if (type == byte.class)\n" + + " return;\n" + + " }\n" + + "}\n"; + createFile( + "/Reconciler1415/src/p1/X.java", + source + ); + + this.workingCopies = new ICompilationUnit[1]; + char[] sourceChars = source.toCharArray(); + this.problemRequestor.initialize(sourceChars); + this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null); + assertProblems( + "Unexpected problems", + "----------\n" + + "1. WARNING in /Reconciler1415/src/p1/X.java (at line 6)\n" + + " return;\n" + + " ^^^^^^^\n" + + "Dead code\n" + + "----------\n" + + ); + } finally { + if (project14 != null) + deleteProject(project14); + } +} }