Projects
Mega:24.03:SP1:Everything
openjdk-1.8.0
_service:tar_scm:0045-8276904-Optional.toString...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0045-8276904-Optional.toString-is-unnecessarily-expensive.patch of Package openjdk-1.8.0
Date: Fri, 9 Jun 2023 11:15:09 +0800 Subject: 8276904: Optional.toString() is unnecessarily expensive Bug url: https://bugs.openjdk.org/browse/JDK-8276904 --- jdk/src/share/classes/java/util/Optional.java | 2 +- jdk/src/share/classes/java/util/OptionalDouble.java | 2 +- jdk/src/share/classes/java/util/OptionalInt.java | 2 +- jdk/src/share/classes/java/util/OptionalLong.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/java/util/Optional.java b/jdk/src/share/classes/java/util/Optional.java index d471058ec..ff2b4db7f 100644 --- a/jdk/src/share/classes/java/util/Optional.java +++ b/jdk/src/share/classes/java/util/Optional.java @@ -343,7 +343,7 @@ public final class Optional<T> { @Override public String toString() { return value != null - ? String.format("Optional[%s]", value) + ? ("Optional[" + value + "]") : "Optional.empty"; } } diff --git a/jdk/src/share/classes/java/util/OptionalDouble.java b/jdk/src/share/classes/java/util/OptionalDouble.java index 0efc770fa..9aff9be8d 100644 --- a/jdk/src/share/classes/java/util/OptionalDouble.java +++ b/jdk/src/share/classes/java/util/OptionalDouble.java @@ -246,7 +246,7 @@ public final class OptionalDouble { @Override public String toString() { return isPresent - ? String.format("OptionalDouble[%s]", value) + ? ("OptionalDouble[" + value + "]") : "OptionalDouble.empty"; } } diff --git a/jdk/src/share/classes/java/util/OptionalInt.java b/jdk/src/share/classes/java/util/OptionalInt.java index 5cb927524..584f6e2ba 100644 --- a/jdk/src/share/classes/java/util/OptionalInt.java +++ b/jdk/src/share/classes/java/util/OptionalInt.java @@ -246,7 +246,7 @@ public final class OptionalInt { @Override public String toString() { return isPresent - ? String.format("OptionalInt[%s]", value) + ? ("OptionalInt[" + value + "]") : "OptionalInt.empty"; } } diff --git a/jdk/src/share/classes/java/util/OptionalLong.java b/jdk/src/share/classes/java/util/OptionalLong.java index 589a59fd3..089f54adf 100644 --- a/jdk/src/share/classes/java/util/OptionalLong.java +++ b/jdk/src/share/classes/java/util/OptionalLong.java @@ -246,7 +246,7 @@ public final class OptionalLong { @Override public String toString() { return isPresent - ? String.format("OptionalLong[%s]", value) + ? ("OptionalLong[" + value + "]") : "OptionalLong.empty"; } } -- 2.22.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2