File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -763,10 +763,27 @@ public static boolean matches(SSAInstruction instruction, MethodInvocation invoc
763
763
764
764
private static boolean matches (TypeReference methodDeclaringType , MethodReference method ,
765
765
MethodInvocation invocation ) {
766
- if (getBinaryName (methodDeclaringType ).equals (invocation .getExpression ().resolveTypeBinding ().getBinaryName ()))
767
- // FIXME: This matching needs much work #153.
768
- if (method .getName ().toString ().equals (invocation .resolveMethodBinding ().getName ()))
769
- return true ;
766
+ String declaringTypeBinaryName = getBinaryName (methodDeclaringType );
767
+
768
+ if (declaringTypeBinaryName != null ) {
769
+ Expression expression = invocation .getExpression ();
770
+
771
+ if (expression != null ) {
772
+ ITypeBinding typeBinding = expression .resolveTypeBinding ();
773
+
774
+ if (typeBinding != null ) {
775
+ String expressionBinaryName = typeBinding .getBinaryName ();
776
+
777
+ if (declaringTypeBinaryName .equals (expressionBinaryName ))
778
+ // FIXME: This matching needs much work #153.
779
+ if (method .getName ().toString ().equals (invocation .resolveMethodBinding ().getName ()))
780
+ return true ;
781
+ } else
782
+ LOGGER .warning ("typeBinding is null for expression: " + expression );
783
+ } else
784
+ LOGGER .warning ("expression is null for invocation: " + invocation );
785
+ } else
786
+ LOGGER .warning ("Binary name is null for method declarying type: " + methodDeclaringType );
770
787
return false ;
771
788
}
772
789
You can’t perform that action at this time.
0 commit comments