3

I see SonarQube throwing

squid:S2176("Class names should not shadow interfaces or superclasses")

when I create anonymous inner class instances. I'm a bit surprised by this and more so, when I didn't find any discussion related to this.

Could someone let me know if this sounds familiar and how it was solved?

Mi-Creativity
  • 9,554
  • 10
  • 38
  • 47
prefetcher
  • 63
  • 6
  • Which version of the java plugin are you using? Please provide a reproducer for the issue, with a small snippet of code, reproducing the situation you are facing. I can't reproduce it locally. – Wohops Dec 22 '15 at 13:08
  • The java plugin version is 3.0.I'll try to reproduce the issue with a small piece of code and update here. – prefetcher Dec 22 '15 at 22:35
  • 1
    Hi, Apologies for the delay. The Sonar issue(S2176) comes up only when the number of anonymous objects in a class cross a certain threshold. I reduced the number of such objects and the error went away. I am not sure why I get **squid:S2176("Class names should not shadow interfaces or superclasses")** error instead of a more specific and appropriate one. – prefetcher Jan 19 '16 at 06:08
  • But why are anonymous classes bad? It is common to use them for e.g. event handler callbacks. – gorootde Jun 09 '16 at 08:10
  • @Michael-SonarSourceTeam similar issue here: http://stackoverflow.com/questions/31228924/getting-some-unexpected-issues-when-analysis-my-gwt-project-with-sonarqube – Ewoks Jun 20 '16 at 08:11

0 Answers0