    1   package test.net.sourceforge.pmd.ast;
    2
    3   import net.sourceforge.pmd.PMD;
    4   import net.sourceforge.pmd.TargetJDK1_4;
    5   import test.net.sourceforge.pmd.testframework.ParserTst;
    6
    7   import java.io.StringReader;
    8
    9   public class ParserCornersTest extends ParserTst {
    10
    11      public final void testGetFirstASTNameImageNull() throws Throwable {
    12          new TargetJDK1_4().createParser(new StringReader(ABSTRACT_METHOD_LEVEL_CLASS_DECL)).CompilationUnit();
    13      }
    14
    15      private static final String ABSTRACT_METHOD_LEVEL_CLASS_DECL =
    16              "public class Test {" + PMD.EOL +
    17              "  void bar() {" + PMD.EOL +
    18              "   abstract class X { public abstract void f(); }" + PMD.EOL +
    19              "   class Y extends X { public void f() {" + PMD.EOL +
    20              "    new Y().f();" + PMD.EOL +
    21              "   }}" + PMD.EOL +
    22              "  }" + PMD.EOL +
    23              "}";
    24
    25  }