Skip to content

[java] MissingBreakInSwitch - last default case does not contain a break #659

@zolyfarkas

Description

@zolyfarkas

Rule: MissingBreakInSwitch

Description:

A switch statement does not contain a break, even if it is the default case.

Code Sample demonstrating the issue:

https://www.codacy.com/app/zolyfarkas/spf4j/issues?&filters=W3siaWQiOiJDYXRlZ29yeSIsInZhbHVlcyI6WyJFcnJvciBQcm9uZSJdfV0=

        switch (precission) { 
            case 32: 
                mc = MathContext.DECIMAL32; 
                break; 
            case 64: 
                mc = MathContext.DECIMAL64; 
                break; 
            case 128: 
                mc = MathContext.DECIMAL128; 
                break; 
            default: 
                mc = new MathContext(precission); 
        } 

Running PMD through: Codacy

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:false-positivePMD flags a piece of code that is not problematic

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions