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
In some cases, ClassTypingContext#isOverriding crasheswith an exception:
spoon.SpoonException: Cannot adapt type parameters of non type scope
at spoon.support.visitor.ClassTypingContext.resolveTypeParameters(ClassTypingContext.java:473)
at spoon.support.visitor.ClassTypingContext.access$000(ClassTypingContext.java:62)
at spoon.support.visitor.ClassTypingContext$1.accept(ClassTypingContext.java:234)
at spoon.support.visitor.ClassTypingContext$1.accept(ClassTypingContext.java:203)
at spoon.reflect.visitor.chain.CtQueryImpl$OutputFunctionWrapper._accept(CtQueryImpl.java:471)
at spoon.reflect.visitor.chain.CtQueryImpl$AbstractStep.accept(CtQueryImpl.java:319)
at spoon.reflect.visitor.filter.SuperInheritanceHierarchyFunction.sendResult(SuperInheritanceHierarchyFunction.java:347)
at spoon.reflect.visitor.filter.SuperInheritanceHierarchyFunction.visitSuperClasses(SuperInheritanceHierarchyFunction.java:281)
at spoon.reflect.visitor.filter.SuperInheritanceHierarchyFunction.apply(SuperInheritanceHierarchyFunction.java:248)
at spoon.reflect.visitor.filter.SuperInheritanceHierarchyFunction.apply(SuperInheritanceHierarchyFunction.java:51)
at spoon.reflect.visitor.chain.CtQueryImpl$LazyFunctionWrapper._accept(CtQueryImpl.java:505)
at spoon.reflect.visitor.chain.CtQueryImpl$AbstractStep.accept(CtQueryImpl.java:319)
at spoon.reflect.visitor.chain.CtQueryImpl.forEach(CtQueryImpl.java:105)
at spoon.support.visitor.ClassTypingContext.resolveActualTypeArgumentsOf(ClassTypingContext.java:203)
at spoon.support.visitor.ClassTypingContext.isSubtypeOf(ClassTypingContext.java:133)
at spoon.support.visitor.ClassTypingContext.isOverriding(ClassTypingContext.java:274)
One can reproduce the problem with
Launcherspoon = newLauncher();
spoon.getEnvironment().setCommentEnabled(true);
spoon.addInputResource("src/main/java/");
spoon.buildModel();
List<String> notDocumented = newArrayList<>();
List<CtMethod> list = spoon.getFactory().Package().getRootPackage().filterChildren(x -> xinstanceofCtMethod).list(CtMethod.class);
for (CtMethodm1 : list) {
// going directly to the case the reproduces the bugif (!(
m1.getDeclaringType().getQualifiedName().equals("spoon.reflect.meta.impl.ListHandler$1")
&& m1.getSignature().equals("iterator()"))
) {
continue;
}
Collection<CtMethod<?>> allMethods = m1.getDeclaringType().map(newAllTypeMembersFunction(CtMethod.class)).list();
for (CtMethodm2 : allMethods) {
ClassTypingContextc = newClassTypingContext(m1.getDeclaringType());
System.out.println("trying isOverriding("+m1.getSignature()+", "+m2.getSignature()+")");
// triggerring the exceptionc.isOverriding(m1, m2);
}
}
In some cases,
ClassTypingContext#isOverriding
crasheswith an exception:One can reproduce the problem with
@pvojtechovsky could you have look at this? Thanks!
The text was updated successfully, but these errors were encountered: