9
9
import java .io .PrintStream ;
10
10
import java .util .ArrayDeque ;
11
11
import java .util .ArrayList ;
12
+ import java .util .Arrays ;
12
13
import java .util .HashMap ;
13
14
import java .util .HashSet ;
14
15
import java .util .List ;
@@ -141,6 +142,9 @@ private Binding[] processRows(List<DataRow> rows) throws IOException {
141
142
String classname = dataRow .getBaseClassname ();
142
143
boolean isJavaExtend = classes .containsKey (classname );
143
144
if (isJavaExtend ) {
145
+
146
+ // System.out.println("SBG: DataRow: baseClassName: " + classname + ", suffix: " + dataRow.getSuffix() + ", interfaces: " + String.join(", ", Arrays.asList(dataRow.getInterfaces())) + ", jsFileName: " + dataRow.getJsFilename());
147
+
144
148
Binding binding = generateBinding (dataRow , interfaceNames );
145
149
146
150
if (binding != null ) {
@@ -193,6 +197,9 @@ private Map<String, List<Method>> getPublicApi(JavaClass clazz) {
193
197
for (Method m : currentClass .getMethods ()) {
194
198
methods .add (m );
195
199
}
200
+
201
+ // System.out.println("SBG: getPublicApi:collectInterfaceMethods classname: " + currentClassname);
202
+
196
203
collectInterfaceMethods (clazz , methods );
197
204
for (Method m : methods ) {
198
205
if (!m .isSynthetic () && (m .isPublic () || m .isProtected ()) && !m .isStatic ()) {
@@ -222,7 +229,8 @@ private Map<String, List<Method>> getPublicApi(JavaClass clazz) {
222
229
if (currentClassname .equals ("java.lang.Object" )) {
223
230
break ;
224
231
} else {
225
- currentClass = classes .get (currentClass .getSuperclassName ());
232
+ String superClassName = currentClass .getSuperclassName ();
233
+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
226
234
}
227
235
}
228
236
return api ;
@@ -640,7 +648,14 @@ private void writeType(Type t, Writer w) {
640
648
641
649
private void collectInterfaceMethods (JavaClass clazz , List <Method > methods ) {
642
650
JavaClass currentClass = clazz ;
651
+
643
652
while (true ) {
653
+ if (currentClass == null ) {
654
+ System .out .println ("Contains android.support.v7.widget.RecyclerView$Adapter: " + classes .keySet ().contains ("android.support.v7.widget.RecyclerView$Adapter" ));
655
+
656
+ System .out .println ("Contains android.support.v7.widget.RecyclerView.Adapter: " + classes .keySet ().contains ("android.support.v7.widget.RecyclerView.Adapter" ));
657
+ }
658
+
644
659
String currentClassname = currentClass .getClassName ();
645
660
646
661
Queue <String > queue = new ArrayDeque <String >();
@@ -663,7 +678,8 @@ private void collectInterfaceMethods(JavaClass clazz, List<Method> methods) {
663
678
if (currentClassname .equals ("java.lang.Object" )) {
664
679
break ;
665
680
} else {
666
- currentClass = classes .get (currentClass .getSuperclassName ());
681
+ String superClassName = currentClass .getSuperclassName ();
682
+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
667
683
}
668
684
}
669
685
}
@@ -686,7 +702,8 @@ private boolean isApplicationClass(JavaClass clazz, Map<String, JavaClass> class
686
702
break ;
687
703
}
688
704
689
- currentClass = classes .get (currentClass .getSuperclassName ());
705
+ String superClassName = currentClass .getSuperclassName ();
706
+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
690
707
}
691
708
692
709
return isApplicationClass ;
0 commit comments