Skip to content

Indentation check regression with "new" #9719

@mjpt777

Description

@mjpt777
package checkstyle;

public class Test
{
    public Integer foo(boolean flag)
    {
        Integer result = flag ?
            new Integer(1) :
            new Integer(2);

        return result;
    }

    public Integer bar(boolean flag)
    {
        return flag ?
            new Integer(1) : new Integer(2);
    }
}
        <module name="Indentation">
            <property name="forceStrictCondition" value="true"/>
        </module>
[ant:checkstyle] [ERROR] C:\deve\checkstyle\Test.java:8:13: 'new' has incorrect indentation level 12, expected level should be 8. [Indentation]
[ant:checkstyle] [ERROR] C:\deve\checkstyle\Test.java:9:13: 'new' has incorrect indentation level 12, expected level should be 8. [Indentation]
[ant:checkstyle] [ERROR] C:\deve\checkstyle\Test.java:17:13: 'new' has incorrect indentation level 12, expected level should be 8. [Indentation]

The indentation check works on 8.39 but not with 8.40 or 8.41 of Checkstyle.


Metadata

Metadata

Assignees

No one assigned

    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