mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 02:24:40 +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
|
@ -27,8 +27,6 @@ package java.sql;
|
|||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import jdk.internal.misc.JavaLangAccess;
|
||||
|
||||
/**
|
||||
* <P>A thin wrapper around a millisecond value that allows
|
||||
|
@ -46,8 +44,6 @@ import jdk.internal.misc.JavaLangAccess;
|
|||
*/
|
||||
public class Date extends java.util.Date {
|
||||
|
||||
private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
|
||||
|
||||
/**
|
||||
* Constructs a <code>Date</code> object initialized with the given
|
||||
* year, month, and day.
|
||||
|
@ -168,7 +164,7 @@ public class Date extends java.util.Date {
|
|||
buf[7] = '-';
|
||||
Date.formatDecimalInt(day, buf, 8, 2);
|
||||
|
||||
return jla.newStringUnsafe(buf);
|
||||
return new String(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,8 +27,6 @@ package java.sql;
|
|||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalTime;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import jdk.internal.misc.JavaLangAccess;
|
||||
|
||||
/**
|
||||
* <P>A thin wrapper around the <code>java.util.Date</code> class that allows the JDBC
|
||||
|
@ -43,8 +41,6 @@ import jdk.internal.misc.JavaLangAccess;
|
|||
*/
|
||||
public class Time extends java.util.Date {
|
||||
|
||||
private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
|
||||
|
||||
/**
|
||||
* Constructs a <code>Time</code> object initialized with the
|
||||
* given values for the hour, minute, and second.
|
||||
|
@ -134,7 +130,7 @@ public class Time extends java.util.Date {
|
|||
buf[5] = ':';
|
||||
Date.formatDecimalInt(second, buf, 6, 2);
|
||||
|
||||
return jla.newStringUnsafe(buf);
|
||||
return new String(buf);
|
||||
}
|
||||
|
||||
// Override all the date operations inherited from java.util.Date;
|
||||
|
|
|
@ -27,8 +27,6 @@ package java.sql;
|
|||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import jdk.internal.misc.JavaLangAccess;
|
||||
|
||||
/**
|
||||
* <P>A thin wrapper around {@code java.util.Date} that allows
|
||||
|
@ -74,8 +72,6 @@ import jdk.internal.misc.JavaLangAccess;
|
|||
*/
|
||||
public class Timestamp extends java.util.Date {
|
||||
|
||||
private static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess();
|
||||
|
||||
/**
|
||||
* Constructs a {@code Timestamp} object initialized
|
||||
* with the given values.
|
||||
|
@ -313,7 +309,7 @@ public class Timestamp extends java.util.Date {
|
|||
buf[yearSize + 15] = '.';
|
||||
Date.formatDecimalInt(tmpNanos, buf, yearSize + 16, 9 - trailingZeros);
|
||||
|
||||
return jla.newStringUnsafe(buf);
|
||||
return new String(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue