@@ -25,7 +25,6 @@ public class BlackReflectionProxy {
25
25
26
26
private final ClassName mContextInterface ;
27
27
private final ClassName mStaticInterface ;
28
- private final ClassName mInterface ;
29
28
private final String mPackageName ;
30
29
31
30
public BlackReflectionProxy (String packageName , BlackReflectionInfo reflection ) {
@@ -37,7 +36,6 @@ public BlackReflectionProxy(String packageName, BlackReflectionInfo reflection)
37
36
38
37
mContextInterface = ClassName .get (ClassUtils .getPackage (finalClass ), ClassUtils .getName (finalClass + "Context" ));
39
38
mStaticInterface = ClassName .get (ClassUtils .getPackage (finalClass ), ClassUtils .getName (finalClass + "Static" ));
40
- mInterface = ClassName .get (ClassUtils .getPackage (finalClass ), ClassUtils .getName (finalClass ));
41
39
}
42
40
43
41
public JavaFile generateJavaCode () {
@@ -52,7 +50,7 @@ public JavaFile generateJavaCode() {
52
50
.addMethod (generaNotCallerMethod (false ))
53
51
.addMethod (generaCallerMethod (true ))
54
52
.addMethod (generaCallerMethod (false ))
55
- .addMethod (generaGetRealClassMethod ())
53
+ .addMethod (generaIsLoadMethod ())
56
54
.build ();
57
55
return JavaFile .builder (mPackageName , reflection ).build ();
58
56
}
@@ -85,14 +83,14 @@ private MethodSpec generaCallerMethod(boolean withException) {
85
83
return builder .build ();
86
84
}
87
85
88
- private MethodSpec generaGetRealClassMethod () {
86
+ private MethodSpec generaIsLoadMethod () {
89
87
MethodSpec .Builder builder = MethodSpec .methodBuilder ("getRealClass" )
90
88
.addModifiers (Modifier .PUBLIC , Modifier .STATIC )
91
89
.returns (ClassName .get (Class .class ));
92
90
93
91
String statement = "return top.niunaijun.blackreflection.utils.ClassUtil.classReady($T.class)" ;
94
92
builder .addStatement (statement ,
95
- mInterface
93
+ mContextInterface
96
94
);
97
95
return builder .build ();
98
96
}
0 commit comments