### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java,v retrieving revision 1.18 diff -u -r1.18 ParserTest.java --- src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 5 Sep 2006 18:35:08 -0000 1.18 +++ src/org/eclipse/jdt/core/tests/compiler/parser/ParserTest.java 20 Oct 2006 02:10:22 -0000 @@ -623,4 +623,83 @@ options // custom options ); } +/* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=160337 + */ +public void test025() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " static class Y {\n" + + " public void foo(int i) {}\n" + + " }\n" + + " static Y FakeInvocationSite = new Y(){\n" + + " public void foo(int i) {}\n" + + " };\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " public void foo(int i) {}\n" + + " ^^\n" + + "Empty block should be documented\n" + + "----------\n" + + "2. ERROR in X.java (at line 6)\n" + + " public void foo(int i) {}\n" + + " ^^\n" + + "Empty block should be documented\n" + + "----------\n", + null, // custom classpath + true, // flush previous output dir content + options // custom options + ); +} +/* + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=160337 + */ +public void test026() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, CompilerOptions.ERROR); + this.runNegativeTest( + new String[] { + "X.java", + "public class X {\n" + + " static class Y {\n" + + " public void foo(int i) {}\n" + + " }\n" + + " static Y FakeInvocationSite = new Y(){\n" + + " public void foo(int i) {\n" + + " class A {\n" + + " A() {}\n" + + " public void bar() {}\n" + + " }\n" + + " new A().bar();\n" + + " }\n" + + " };\n" + + "}" + }, + "----------\n" + + "1. ERROR in X.java (at line 3)\n" + + " public void foo(int i) {}\n" + + " ^^\n" + + "Empty block should be documented\n" + + "----------\n" + + "2. ERROR in X.java (at line 8)\n" + + " A() {}\n" + + " ^^\n" + + "Empty block should be documented\n" + + "----------\n" + + "3. ERROR in X.java (at line 9)\n" + + " public void bar() {}\n" + + " ^^\n" + + "Empty block should be documented\n" + + "----------\n", + null, // custom classpath + true, // flush previous output dir content + options // custom options + ); +} }