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

Code auto formatting for try-with-resources statements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 12.0, 13
    • 16
    • None
    • Arch Linux, AdoptOpenJDK 14.0.1, official NB 12.0 bin download

    Description

      Since NB 12.0, auto formatting for try-with-resources statements adds an additional space after the opening parenthesis after the try keyword. To reproduce the problem, choose:

      Menu »Tools« → Options → Editor → Formatting →

      Language »Java« and Category »Spaces« →

      Tree item »Within Parentheses« → Checkbox "try"

      If checked, two spaces are added after the opening parenthesis after try, if unchecked, one space is added, instead of one and zero.

      (Note, that there is also no example available in the preview. There is for try-catch, but not for try-with-resources.)

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Bernd Michaely Bernd Michaely
              Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: