You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since v1.3.0 the TypeResolver throws an AssertionError, when trying to call getBody() on a method like this:
public void method() {
String someString = "Some String";
boolean a = someString.contains("abc");
}
The contains method expects a CharSequence as parameter.
Further investigation showed that this only happens for methods expecting a CharSequence parameter, when directly invoked with a String literal.
Version
Latest develop branch
Relevant log output
java.lang.AssertionError
at sootup.java.core.interceptors.typeresolving.TypePromotionVisitor.visit(TypePromotionVisitor.java:68)
at sootup.java.core.interceptors.typeresolving.TypeChecker.handleInvokeExpr(TypeChecker.java:300)
at sootup.java.core.interceptors.typeresolving.TypeChecker.caseAssignStmt(TypeChecker.java:220)
at sootup.core.jimple.common.stmt.JAssignStmt.accept(JAssignStmt.java:201)
at sootup.core.jimple.common.stmt.JAssignStmt.accept(JAssignStmt.java:59)
at sootup.java.core.interceptors.typeresolving.TypePromotionVisitor.getPromotedTyping(TypePromotionVisitor.java:47)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
at sootup.java.core.interceptors.typeresolving.TypeResolver.resolve(TypeResolver.java:81)
at sootup.java.core.interceptors.TypeAssigner.interceptBody(TypeAssigner.java:42)
at sootup.java.bytecode.frontend.AsmMethodSource.resolveBody(AsmMethodSource.java:234)
at sootup.core.model.SootMethod.lazyBodyInitializer(SootMethod.java:98)
at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
at sootup.core.model.SootMethod.getBody(SootMethod.java:177)
at java.lang.Iterable.forEach(Iterable.java:75)
at sootup.java.bytecode.SpecialCharacterMethodInvocationTest.test(SpecialCharacterMethodInvocationTest.java:24)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at java.util.ArrayList.forEach(ArrayList.java:1259)
The text was updated successfully, but these errors were encountered:
What happened?
Since v1.3.0 the TypeResolver throws an AssertionError, when trying to call
getBody()
on a method like this:The
contains
method expects aCharSequence
as parameter.Further investigation showed that this only happens for methods expecting a
CharSequence
parameter, when directly invoked with a String literal.Version
Latest develop branch
Relevant log output
The text was updated successfully, but these errors were encountered: