commit | fdff0425910a362eb56ee6287e38ac65a2bbe647 | [log] [tgz] |
---|---|---|
author | Andrey Loskutov <loskutov@gmx.de> | Sun Aug 05 13:11:49 2018 +0200 |
committer | Andrey Loskutov <loskutov@gmx.de> | Sun Aug 05 13:11:49 2018 +0200 |
tree | 0eadefb6b651cbeba45246a034101bee4a9261bc | |
parent | 7ce343cf0f480440e571b9d6f2bb74fcbfb6c503 [diff] |
Bug 532088 - avoid using String(String) or String(String.substring()) 1) The String.substring() in 1.4 kept original char[] reference in the new String, which was of course not good. In 1.8+ it always copies the portion of char array. So all constructs can be safely changed: new String(s.substring(x)) -> s.substring(x) new String(s.substring(x,y)) -> s.substring(x,y) 2) String(String) in 1.4 copied the original char array if the size was different, so by new String(String) one tried to avoid memory leaks. In 1.8+ new String(String) simply reuses the original pointers, so no gain here and we create new (wasted) String reference. So except few places where a *different* String *pointer* is required, all constructs can be safely changed: new String(string) -> string new String(stringBuffer.toString()) -> stringBuffer.toString() Change-Id: I061d1a82185605d0fba16a8885752d5da948ed20 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
This is the core part of Eclipse's Java development tools. It contains the non-UI support for compiling and working with Java code, including the following:
For more information, refer to the [JDT wiki page] 1 or the [JDT project overview page] 2.