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
Jodd version: 3.8.6
Java version: Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
OS: macOS Sierra 10.12.5
How to reproduce:
package jodd.proxetta;
import jodd.proxetta.advice.DelegateAdvice;
import jodd.proxetta.impl.ProxyProxetta;
import jodd.proxetta.impl.ProxyProxettaBuilder;
import org.junit.Test;
public class GenericsArrayTest {
public static class Foo<Stuff> {
public Stuff[] getArray() {
return (Stuff[]) new Object[0];
}
public <Thingy> Thingy[] getArrayStatic() {
return (Thingy[]) new Object[0];
}
}
@Test
public void testClassesWithGenericArraysAsReturnValueProxy() {
try {
ProxyAspect aspect = new ProxyAspect(DelegateAdvice.class);
ProxyProxetta proxetta = ProxyProxetta.withAspects(aspect);
ProxyProxettaBuilder builder = proxetta.builder(Foo.class);
builder.newInstance();
} catch (Exception e) {
throw new AssertionError(e);
}
}
}
Result:
java.lang.IllegalArgumentException: Invalid base type: Stuff
at jodd.asm.AsmUtil.typedesc2ClassName(AsmUtil.java:123)
at jodd.proxetta.asm.ProxettaAsmUtil.castToReturnType(ProxettaAsmUtil.java:549)
at jodd.proxetta.asm.ProxettaMethodBuilder$1$1.visitMethodInsn(ProxettaMethodBuilder.java:375)
at jodd.asm5.ClassReader.readCode(ClassReader.java:1429)
at jodd.asm5.ClassReader.readMethod(ClassReader.java:1017)
at jodd.asm5.ClassReader.accept(ClassReader.java:693)
at jodd.asm5.ClassReader.accept(ClassReader.java:506)
at jodd.proxetta.asm.ProxettaMethodBuilder.createProxyMethod(ProxettaMethodBuilder.java:185)
at jodd.proxetta.asm.ProxettaMethodBuilder.visitEnd(ProxettaMethodBuilder.java:103)
at jodd.asm5.ClassReader.readMethod(ClassReader.java:1021)
at jodd.asm5.ClassReader.accept(ClassReader.java:693)
at jodd.asm5.ClassReader.accept(ClassReader.java:506)
at jodd.proxetta.impl.ProxyProxettaBuilder.process(ProxyProxettaBuilder.java:76)
at jodd.proxetta.ProxettaBuilder.process(ProxettaBuilder.java:220)
at jodd.proxetta.ProxettaBuilder.define(ProxettaBuilder.java:255)
at jodd.proxetta.ProxettaBuilder.newInstance(ProxettaBuilder.java:306)
at jodd.proxetta.GenericsArrayTest.testClassesWithGenericArraysAsReturnValueProxy(GenericsArrayTest.java:51)
... 22 more
It will complain about "Thingy" instead if the first method is removed.
The text was updated successfully, but these errors were encountered:
Jodd version: 3.8.6
Java version: Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
OS: macOS Sierra 10.12.5
How to reproduce:
Result:
It will complain about "Thingy" instead if the first method is removed.
The text was updated successfully, but these errors were encountered: