Lines 5184-5187
Link Here
|
5184 |
deleteProject(project14); |
5184 |
deleteProject(project14); |
5185 |
} |
5185 |
} |
5186 |
} |
5186 |
} |
|
|
5187 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329593 |
5188 |
public void testJsr14TargetProjectWith14JRE() throws CoreException, IOException { |
5189 |
IJavaProject project14 = null; |
5190 |
try { |
5191 |
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL_LIB"}, "bin"); |
5192 |
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); |
5193 |
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); |
5194 |
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4); |
5195 |
|
5196 |
createFolder("/Reconciler1415/src/p1"); |
5197 |
String source = |
5198 |
"package p1;\n" + |
5199 |
"public class X {\n" + |
5200 |
" public void foo() {\n" + |
5201 |
" Class type = null;\n" + |
5202 |
" if (type == byte.class)\n" + |
5203 |
" return;\n" + |
5204 |
" }\n" + |
5205 |
"}\n"; |
5206 |
createFile( |
5207 |
"/Reconciler1415/src/p1/X.java", |
5208 |
source |
5209 |
); |
5210 |
|
5211 |
this.workingCopies = new ICompilationUnit[1]; |
5212 |
char[] sourceChars = source.toCharArray(); |
5213 |
this.problemRequestor.initialize(sourceChars); |
5214 |
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null); |
5215 |
assertProblems( |
5216 |
"Unexpected problems", |
5217 |
"----------\n" + |
5218 |
"1. WARNING in /Reconciler1415/src/p1/X.java (at line 6)\n" + |
5219 |
" return;\n" + |
5220 |
" ^^^^^^^\n" + |
5221 |
"Dead code\n" + |
5222 |
"----------\n" |
5223 |
|
5224 |
); |
5225 |
} finally { |
5226 |
if (project14 != null) |
5227 |
deleteProject(project14); |
5228 |
} |
5229 |
} |
5187 |
} |
5230 |
} |