253 assertDeclareWarn1("final interface C extends A { }", |
253 assertDeclareWarn1("final interface C extends A { }", |
254 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 5, 0, -1, -1, Diagnostic.Kind.WARNING)); |
254 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 5, 0, -1, -1, Diagnostic.Kind.WARNING)); |
255 assertActiveKeys(); |
255 assertActiveKeys(); |
256 } |
256 } |
257 |
257 |
|
258 public void classesIgnoredModifiersAnnotation() { |
|
259 assertEval("public @interface X { }"); |
|
260 assertEval("@X public interface A { }"); |
|
261 assertDeclareWarn1("@X static class B implements A { }", |
|
262 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 9, 0, -1, -1, Diagnostic.Kind.WARNING)); |
|
263 assertDeclareWarn1("@X final interface C extends A { }", |
|
264 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 8, 0, -1, -1, Diagnostic.Kind.WARNING)); |
|
265 assertActiveKeys(); |
|
266 } |
|
267 |
|
268 public void classesIgnoredModifiersOtherModifiers() { |
|
269 assertEval("strictfp public interface A { }"); |
|
270 assertDeclareWarn1("strictfp static class B implements A { }", |
|
271 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 15, 0, -1, -1, Diagnostic.Kind.WARNING)); |
|
272 assertDeclareWarn1("strictfp final interface C extends A { }", |
|
273 new ExpectedDiagnostic("jdk.eval.warn.illegal.modifiers", 0, 14, 0, -1, -1, Diagnostic.Kind.WARNING)); |
|
274 assertActiveKeys(); |
|
275 } |
|
276 |
258 public void ignoreModifierSpaceIssue() { |
277 public void ignoreModifierSpaceIssue() { |
259 assertEval("interface I { void f(); } "); |
278 assertEval("interface I { void f(); } "); |
260 // there should not be a space between 'I' and '{' to reproduce the failure |
279 // there should not be a space between 'I' and '{' to reproduce the failure |
261 assertEval("class C implements I{ public void f() {}}"); |
280 assertEval("class C implements I{ public void f() {}}"); |
262 assertClasses(clazz(KullaTesting.ClassType.CLASS, "C"), clazz(KullaTesting.ClassType.INTERFACE, "I")); |
281 assertClasses(clazz(KullaTesting.ClassType.CLASS, "C"), clazz(KullaTesting.ClassType.INTERFACE, "I")); |