-
Bug
-
Resolution: Fixed
-
P4
-
None
-
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.