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

Hint "add imports" is not in a right place(Record -JDK 14)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 11.3
    • java - Editor
    • 14-ea; OpenJDK 64-Bit Server VM 14-ea+27-1339

    Description

      Write below code snippet on editor and use hint "add import" for List interface.

      public record Test(String s, int i, int j)

      { static List list= null; }

      Actual Result:

      Import statement comes at the end of record body. This change shows compile time error on editor.

       

      Excepted Result

      Import statement should come after package declaration or before start of record body.

       

      Note : This issue occurs only when there is no other import statement available or declared previously. 

      Attachments

        Issue Links

          Activity

            People

              singh-akhilesh Akhilesh Singh
              singh-akhilesh Akhilesh Singh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m