8176188: jdk/internal/misc/JavaLangAccess/NewUnsafeString.java failing since 9-b93

Reviewed-by: psandoz, sherman
This commit is contained in:
Claes Redestad 2017-12-05 14:25:16 +01:00
parent 6351f58092
commit 7759531e5c
9 changed files with 5 additions and 138 deletions

View file

@ -24,9 +24,6 @@
*/
package java.util;
import jdk.internal.misc.JavaLangAccess;
import jdk.internal.misc.SharedSecrets;
/**
* {@code StringJoiner} is used to construct a sequence of characters separated
* by a delimiter and optionally starting with a supplied prefix
@ -86,8 +83,6 @@ public final class StringJoiner {
*/
private String emptyValue;
private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
/**
* Constructs a {@code StringJoiner} with no characters in it, with no
* {@code prefix} or {@code suffix}, and a copy of the supplied
@ -189,7 +184,7 @@ public final class StringJoiner {
}
}
k += getChars(suffix, chars, k);
return jla.newStringUnsafe(chars);
return new String(chars);
}
/**
@ -252,7 +247,7 @@ public final class StringJoiner {
elts[i] = null;
} while (++i < size);
size = 1;
elts[0] = jla.newStringUnsafe(chars);
elts[0] = new String(chars);
}
}