forked from JavaTX/JavaCompilerCore
Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode
This commit is contained in:
commit
dc4b1c7b4f
@ -1,6 +1,7 @@
|
|||||||
package targetast;
|
package targetast;
|
||||||
|
|
||||||
import de.dhbwstuttgart.environment.ByteArrayClassLoader;
|
import de.dhbwstuttgart.environment.ByteArrayClassLoader;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@ -381,13 +382,14 @@ public class TestComplete {
|
|||||||
var instance = tph3.getDeclaredConstructor().newInstance();
|
var instance = tph3.getDeclaredConstructor().newInstance();
|
||||||
var m1 = tph3.getDeclaredMethod("m1", Object.class, Object.class);
|
var m1 = tph3.getDeclaredMethod("m1", Object.class, Object.class);
|
||||||
|
|
||||||
// public <DZC> void m1(DZC var1, DZC var2)
|
// public <DXBE extends DXBD, DXBD> void m1(DXBD var1, DXBE var2)
|
||||||
var paraTypes = m1.getGenericParameterTypes();
|
var paraTypes = m1.getGenericParameterTypes();
|
||||||
var typeParaTypes = m1.getTypeParameters();
|
var typeParaTypes = m1.getTypeParameters();
|
||||||
|
|
||||||
var DZC = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[0])).findFirst().get();
|
var DXBD = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[0])).findFirst().get();
|
||||||
assertEquals(DZC, Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[1])).findFirst().get());
|
assertEquals(Object.class, DXBD.getBounds()[0]);
|
||||||
assertEquals(Object.class, DZC.getBounds()[0]);
|
var DXBE = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[1])).findFirst().get();
|
||||||
|
assertEquals(DXBD, DXBE.getBounds()[0]);
|
||||||
|
|
||||||
var m2 = tph3.getDeclaredMethod("m2", Object.class);
|
var m2 = tph3.getDeclaredMethod("m2", Object.class);
|
||||||
|
|
||||||
@ -406,18 +408,17 @@ public class TestComplete {
|
|||||||
var instance = tph4.getDeclaredConstructor().newInstance();
|
var instance = tph4.getDeclaredConstructor().newInstance();
|
||||||
var m = tph4.getDeclaredMethod("m", Object.class, Object.class);
|
var m = tph4.getDeclaredMethod("m", Object.class, Object.class);
|
||||||
|
|
||||||
// public <O extends P, N, P extends M, M> M m(N var1, O var2)
|
// public <N, O, P extends N> N m(O var1, P var2)
|
||||||
var paraTypes = m.getGenericParameterTypes();
|
var paraTypes = m.getGenericParameterTypes();
|
||||||
var typeParaTypes = m.getTypeParameters();
|
var typeParaTypes = m.getTypeParameters();
|
||||||
|
|
||||||
var N = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[0])).findFirst().get();
|
var N = Arrays.stream(typeParaTypes).filter(t -> t.equals(m.getGenericReturnType())).findFirst().get();
|
||||||
assertEquals(Object.class, N.getBounds()[0]);
|
assertEquals(Object.class, N.getBounds()[0]);
|
||||||
|
|
||||||
var O = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[1])).findFirst().get();
|
var O = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[0])).findFirst().get();
|
||||||
var P = Arrays.stream(typeParaTypes).filter(t -> t.equals(O.getBounds()[0])).findFirst().get();
|
var P = Arrays.stream(typeParaTypes).filter(t -> t.equals(paraTypes[1])).findFirst().get();
|
||||||
var M = Arrays.stream(typeParaTypes).filter(t -> t.equals(P.getBounds()[0])).findFirst().get();
|
assertEquals(N, P.getBounds()[0]);
|
||||||
assertEquals(Object.class, M.getBounds()[0]);
|
assertEquals(O.getBounds()[0], Object.class);
|
||||||
assertEquals(M, m.getGenericReturnType());
|
|
||||||
|
|
||||||
var m2 = tph4.getDeclaredMethod("m2", Object.class);
|
var m2 = tph4.getDeclaredMethod("m2", Object.class);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user