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

Netbeans Java Editor fails to recognize java.sql module types

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 12.2, 12.5
    • None
    • java - Editor
    • None

    Description

      Product Version: Apache NetBeans IDE 11.0 (Build incubator-netbeans-release-404-on-20190319)

      Java: 11.0.2; OpenJDK 64-Bit Server VM 11.0.2+9-LTS

      Runtime: OpenJDK Runtime Environment 11.0.2+9-LTS

      System: Windows 10 version 10.0 running on amd64;

       

      I'm using the "Java with Ant -> Java Class Library" project template

       

      In the Java Editor, when trying to use any of the classes included in the java.sql module (e.g. java.sql.Connection, java.sql.DriverManager, etc.) - many of the features of the java editor don't work.

       

      auto-completion when importing java.sql.Connection (not a big deal, I can just type it "manually"), but

      if I Ctl-click on the import (to view source) - nothing happens

      Similarly if I select the type and then go to view its JavaDoc in the JavaDoc window, it displays "JavaDoc not found"

       

      Note: I can build the project no problem, I can run Junit 4 tests – no problem - so I'm fairly confident in my deduction that the ant scripts are not at issue, and clearly the run-time system is able to find, load, and verify the necessary types with no issue, so it's not as if my JDK image is at issue.

       

      What I have noticed however, is that the java.sql module is not listed in the project window, libraries:

       

       

      So is there a problem with the "platform" definition:

       

       

      Sure seems not to be, the platform manager window lists java.sql as expected.

       

      I realize that these "problems" (the editor vis a vis the project-window) may be entirely unrelated.  But what I have noticed is that I only encounter this editor problem when it comes to types that are defined in modules that are not listed/displayed in the project window (the problem is not restricted to java.sql module, same goes for java.logging, and I'm sure many others).

       

      This is a bit baffling; I used the jmod command line tool to look at the module definitions for java.sql and say java.xml and I don't see anything that would distinguish them and result in one (java.sql) being "unrecognized" and the other (java.xml) being recognized by the editor/project window

       

      I saw in the netbeans.conf file that there are a lot --add-opens and --add-exports JVM parameters, and I tried to explicitly --add-modules=ALL-DEFAULT, but that had no effect.

       

      Also, the sources for java.sql are in the same .zip file as for all the other sources, same for the javadoc - so it's not that the sources or javadoc are missing - the same src.zip work fine, again, for all the types included in the listed platform modules in the properties window.

       

      I can only surmise that the netbeans code that, presumably using reflection, lists all the "system" modules (which is used to populate the property-window->Libraries) is somehow ignoring java.sql, java.logging, etc.  Although, again, I don't really see on what basis it privileges some modules over others (and of course the same bug isn't afflicting the platform manager window as shown above)

       

      P.S.  I've also encountered this exact same bug using Netbeans 12.2 and JDK-15 on another computer - so it's not specific to either the JDK or Netbeans version; I also looked in the Netbeans log and couldn't find any message that seems to relate to this problem.

       

       

       

       

       

       

       

       

       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ktng k thurston ng

            Dates

              Created:
              Updated:

              Slack

                Issue deployment