Skip to content

Commit

Permalink
Remove obsolete GWT-RPC logging code.
Browse files Browse the repository at this point in the history
(i.e., roll back cl/265490471)

This is progress toward addressing the Java agent / `premain` problem discussed in #6566.

GWT-RPC support has been gone for a while now.

RELNOTES=Fixed some problems with [using Guava from a Java Agent](#6566). (But we don't test that configuration, and we don't know how well we'll be able to keep it working.)
PiperOrigin-RevId: 543484764
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jun 26, 2023
1 parent 39c45d2 commit e42d4e8
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 174 deletions.
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/base/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,4 @@ public boolean isPcreLike() {
return true;
}
}

static void checkGwtRpcEnabled() {}
}
2 changes: 0 additions & 2 deletions android/guava/src/com/google/common/collect/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,5 @@ static int reduceExponentIfGwt(int exponent) {
return exponent;
}

static void checkGwtRpcEnabled() {}

private Platform() {}
}
26 changes: 0 additions & 26 deletions android/guava/src/com/google/common/primitives/Platform.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,5 @@ static boolean patternCompilerIsPcreLike() {
throw new UnsupportedOperationException();
}

/*
* We will eventually disable GWT-RPC on the server side, but we'll leave it nominally enabled on
* the client side. There's little practical difference: If it's disabled on the server, it won't
* work. It's just a matter of how quickly it fails. I'm not sure if failing on the client would
* be better or not, but it's harder: GWT's System.getProperty reads from a different property
* list than Java's, so anyone who needs to reenable GWT-RPC in an emergency would have to figure
* out how to set both properties. It's easier to have to set only one, and it might as well be
* the Java property, since Guava already reads another Java property.
*/
static void checkGwtRpcEnabled() {}

private Platform() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,5 @@ static int reduceExponentIfGwt(int exponent) {
return exponent / 2;
}

/*
* We will eventually disable GWT-RPC on the server side, but we'll leave it nominally enabled on
* the client side. There's little practical difference: If it's disabled on the server, it won't
* work. It's just a matter of how quickly it fails. I'm not sure if failing on the client would
* be better or not, but it's harder: GWT's System.getProperty reads from a different property
* list than Java's, so anyone who needs to reenable GWT-RPC in an emergency would have to figure
* out how to set both properties. It's easier to have to set only one, and it might as well be
* the Java property, since Guava already reads another Java property.
*/
static void checkGwtRpcEnabled() {}

private Platform() {}
}

This file was deleted.

21 changes: 0 additions & 21 deletions guava/src/com/google/common/base/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,4 @@ public boolean isPcreLike() {
return true;
}
}

static void checkGwtRpcEnabled() {
String propertyName = "guava.gwt.emergency_reenable_rpc";

if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) {
throw new UnsupportedOperationException(
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.",
propertyName,
"https://stackoverflow.com/q/5189914/28465",
"https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ"));
}
logger.log(
java.util.logging.Level.WARNING,
"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());
}
}
21 changes: 0 additions & 21 deletions guava/src/com/google/common/collect/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,5 @@ static int reduceExponentIfGwt(int exponent) {
return exponent;
}

static void checkGwtRpcEnabled() {
String propertyName = "guava.gwt.emergency_reenable_rpc";

if (!Boolean.parseBoolean(System.getProperty(propertyName, "false"))) {
throw new UnsupportedOperationException(
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.",
propertyName,
"https://stackoverflow.com/q/5189914/28465",
"https://groups.google.com/d/msg/guava-announce/zHZTFg7YF3o/rQNnwdHeEwAJ"));
}
logger.log(
java.util.logging.Level.WARNING,
"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());
}

private Platform() {}
}
48 changes: 0 additions & 48 deletions guava/src/com/google/common/primitives/Platform.java

This file was deleted.

0 comments on commit e42d4e8

Please sign in to comment.