Hi,
Rule S1872 Classes should not be compared by name is raising a false positive for comparison operation of class name with String variable. We know that we shouldn't compare class names of two instances or one instance with hardcoded text. In our code we compare String variable which stores type (class name). That variable is read from context (e.g. metadata read from XML). Below is an image with 5 cases, where I think two of them are False Positives.
Example class:
Best Regards,
Adam Gabryś
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/375b2bd8-bd3d-4e7c-b9e0-9be7c14f7f18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Michael,
Yesterday our infrastructure team upgraded Java Plugin to 4.14. With that version one of two false positives disappeared:
Hi Michael,
Could you give me a status of the issue? Do you plan to create a Jira ticket?
Best Regards
Adam Gabryś