False Positive squid:S3973 on auto generated equals in java

Community Edition

This is an override of equals for an ORM class that I’m pretty sure was auto-generated by IntelliJ IDEA.
To me the indentation appears to be correct.
Yet squid:S3973 claims that after the else if, the return is not indented correctly.

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		someDTO other = (someDTO) obj;
		if (lastRefresh == null) {
			if (other.someValue != null)
				return false;
		} else if (!someValue.equals(other.someValue))
			return false;
		return true;

Hey @Brian_Davis,

Thanks for the feedback and reproducer. This is indeed a FP. I created the following ticket to handle it: SONARJAVA-3450.


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