Lines 5145-5148
Link Here
|
5145 |
deleteProject(project15); |
5145 |
deleteProject(project15); |
5146 |
} |
5146 |
} |
5147 |
} |
5147 |
} |
|
|
5148 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=328775 |
5149 |
public void test14ProjectWith15JRE() throws CoreException, IOException { |
5150 |
IJavaProject project14 = null; |
5151 |
try { |
5152 |
project14 = createJavaProject("Reconciler1415", new String[] {"src"}, new String[] {"JCL15_LIB"}, "bin"); |
5153 |
project14.setOption(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_4); |
5154 |
project14.setOption(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_4); |
5155 |
project14.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_4); |
5156 |
|
5157 |
createFolder("/Reconciler1415/src/p1"); |
5158 |
String source = |
5159 |
"package p1;\n" + |
5160 |
"public class X {\n" + |
5161 |
" int a;\n" + |
5162 |
" private Class c = a == 1 ? int.class : long.class;\n" + |
5163 |
"}\n"; |
5164 |
createFile( |
5165 |
"/Reconciler1415/src/p1/X.java", |
5166 |
source |
5167 |
); |
5168 |
|
5169 |
this.workingCopies = new ICompilationUnit[1]; |
5170 |
char[] sourceChars = source.toCharArray(); |
5171 |
this.problemRequestor.initialize(sourceChars); |
5172 |
this.workingCopies[0] = getCompilationUnit("/Reconciler1415/src/p1/X.java").getWorkingCopy(this.wcOwner, null); |
5173 |
assertProblems( |
5174 |
"Unexpected problems", |
5175 |
"----------\n" + |
5176 |
"1. WARNING in /Reconciler1415/src/p1/X.java (at line 4)\n" + |
5177 |
" private Class c = a == 1 ? int.class : long.class;\n" + |
5178 |
" ^\n" + |
5179 |
"The value of the field X.c is not used\n" + |
5180 |
"----------\n" |
5181 |
); |
5182 |
} finally { |
5183 |
if (project14 != null) |
5184 |
deleteProject(project14); |
5185 |
} |
5186 |
} |
5148 |
} |
5187 |
} |