Java - Indentation consistency false-positive

Version: SonarCloud

Hello! When using SonarCloud in java, in mis-marks some indentations as inconsistent.

My case:

/**
 * XtrInt in the Xtrmth version of Integer. It contains
 * all Xtrmth functions applicable to an integer, and can easily
 * and efficiently calculate all of these.
 */
public class XtrInt {
    private Integer val;

    /**
     * Create a new {@link XtrInt} object. They can be used to calculate many math operations all within one object.
     * @param val {@link Integer} the value to set.
     */
    public XtrInt(int val) {
        this.val = val;
    // ...

MRE:

public class SomeClass {
    public SomeClass {
        System.out.println("Example") // Will report indentation inconsistency here.
    }
}

Hi @CATboardBETA,

I can’t reproduce your issue on my side. Neither of your examples raise an issue on my side with the expected indentation set to 4, even after adding the missing punctuation to make them compile.

Can you make sure that your code does not contain any tabs and that you have set the expected indentation to 4 in the rule settings?

Cheers,
Sebastian

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.