diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases.java b/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases.java index 95efea6edb..c2b29cb509 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases.java +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/ast/ParserCornerCases.java @@ -194,4 +194,28 @@ class SuperTest { } throw new UnsupportedOperationException(); } -} \ No newline at end of file +} + +/* + * Test case for #1310 PMD cannot parse int.class + */ +class ClazzPropertyOfPrimitiveTypes { + public void test() { + Class c = int.class; + c = short.class; + c = long.class; + c = float.class; + c = double.class; + c = char.class; + c = byte.class; + c = void.class; + + if (c == int.class || c == short.class || c == long.class || c == double.class || c == char.class || c == byte.class || c == void.class) { + + } + + if ("a".equals((int.class).getName())) { + + } + } +}