Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-400

Findbugs issues are not all reported when multiple classes are defined in the same file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None

      Description

      The following code can be used to reproduce:

      Foo.java:

      class Foo {
        public static String FOO = null;
      }
      

      Bar.java:

      public class Bar {
      
        public static void main(String[] args) {
          System.out.println(Foo.FOO.length()); // FB reports NPE, the issue is shown in SQ
        }
      
      }
      
      class Qux {
      
        public static void main(String[] args) {
          System.out.println(Foo.FOO.length()); // FB reports NPE, but it is *not* shown in SQ
        }
      
      }
      

        Attachments

          Activity

            People

            Assignee:
            godin OLD - Evgeny Mandrikov
            Reporter:
            dinesh.bolkensteyn Dinesh Bolkensteyn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: