Intellij IDEA plus sign when String wrap
In IntelliJ 15 this setting is in the preferences under
Editor > Code Style > Java > Wrapping and Braces (tab) > Binary Expressions (group) > Operation sign on next line (check box)
In case someone is using Android Studio:
Android Studio > Settings > Editor > Code Style > Java
Click on tab "Wrapping and Braces" and then find the "Binary expressions" group. There you have the checkbox "Operation sign on next line"
Settings (Preferences on macOS) | Editor | Code Style | Java | Wrapping and Braces | Binary expressions | Operation sign on next line:
In 2016.3 only this helped me:
while in editor, click on menu : code->generate->tostring->settings->template tab-> copy "String concat (+)", this would allow you to edit a new template.
then in template paste this:
public java.lang.String toString() {
#if ( $members.size() > 0 )
#set ( $i = 0 )
return "$classname{"
#foreach( $member in $members )
#if ( $i == 0 )
+ " ##
#else
+ ", ##
#end
#if ( $member.objectArray )
#if ($java_version < 5)
$member.name=" + ($member.accessor == null ? null : java.util.Arrays.asList($member.accessor)) +
#else
$member.name=" + java.util.Arrays.toString($member.accessor)
#end
#elseif ( $member.primitiveArray && $java_version >= 5)
$member.name=" + java.util.Arrays.toString($member.accessor)
#elseif ( $member.string )
$member.name='" + $member.accessor + '\''
#else
$member.name=" + $member.accessor
#end
#set ( $i = $i + 1 )
#end
+ '}';
#else
return "$classname{}";
#end
}