Matthew Dempsky has uploaded a new change for review.

  https://gwt-review.googlesource.com/2771


Change subject: Don't call toString() on plain Java arrays
......................................................................

Don't call toString() on plain Java arrays

Error Prone will soon warn about calling toString() on plain Java
arrays, because the return value is rarely useful.  In JsoTest, we
don't actually care about what it returns because the cast to
String[][] should throw an exception anyway, but presumably we want to
make sure the variable doesn't get discarded as dead and the cast
optimized away.

Instead of applying the Error Prone automated refactoring of calling
java.util.Arrays.toString(), we can just call getClass() instead.

Change-Id: I2e90cf1442d126efe8d7ec866204f20c5e4cf3e9
---
M user/test/com/google/gwt/dev/jjs/test/JsoTest.java
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/user/test/com/google/gwt/dev/jjs/test/JsoTest.java b/user/test/com/google/gwt/dev/jjs/test/JsoTest.java
index 059d1c9..9164f25 100644
--- a/user/test/com/google/gwt/dev/jjs/test/JsoTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/JsoTest.java
@@ -407,7 +407,7 @@
     assertFalse(o instanceof String[][]);
     try {
       String[][] s = (String[][]) o;
-      s.toString();
+      s.getClass();
       fail("Expected ClassCastException");
     } catch (ClassCastException expected) {
     }

--
To view, visit https://gwt-review.googlesource.com/2771
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e90cf1442d126efe8d7ec866204f20c5e4cf3e9
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Matthew Dempsky <[email protected]>

--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to