(Edited) NOTE: this question is NOT about how Eclipse’s code formatter wrap long String literals. It is the behavior of MANUALLY breaking/wrapping String literal
The default behavior when I break a String literal by hitting enter inside the literal, is Eclipse will append " + at the place I hit enter, and start the rest of my line in next line, with " prefixed.
// v ENTER HERE
String longString = "abcdefghij|klmno";
String longString = "abcdefghij" +
"klmno";
However, normal coding style practice suggests line wrap before operator. Is there any way that I can tell Eclipse to break my String like this?
String longString = "abcdefhij"
+ "klmno";
Finally I found this is one missing feature of Eclipse.
Currently this issue is tracked under Eclipse’s issue tracker :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=48433
Update: I am now using Eclipse 4.3, and found that this feature is now available. Position of
+operator when you are manually breaking a long String will now follows your code formatter setting.