[KeepAnno] Use getField in reflective lookup.
The tsym symbol is defined on a parent class.
Change-Id: Ia4425404034f0c53583225617ea262a00bfb4e30
diff --git a/src/keepanno/java/com/android/tools/r8/keepanno/processor/KeepEdgeProcessor.java b/src/keepanno/java/com/android/tools/r8/keepanno/processor/KeepEdgeProcessor.java
index 817b069..c86857d 100644
--- a/src/keepanno/java/com/android/tools/r8/keepanno/processor/KeepEdgeProcessor.java
+++ b/src/keepanno/java/com/android/tools/r8/keepanno/processor/KeepEdgeProcessor.java
@@ -131,8 +131,8 @@
// sun.tools internals to extract it. If not, this code will not work for inner classes as
// we cannot recover the $ separator.
try {
- Object tsym = type.getClass().getDeclaredField("tsym").get(type);
- Object flatname = tsym.getClass().getDeclaredField("flatname").get(tsym);
+ Object tsym = type.getClass().getField("tsym").get(type);
+ Object flatname = tsym.getClass().getField("flatname").get(tsym);
return flatname.toString();
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new KeepEdgeException("Unable to obtain the class type name for: " + type);