diff options
author | Eric Anderson <ejona@google.com> | 2017-09-18 09:54:41 -0700 |
---|---|---|
committer | Eric Anderson <ejona@google.com> | 2017-09-20 09:43:50 -0700 |
commit | 5bf4f5b7a69f9c13479f5f7a7a6ed856fe2c0c1d (patch) | |
tree | ac3ddbc084353caa22fd9f545b28f5e65c0aec64 /context | |
parent | bd28b92850325fec7641ea9d6adb2739e47381f9 (diff) | |
download | grpc-grpc-java-5bf4f5b7a69f9c13479f5f7a7a6ed856fe2c0c1d.tar.gz |
context: Use .class literal instead of Class.forName
Found via ErrorProne
Diffstat (limited to 'context')
-rw-r--r-- | context/src/test/java/io/grpc/ContextTest.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/context/src/test/java/io/grpc/ContextTest.java b/context/src/test/java/io/grpc/ContextTest.java index 4f1de7c38..93191bdf2 100644 --- a/context/src/test/java/io/grpc/ContextTest.java +++ b/context/src/test/java/io/grpc/ContextTest.java @@ -832,8 +832,7 @@ public class ContextTest { @Test public void storageReturnsNullTest() throws Exception { - Class<?> contextClass = Class.forName("io.grpc.Context"); - Field storage = contextClass.getDeclaredField("storage"); + Field storage = Context.class.getDeclaredField("storage"); assertTrue(Modifier.isFinal(storage.getModifiers())); // use reflection to forcibly change the storage object to a test object storage.setAccessible(true); |