modified: ../../pom.xml

new file:   Iteration.jav
	modified:   Pair.jav
	modified:   ../../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   ../../src/test/java/AllgemeinTest.java
This commit is contained in:
pl@gohorb.ba-horb.de 2023-06-05 13:14:00 +02:00
parent dce3ed8051
commit 3c86eecf8b
5 changed files with 41 additions and 4 deletions

View File

@ -42,7 +42,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>7.0</version>
<version>9.5</version>
</dependency>
</dependencies>

View File

@ -0,0 +1,36 @@
/*
class Pair<T, U> {
T x;
U y;
public Pair() { }
public Pair(T x, U y) {
this.x = x;
this.y = y;
}
public T fst () {
return x;
}
public U snd () {
return y;
}
}
*/
public class Iteration {
m1(x, y) {
var help;
help = m2(x, y);
var y2 = help.snd();
return new Pair<>(y2,x);
}
m2(x,y) {
var help = m1(x, y);
var x2 = help.fst();
return new Pair<>(y, x2);
}
}

View File

@ -13,7 +13,7 @@ class Pair<U, T> {
return ret;
}
eq(a, b) {
b = a;
return a == b;

View File

@ -557,7 +557,7 @@ public class JavaTXCompiler {
break;
}
}
if (!found) newClasses.add(clazz);
if (!found) allClasses.add(clazz);
}
}

View File

@ -55,7 +55,8 @@ public class AllgemeinTest {
//String className = "Pair";
//String className = "UseWildcardPair";
//String className = "Assign";
String className = "StreamTest";
//String className = "StreamTest";
String className = "Iteration";
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav";
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";