Duplicate code block does not take account of annotations

We have 8.9.8 (build 54436)

I am overriding setters in 2 descendant classes in order to change the annotation:

    @Override @Value("${dummy.one}")
    public void setOne(String one) { this.one = one; }

    @Override @Value("${dummy.two}")
    public void setTwo(int two) { this.two = two; }

    @Override @Value("${dummy.three}")
    public void setThree(int three) { this.three = three; }

    @Override @Value("${dummy.four}")
    public void setFour(int four) { this.four = four; }

    @Override @Value("${dummy.five}")
    public void setFive(int five { this.five = five; }

In the 2nd class, the annotations are different.

SQ gives the error for both files: 2 duplicated blocks of code must be removed.

What can I do?

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.9.8 → 9.9.1 → 10.1 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, duplication detection ignores string values.

 
Ann

1 Like

Thanks Ann. What version was this bug fixed in?