From 5fbbe0ac9422c149add5b2de3487339844d185ce Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 9 Feb 2015 21:36:49 +0100 Subject: [PATCH] verify #1310 PMD cannot parse int.class --- .../pmd/ast/ParserCornerCases.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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())) { + + } + } +}