A RetroSearch Logo

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

Search Query:

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

ClassCastException in switch case with local variable returned · Issue #219 · pmd/pmd · GitHub

Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex]. If not specific to a language, you can use [core]

Rule Set:
UnnecessaryLocalBeforeReturn

Description:

java.lang.ClassCastException: net.sourceforge.pmd.lang.java.ast.ASTSwitchStatement cannot be cast to net.sourceforge.pmd.lang.java.ast.ASTBlock
        at net.sourceforge.pmd.lang.java.rule.design.UnnecessaryLocalBeforeReturnRule.hasAssertStatement(UnnecessaryLocalBeforeReturnRule.java:101)
        at net.sourceforge.pmd.lang.java.rule.design.UnnecessaryLocalBeforeReturnRule.visit(UnnecessaryLocalBeforeReturnRule.java:52)

Code Sample demonstrating the issue:

    public static int m() {
        switch (0) {
            default:
                int i = 0;
                return i;
        }
    }

Running PMD through: Gradle


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