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

closing bracket stays indented in source+format on record class.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 12.2, 12.3, 12.4, 12.5, 12.6, 13
    • 13
    • None
    • ubuntu 20.04 jjdk16 ea netbeans 12.2 and 12.3-beta2

    Description

      Normally the source formatter puts the class-closing brace
      at the start of the line.
      This is not the case for java 14+ (preview) record types. Tested on 12.2 and 12.3-beta2 and 1.4-beta1

      Formatting happens when you select soure>format or ctrl+shift+f (linux, windows).
      The problem appears to be related to the canonical constructor definition before the opening braces, because my normal setting
      to put white space before closing parenthesis is also ignored.

      // Some comments here
      public record IntegerRange( Integer start, Integer end) implements // closing parens should be preceded 
              Range<IntegerRange, Integer, Integer> {   //   by whitespace with my settings
      
          } // offending line, not undented to column 1
      
      

      After further investigation, it appears to be influenced by the editor settings 'spaces, within parenthesis, method declaration' When this is turned off, the effect does not appear.

      Attachments

        Activity

          People

            Unassigned Unassigned
            homberghp Pieter van den Hombergh
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 - 4h
                4h