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
Generic methods that use the isOverriding method throw exceptions
spoon.SpoonException: Cannot resolve type erasure of the type parameter reference, which is not able to found it's declaration.
at spoon.support.reflect.reference.CtTypeParameterReferenceImpl.getTypeErasure(CtTypeParameterReferenceImpl.java:176)
at spoon.support.adaption.TypeAdaptor.isOverriding(TypeAdaptor.java:418)
at spoon.support.reflect.declaration.CtMethodImpl.isOverriding(CtMethodImpl.java:191)
at com.huawei.tenet.console.SpoonCommandTest.test(SpoonCommandTest.java:75)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
package p12;
public class test2 {
public static class ExtendsEnclosing extends test1.Enclosing<String> {
public class ExtendsEnclosed extends Enclosed<Integer> {
public class ExtendsReallyDeepNow extends ReallyDeepNow<Long> {
@Override
void someMethod(Integer s, String t, Long r) {
throw new UnsupportedOperationException();
}
}
}
}
}
honghao12
changed the title
[Bug]: Generic methods that use the isOverriding method throw exceptions
[Bug]: Generic methods using isoverride method will throw an exception
May 23, 2023
Thanks, this is an oversight with generics inherited from enclosing classes. I've opened a PR with a fix, but I will need to polish it a bit, hopefully today.
If you want you could try out the PR and see if it fixes your original issue.
Describe the bug
Generic methods that use the isOverriding method throw exceptions
Source code you are trying to analyze/transform
p12.test1
p12.test2
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
10.3.0
JVM Version
11
What operating system are you using?
window
The text was updated successfully, but these errors were encountered: