99import java .io .PrintStream ;
1010import java .util .ArrayDeque ;
1111import java .util .ArrayList ;
12+ import java .util .Arrays ;
1213import java .util .HashMap ;
1314import java .util .HashSet ;
1415import java .util .List ;
@@ -141,6 +142,9 @@ private Binding[] processRows(List<DataRow> rows) throws IOException {
141142 String classname = dataRow .getBaseClassname ();
142143 boolean isJavaExtend = classes .containsKey (classname );
143144 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+
144148 Binding binding = generateBinding (dataRow , interfaceNames );
145149
146150 if (binding != null ) {
@@ -193,6 +197,9 @@ private Map<String, List<Method>> getPublicApi(JavaClass clazz) {
193197 for (Method m : currentClass .getMethods ()) {
194198 methods .add (m );
195199 }
200+
201+ // System.out.println("SBG: getPublicApi:collectInterfaceMethods classname: " + currentClassname);
202+
196203 collectInterfaceMethods (clazz , methods );
197204 for (Method m : methods ) {
198205 if (!m .isSynthetic () && (m .isPublic () || m .isProtected ()) && !m .isStatic ()) {
@@ -222,7 +229,8 @@ private Map<String, List<Method>> getPublicApi(JavaClass clazz) {
222229 if (currentClassname .equals ("java.lang.Object" )) {
223230 break ;
224231 } else {
225- currentClass = classes .get (currentClass .getSuperclassName ());
232+ String superClassName = currentClass .getSuperclassName ();
233+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
226234 }
227235 }
228236 return api ;
@@ -640,7 +648,14 @@ private void writeType(Type t, Writer w) {
640648
641649 private void collectInterfaceMethods (JavaClass clazz , List <Method > methods ) {
642650 JavaClass currentClass = clazz ;
651+
643652 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+
644659 String currentClassname = currentClass .getClassName ();
645660
646661 Queue <String > queue = new ArrayDeque <String >();
@@ -663,7 +678,8 @@ private void collectInterfaceMethods(JavaClass clazz, List<Method> methods) {
663678 if (currentClassname .equals ("java.lang.Object" )) {
664679 break ;
665680 } else {
666- currentClass = classes .get (currentClass .getSuperclassName ());
681+ String superClassName = currentClass .getSuperclassName ();
682+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
667683 }
668684 }
669685 }
@@ -686,7 +702,8 @@ private boolean isApplicationClass(JavaClass clazz, Map<String, JavaClass> class
686702 break ;
687703 }
688704
689- currentClass = classes .get (currentClass .getSuperclassName ());
705+ String superClassName = currentClass .getSuperclassName ();
706+ currentClass = classes .get (superClassName .replace ('$' , '.' ));
690707 }
691708
692709 return isApplicationClass ;
0 commit comments