Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-576

The FindBugs plugin works with JDK8 but not with JDK10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 9.0
    • None
    • java - FindBugs
    • None

    Description

      [1] I created a trivial Java application with some issues for FindBugs to identify:

      package app;

      public class App {

      static String s1; int j; Boolean b1;

      public static void main(String[] args) {
          System.out.println("JRE version: " + System.getProperty("java.version"));
          if (s1 == "abc") {
          }
      }

      public boolean equals(App i) {

          int j = this.hashCode();
          return this.equals(new App());
      }

      }

      [2] When the application was run it displayed displayed: JRE version: 1.8.0_162

      [3]Then I ran Source > Inspect... using FindBugs (version 1.32) on the file App.java. FindBugs identified eight issues in the Inspector window, as shown in the attached screen shot FindBugsJDK8.png.

      [4]Next I added JDK 10 as a Java platform, and amended the properties of the project as follows:

      • Libraries > Java Platform: JDK 10
      • Sources > Source/Binary Format: JDK 10

      [5]As expected, when the application was run again it displayed: JRE version: 10 

      [6] However, when I ran Source > Inspect... using FindBugs on the file App.java again, using code compiled and run with JDK10, there was no FindBugs output in the Inspector window. See the attached screen shot FindBugsJDK10.png.

      (My understanding is that FindBugs hasn't been updated for several years. Could NetBeans possibly use its successor, SpotBugs, as a plugin instead?)

       

      Environment Details:

      Product Version: Apache NetBeans IDE Dev (Build incubator-netbeans-linux-388-on-20180402)
      Java: 1.8.0_162; Java HotSpot(TM) 64-Bit Server VM 25.162-b12Runtime: Java(TM) SE Runtime Environment 1.8.0_162-b12System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb)User directory: C:\Users\johndoe\AppData\Roaming\NetBeans\devCache directory: C:\Users\johndoe\AppData\Local\NetBeans\Cache\dev

      Attachments

        1. FindBugsJDK10.png
          49 kB
          Rick Hegarty
        2. FindBugsJDK8.png
          68 kB
          Rick Hegarty

        Activity

          People

            Unassigned Unassigned
            skomisa Rick Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: