A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/352 below:

[java] AccessorClassGeneration throws ClassCastException when seeing array construction · Issue #352 · pmd/pmd · GitHub

The rule java/design/AccessorClassGeneration fails with the following exception trace:

Caused by: java.lang.ClassCastException: net.sourceforge.pmd.lang.java.ast.ASTArrayDimsAndInits cannot be cast to net.sourceforge.pmd.lang.java.ast.ASTArguments
	at net.sourceforge.pmd.lang.java.rule.design.AccessorClassGenerationRule.visit(AccessorClassGenerationRule.java:78)
	at net.sourceforge.pmd.lang.java.ast.ASTAllocationExpression.jjtAccept(ASTAllocationExpression.java:21)
	at net.sourceforge.pmd.lang.java.rule.JavaRuleChainVisitor.visit(JavaRuleChainVisitor.java:41)

Using the following test case for AccessorClassGeneration.xml:

    <test-code>
        <description><![CDATA[
Array initializer is not a class body
     ]]></description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    private class Bar {
        private int size;

        private Bar() {
        }

        void bar() {
            new Bar[size];
        }
    }
}
     ]]></code>
    </test-code>

This is related to issue #291 and pull request #293 in some fashion.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4