-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: tools
-
b35
jdk.internal.jrtfs.JrtPath does this:
StringBuilder sb = new StringBuilder(path.length() + o.path.length());
sb.append(path);
if (path.charAt(path.length() - 1) != '/')
sb.append('/');
sb.append(o.path);
return new JrtPath(jrtfs, sb.toString(), true);
Since path is always normalized to not have a trailing slash, the pre-sizing is insufficient (which means we'll always resize the array on the sb.append(o.path) step) and the if unnecessary.
StringBuilder sb = new StringBuilder(path.length() + o.path.length());
sb.append(path);
if (path.charAt(path.length() - 1) != '/')
sb.append('/');
sb.append(o.path);
return new JrtPath(jrtfs, sb.toString(), true);
Since path is always normalized to not have a trailing slash, the pre-sizing is insufficient (which means we'll always resize the array on the sb.append(o.path) step) and the if unnecessary.