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

Inserting multiline string from clipboard into other string (between "...") in Java Editor does not follow the format settings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 8.2, 11.2
    • None
    • None

    Description

      Default format settings for operators in Java editor is on beginning of line. Rule is used e.g. for operator '+' on Strings - if Java code is reformatted or if string token is splitten to more lines by Enter key.

      String str = "aaa"
         + "bbb";
      

       

      But if you paste multiline string from clipboard into other string token (between "...") then operator '+' are generated on end of lines.

      String str = "aaa";
      
      then insert at end of string token (before last " char)
      
      ccc
      ccc
      
      generate
      
      String str = "aaaccc\n" +
      "ccc";
      

       

      In JDK 13 are multiline strings supported in another way but in JDK 8 or when appending variable value still need long strings splitted on multiple lines.

      Best regards ZM

      Attachments

        Activity

          People

            Unassigned Unassigned
            xmachac2@seznam.cz Zdeněk Machač
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: