Lines 11297-11300
Link Here
|
11297 |
this.runConformTest(testFiles, ""); |
11297 |
this.runConformTest(testFiles, ""); |
11298 |
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p/package-info.class", "", "HELLO"); |
11298 |
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "p/package-info.class", "", "HELLO"); |
11299 |
} |
11299 |
} |
|
|
11300 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=456960 |
11301 |
public void test456960() throws Exception { |
11302 |
if (this.complianceLevel < ClassFileConstants.JDK1_5) { |
11303 |
return; |
11304 |
} |
11305 |
Map options = getCompilerOptions(); |
11306 |
options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); |
11307 |
options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); |
11308 |
options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); |
11309 |
this.runNegativeTest( |
11310 |
new String[] { |
11311 |
"X.java", |
11312 |
"@Bar(String)\n" + |
11313 |
"public class X {\n" + |
11314 |
"}", |
11315 |
"Bar.java", |
11316 |
"import java.lang.annotation.Retention;\n" + |
11317 |
"import java.lang.annotation.RetentionPolicy;\n" + |
11318 |
"@Retention(RetentionPolicy.RUNTIME)\n" + |
11319 |
"@interface Bar {\n" + |
11320 |
" Class<?>[] value();\n" + |
11321 |
"}" |
11322 |
}, |
11323 |
"----------\n" + |
11324 |
"1. ERROR in X.java (at line 1)\n" + |
11325 |
" @Bar(String)\n" + |
11326 |
" ^^^^^^\n" + |
11327 |
"String cannot be resolved to a variable\n" + |
11328 |
"----------\n", |
11329 |
null, |
11330 |
true, |
11331 |
null, |
11332 |
true, // generate output |
11333 |
false, |
11334 |
false); |
11335 |
|
11336 |
String expectedOutput = |
11337 |
"public class X {\n" + |
11338 |
" \n" + |
11339 |
" // Method descriptor #6 ()V\n" + |
11340 |
" // Stack: 3, Locals: 1\n" + |
11341 |
" public X();\n" + |
11342 |
" 0 new java.lang.Error [8]\n" + |
11343 |
" 3 dup\n" + |
11344 |
" 4 ldc <String \"Unresolved compilation problem: \\n\\tString cannot be resolved to a variable\\n\"> [10]\n" + |
11345 |
" 6 invokespecial java.lang.Error(java.lang.String) [12]\n" + |
11346 |
" 9 athrow\n" + |
11347 |
" Line numbers:\n" + |
11348 |
" [pc: 0, line: 1]\n" + |
11349 |
" Local variable table:\n" + |
11350 |
" [pc: 0, pc: 10] local: this index: 0 type: X\n" + |
11351 |
"}"; |
11352 |
try { |
11353 |
checkDisassembledClassFile(OUTPUT_DIR + File.separator +"X.class", "X", expectedOutput, ClassFileBytesDisassembler.DETAILED); |
11354 |
} catch(org.eclipse.jdt.core.util.ClassFormatException cfe) { |
11355 |
fail("Error reading classfile"); |
11356 |
} |
11357 |
} |
11300 |
} |
11358 |
} |