mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8176188: jdk/internal/misc/JavaLangAccess/NewUnsafeString.java failing since 9-b93
Reviewed-by: psandoz, sherman
This commit is contained in:
parent
6351f58092
commit
7759531e5c
9 changed files with 5 additions and 138 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue