aboutsummaryrefslogtreecommitdiffstats
path: root/guava-testlib/src/com/google/common/collect/testing/testers/Platform.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/testers/Platform.java')
-rw-r--r--guava-testlib/src/com/google/common/collect/testing/testers/Platform.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/Platform.java b/guava-testlib/src/com/google/common/collect/testing/testers/Platform.java
index cd3eb84..ba4d3f0 100644
--- a/guava-testlib/src/com/google/common/collect/testing/testers/Platform.java
+++ b/guava-testlib/src/com/google/common/collect/testing/testers/Platform.java
@@ -16,17 +16,28 @@
package com.google.common.collect.testing.testers;
-import com.google.common.annotations.GwtCompatible;
+import java.lang.reflect.Method;
/**
* This class is emulated in GWT.
*
* @author Hayward Chan
*/
-@GwtCompatible
class Platform {
/**
+ * Delegate to {@link Class#getMethod(String, Class[])}. Not
+ * usable in GWT.
+ */
+ static Method getMethod(Class<?> clazz, String methodName) {
+ try {
+ return clazz.getMethod(methodName);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
* Format the template with args, only supports the placeholder
* {@code %s}.
*/