diff --git a/android/guava/src/com/google/common/base/Platform.java b/android/guava/src/com/google/common/base/Platform.java index 98418f442188..26c5c297fd92 100644 --- a/android/guava/src/com/google/common/base/Platform.java +++ b/android/guava/src/com/google/common/base/Platform.java @@ -14,9 +14,6 @@ package com.google.common.base; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; import java.lang.ref.WeakReference; import java.util.Locale; @@ -103,18 +100,5 @@ public boolean isPcreLike() { } } - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { - throw new UnsupportedOperationException( - lenientFormat( - "We are removing GWT-RPC support for Guava types. You can temporarily reenable" - + " support by setting the system property %s to true. For more about system" - + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, - "https://stackoverflow.com/q/5189914/28465", - "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); - } - } + static void checkGwtRpcEnabled() {} } diff --git a/android/guava/src/com/google/common/collect/Platform.java b/android/guava/src/com/google/common/collect/Platform.java index f5e24de98628..e4d1c4c5fd15 100644 --- a/android/guava/src/com/google/common/collect/Platform.java +++ b/android/guava/src/com/google/common/collect/Platform.java @@ -16,9 +16,6 @@ package com.google.common.collect; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; import java.lang.reflect.Array; import java.util.Arrays; @@ -112,20 +109,7 @@ static int reduceExponentIfGwt(int exponent) { return exponent; } - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { - throw new UnsupportedOperationException( - lenientFormat( - "We are removing GWT-RPC support for Guava types. You can temporarily reenable" - + " support by setting the system property %s to true. For more about system" - + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, - "https://stackoverflow.com/q/5189914/28465", - "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); - } - } + static void checkGwtRpcEnabled() {} private Platform() {} } diff --git a/android/guava/src/com/google/common/primitives/Platform.java b/android/guava/src/com/google/common/primitives/Platform.java index f66081e7596d..82b902b9ccba 100644 --- a/android/guava/src/com/google/common/primitives/Platform.java +++ b/android/guava/src/com/google/common/primitives/Platform.java @@ -14,28 +14,12 @@ package com.google.common.primitives; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; /** Methods factored out so that they can be emulated differently in GWT. */ @GwtCompatible(emulated = true) final class Platform { - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { - throw new UnsupportedOperationException( - lenientFormat( - "We are removing GWT-RPC support for Guava types. You can temporarily reenable" - + " support by setting the system property %s to true. For more about system" - + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, - "https://stackoverflow.com/q/5189914/28465", - "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); - } - } + static void checkGwtRpcEnabled() {} private Platform() {} } diff --git a/guava/src/com/google/common/base/Platform.java b/guava/src/com/google/common/base/Platform.java index a77a42347022..54b2dfcc861e 100644 --- a/guava/src/com/google/common/base/Platform.java +++ b/guava/src/com/google/common/base/Platform.java @@ -14,9 +14,6 @@ package com.google.common.base; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; import java.lang.ref.WeakReference; import java.util.Locale; @@ -98,22 +95,22 @@ public boolean isPcreLike() { } } - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { + String propertyName = "guava.gwt.emergency_reenable_rpc"; + + if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) { throw new UnsupportedOperationException( - lenientFormat( + Strings.lenientFormat( "We are removing GWT-RPC support for Guava types. You can temporarily reenable" + " support by setting the system property %s to true. For more about system" + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, + propertyName, "https://stackoverflow.com/q/5189914/28465", "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); } logger.log( java.util.logging.Level.WARNING, - "In January 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + "Later in 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + " warning because you are sending a Guava type over GWT-RPC, which will break. You" + " can identify which type by looking at the class name in the attached stack trace.", new Throwable()); diff --git a/guava/src/com/google/common/collect/Platform.java b/guava/src/com/google/common/collect/Platform.java index d3b994f14137..d4afd3299ca6 100644 --- a/guava/src/com/google/common/collect/Platform.java +++ b/guava/src/com/google/common/collect/Platform.java @@ -16,9 +16,6 @@ package com.google.common.collect; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; import java.lang.reflect.Array; import java.util.Arrays; @@ -115,22 +112,22 @@ static int reduceExponentIfGwt(int exponent) { return exponent; } - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { + String propertyName = "guava.gwt.emergency_reenable_rpc"; + + if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) { throw new UnsupportedOperationException( - lenientFormat( + com.google.common.base.Strings.lenientFormat( "We are removing GWT-RPC support for Guava types. You can temporarily reenable" + " support by setting the system property %s to true. For more about system" + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, + propertyName, "https://stackoverflow.com/q/5189914/28465", "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); } logger.log( java.util.logging.Level.WARNING, - "In January 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + "Later in 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + " warning because you are sending a Guava type over GWT-RPC, which will break. You" + " can identify which type by looking at the class name in the attached stack trace.", new Throwable()); diff --git a/guava/src/com/google/common/primitives/Platform.java b/guava/src/com/google/common/primitives/Platform.java index 7006bafb8183..1273c043bc1c 100644 --- a/guava/src/com/google/common/primitives/Platform.java +++ b/guava/src/com/google/common/primitives/Platform.java @@ -14,9 +14,6 @@ package com.google.common.primitives; -import static com.google.common.base.Strings.lenientFormat; -import static java.lang.Boolean.parseBoolean; - import com.google.common.annotations.GwtCompatible; /** Methods factored out so that they can be emulated differently in GWT. */ @@ -25,22 +22,22 @@ final class Platform { private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(Platform.class.getName()); - private static final String GWT_RPC_PROPERTY_NAME = "guava.gwt.emergency_reenable_rpc"; - static void checkGwtRpcEnabled() { - if (!parseBoolean(System.getProperty(GWT_RPC_PROPERTY_NAME, "true"))) { + String propertyName = "guava.gwt.emergency_reenable_rpc"; + + if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) { throw new UnsupportedOperationException( - lenientFormat( + com.google.common.base.Strings.lenientFormat( "We are removing GWT-RPC support for Guava types. You can temporarily reenable" + " support by setting the system property %s to true. For more about system" + " properties, see %s. For more about Guava's GWT-RPC support, see %s.", - GWT_RPC_PROPERTY_NAME, + propertyName, "https://stackoverflow.com/q/5189914/28465", "https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ")); } logger.log( java.util.logging.Level.WARNING, - "In January 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + "Later in 2020, we will remove GWT-RPC support for Guava types. You are seeing this" + " warning because you are sending a Guava type over GWT-RPC, which will break. You" + " can identify which type by looking at the class name in the attached stack trace.", new Throwable());