This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 68804

Summary: [50cat] concatenated strings
Product: java Reporter: cbulcu <cbulcu>
Component: HintsAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: ENHANCEMENT Exception Reporter:

Description cbulcu 2005-11-16 13:00:37 UTC
[ JDK VERSION : 1.5.0_05 ]

Regarding this issue:
http://www.netbeans.org/issues/show_bug.cgi?id=67775

Roman Strobl wrote:
"I agree. This is very annoying if you write multiline string - e.g. you want to
copy them from another application. Try to convert:

pasted line 1
pasted line 2
pasted line 3

into:

String s = "pasted line 1" +
    "pasted line 2" +
    "pasted line 3";

Each time duplicate quotes are typed in."

I think, and I wrote it in the issue, that this example could lead to a refactoring. Select those three lines and refactor it to the concatenated strings.
Comment 1 Jan Pokorsky 2008-10-16 14:05:51 UTC
It is rather a task for java hints. Reassigning.
Comment 2 cbulcu 2008-10-16 19:01:54 UTC
I remembered about this issue :-)

IntelliJ Idea does an interesting job on inserting those kind of text lines between "".

So if you write in the editor:

""

and then paste

pasted line 1
pasted line 2
pasted line 3

between the "", you get:

"pasted line 1\n" +
"pasted line 2\n" +
"pasted line 3"

so basically it takes the text and surrounds its lines with "", inserts \n after each line before closing the ", and  
concatenates the lines.
Comment 3 markiewb 2013-02-08 18:35:31 UTC

*** This bug has been marked as a duplicate of bug 201130 ***