[ https://issues.apache.org/jira/browse/NETBEANS-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Junichi Yamamoto resolved NETBEANS-2653. ---------------------------------------- Fix Version/s: 11.2 Resolution: Fixed > Generate toString() with StringBuilder > -------------------------------------- > > Key: NETBEANS-2653 > URL: https://issues.apache.org/jira/browse/NETBEANS-2653 > Project: NetBeans > Issue Type: Improvement > Components: java - Editor > Affects Versions: 11.0 > Reporter: Junichi Yamamoto > Assignee: Junichi Yamamoto > Priority: Major > Labels: pull-request-available > Fix For: 11.2 > > Time Spent: 2h 40m > Remaining Estimate: 0h > > Currently, the following toString() is inserted using "insert code" feature: > {code:java} > public class NewClass { > private final String test = "test"; > private final String test2 = "test"; > private final String test3 = "test"; > @Override > public String toString() { > // generate toString() with "+" operator > return "NewClass{" + "test=" + test + ", test2=" + test2 + ", test3=" > + test3 + '}'; > } > } > {code} > Add a check box to the panel for using StringBuilder, then insert the > following toString(): > {code:java} > public class NewClass { > private final String test = "test"; > private final String test2 = "test"; > private final String test3 = "test"; > @Override > public String toString() { > StringBuilder sb = new StringBuilder(); > sb.append("NewClass{test=").append(test); > sb.append(", test2=").append(test2); > sb.append(", test3=").append(test3); > sb.append('}'); > return sb.toString(); > } > } > {code} -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists