Override equals in order to keep backward compatibility between the deprecated Java class and the new one in sonar-java