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

Incorrect wrapping of type annotations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 12.0
    • None
    • None

    Description

      I've been playing with the beta 4 release of 12.0 to test out some of the preview functionality in Java 14.

      It appears that the automatic formatting tool is always wrapping some type annotations, even if Editor > Formatting > Java > Wrapping > Annotations is set to 'Never'.

      For example, when using org.checkerframework.checker.nullness.qual.Nullable:

      public static @Nullable Object getNullable()
      {
          return null;
      }
      

      is formatted as

      public static @Nullable
      Object getNullable()
      {
          return null;
      }
      

      (As an aside, it probably would be reasonable to add a separate option for the wrapping behavior of annotations that have TYPE_USE or TYPE_PARAMETER as a @Target)

      Attachments

        1. nb-configuration.xml
          15 kB
          David Kleszyk
        2. org-netbeans-modules-editor-settings-CustomPreferences.xml
          8 kB
          David Kleszyk
        3. pom.xml
          1 kB
          David Kleszyk

        Activity

          People

            Unassigned Unassigned
            dkleszyk David Kleszyk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: