Skip to content

Commit 5bf4f5b

Browse files
committed
context: Use .class literal instead of Class.forName
Found via ErrorProne
1 parent bd28b92 commit 5bf4f5b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

context/src/test/java/io/grpc/ContextTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,7 @@ public String call() {
832832

833833
@Test
834834
public void storageReturnsNullTest() throws Exception {
835-
Class<?> contextClass = Class.forName("io.grpc.Context");
836-
Field storage = contextClass.getDeclaredField("storage");
835+
Field storage = Context.class.getDeclaredField("storage");
837836
assertTrue(Modifier.isFinal(storage.getModifiers()));
838837
// use reflection to forcibly change the storage object to a test object
839838
storage.setAccessible(true);

0 commit comments

Comments
 (0)