modified: src/test/java/AllgemeinTest.java

new file:   src/test/resources/AllgemeinTest/M.jav
	new file:   src/test/resources/AllgemeinTest/Put.jav
	new file:   src/test/resources/AllgemeinTest/Test.jav
	new file:   src/test/resources/AllgemeinTest/TestSubTypless.jav
	new file:   src/test/resources/AllgemeinTest/Twice.jav
	new file:   src/test/resources/AllgemeinTest/Var.jav
	new file:   src/test/resources/AllgemeinTest/Wildcard_Andi.jav
	new file:   src/test/resources/AllgemeinTest/addList.jav
This commit is contained in:
pl@gohorb.ba-horb.de 2022-07-28 09:04:25 +02:00
parent 2f3d3e1bb9
commit 9fc558c21a
9 changed files with 70 additions and 1 deletions

View File

@ -41,7 +41,10 @@ public class AllgemeinTest {
//String className = "Var";
//String className = "Put";
//String className = "Twice";
String className = "TestSubTypless";
//String className = "TestSubTypless";
//String className = "addList";
//String className = "M";
String className = "Wildcard_Andi";
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/" + className + ".jav";
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";

View File

@ -0,0 +1,7 @@
import java.util.List;
class M {
void m(p, p2){
new addList().addLists(p, p2);
}
}

View File

@ -0,0 +1,19 @@
import java.util.Vector;
import java.util.Stack;
class Put {
putElement(ele, v) {
v.addElement(ele);
}
putElement(ele, s) {
s.push(ele);
}
main(ele, x) {
putElement(ele, x);
}
}

View File

@ -0,0 +1,4 @@
class Test {
a;
Test b;
}

View File

@ -0,0 +1,12 @@
import java.util.ArrayList;
class TestSubTypless {
m(a){
var l = new ArrayList<>();
l.add(a);
return m2(l).get(0);
}
m2(a){
return m(a);
}
}

View File

@ -0,0 +1,3 @@
class Twice {
twice = f -> x -> f.apply(f.apply(x));
}

View File

@ -0,0 +1,5 @@
class Var {
var(x) { var y; }
}

View File

@ -0,0 +1,8 @@
class Wildcard_Andi {
Test<? extends A> ex = new Test<>();
Test<? super A> sup = new Test<>();
}

View File

@ -0,0 +1,8 @@
import java.util.List;
class addList {
addLists(a, b){
a.add(b.get(0));
b.add(a.get(0));
}
}