-
Notifications
You must be signed in to change notification settings - Fork 238
Open
Description
I am unable to use com.ibm.wala.cast.java.translator.jdt.JDTIdentityMapper.getMethodRef(IMethodBinding) to look up a method declared in an AIC. Here's an input example that causes this error:
class A {
void m() {
}
pubic static void main(String[] args) {
new A() {
@Override
void m() {
new ArrayList().stream().count();
}
};
}
}The input method is the m() declaration inside the AIC. Here's the client code:
MethodDeclaration mDecl = // ...
JDTIdentityMapper mapper = getJDTIdentifyMapper(mDecl);
MethodReference methodRef = mapper.getMethodRef(mDecl.resolveBinding());And stack trace from a test I ran:
-- Error Log from JUnit --
Method: testAnonymousInnerClass
Actual: null
Expected: null
Stack Trace:
java.lang.NullPointerException
at com.ibm.wala.cast.java.translator.jdt.JDT2CAstUtils.anonTypeName(JDT2CAstUtils.java:231)
at com.ibm.wala.cast.java.translator.jdt.JDTIdentityMapper.anonLocalTypeToTypeID(JDTIdentityMapper.java:134)
at com.ibm.wala.cast.java.translator.jdt.JDTIdentityMapper.typeToTypeID(JDTIdentityMapper.java:113)
at com.ibm.wala.cast.java.translator.jdt.JDTIdentityMapper.getMethodRef(JDTIdentityMapper.java:182)
Metadata
Metadata
Assignees
Labels
No labels