25
25
public class RxSuspendableClassifier implements SuspendableClassifier {
26
26
private static final Set <String > CORE_PACKAGES = new HashSet <String >(Arrays .asList (new String []{
27
27
"rx" , "rx.joins" , "rx.observables" , "rx.observers" , "rx.operators" , "rx.plugins" , "rx.schedulers" ,
28
- "rx.subjects" , "rx.subscriptions" , "rx.util" , "rx.util.functions"
28
+ "rx.subjects" , "rx.subscriptions" , "rx.functions" , "rx. util" , "rx.util.functions"
29
29
}));
30
30
31
31
private static final Set <String > EXCEPTIONS = new HashSet <String >(Arrays .asList (new String []{
32
32
"rx/observers/SynchronizedObserver" ,
33
- "rx/schedulers/AbstractSchedulerTests$ConcurrentObserverValidator" ,}));
33
+ "rx/schedulers/AbstractSchedulerTests$ConcurrentObserverValidator" ,
34
+ }));
34
35
35
36
private static final Set <String > OBSERVER_METHODS = new HashSet <String >(Arrays .asList (new String []{
36
37
"onNext(Ljava/lang/Object;)V" , "onCompleted()V" , "onError(Ljava/lang/Throwable;)V"
@@ -47,6 +48,12 @@ public MethodDatabase.SuspendableType isSuspendable(MethodDatabase db, String cl
47
48
else if (isUtilFunction (db , className , superClassName , interfaces , methodName , methodDesc ))
48
49
s = MethodDatabase .SuspendableType .SUSPENDABLE ;
49
50
}
51
+ if (s == null
52
+ && methodName .equals ("call" )
53
+ && (className .startsWith ("rx/functions/Func" ) || className .startsWith ("rx/functions/Action" )
54
+ || className .startsWith ("rx/util/functions/Func" ) || className .startsWith ("rx/util/functions/Action" ))) {
55
+ s = MethodDatabase .SuspendableType .SUSPENDABLE_SUPER ;
56
+ }
50
57
// System.out.println("-- " + className + "." + methodName + ": " + s);
51
58
return s ;
52
59
}
@@ -62,9 +69,12 @@ private static boolean isObserverImplementation(MethodDatabase db, String classN
62
69
}
63
70
64
71
private static boolean isUtilFunction (MethodDatabase db , String className , String superClassName , String [] interfaces , String methodName , String methodDesc ) {
65
- return (className .startsWith ("rx/util/functions/Functions" ) || className .startsWith ("rx/util/functions/Actions" ))
72
+ return (className .startsWith ("rx/functions/Functions" ) || className .startsWith ("rx/functions/Actions" )
73
+ || className .startsWith ("rx/util/functions/Functions" ) || className .startsWith ("rx/util/functions/Actions" ))
66
74
&& methodName .equals (FUNCTION_METHOD )
67
- && (SimpleSuspendableClassifier .extendsOrImplements ("rx/util/functions/Function" , db , className , superClassName , interfaces )
75
+ && (SimpleSuspendableClassifier .extendsOrImplements ("rx/functions/Function" , db , className , superClassName , interfaces )
76
+ || SimpleSuspendableClassifier .extendsOrImplements ("rx/functions/Action" , db , className , superClassName , interfaces )
77
+ || SimpleSuspendableClassifier .extendsOrImplements ("rx/util/functions/Function" , db , className , superClassName , interfaces )
68
78
|| SimpleSuspendableClassifier .extendsOrImplements ("rx/util/functions/Action" , db , className , superClassName , interfaces ));
69
79
}
70
80
0 commit comments