Update to java 20 and some refactoring

This commit is contained in:
Daniel Holle 2023-06-22 09:34:15 +02:00
parent 4a18a81b33
commit 711aa70d48
26 changed files with 9 additions and 7 deletions

View File

@ -54,8 +54,8 @@ http://maven.apache.org/maven-v4_0_0.xsd">
<version>3.8.0</version> <version>3.8.0</version>
<configuration> <configuration>
<compilerArgs>--enable-preview</compilerArgs> <compilerArgs>--enable-preview</compilerArgs>
<source>19</source> <source>20</source>
<target>19</target> <target>20</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -112,8 +112,8 @@ http://maven.apache.org/maven-v4_0_0.xsd">
</repository> </repository>
</repositories> </repositories>
<properties> <properties>
<maven.compiler.source>19</maven.compiler.source> <maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>19</maven.compiler.target> <maven.compiler.target>20</maven.compiler.target>
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass> <mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
</properties> </properties>
<distributionManagement> <distributionManagement>

View File

@ -10,4 +10,5 @@ class TPHsAndGenerics2 {
m2(a, b){ m2(a, b){
return b; return b;
} }
} }

View File

@ -3,7 +3,9 @@ import java.util.Vector;
public class TestVector { public class TestVector {
m(v, w) { m(v, w) {
w.addElement(id(v.elementAt(0))); var a = v.elementAt(0);
var b = id(a);
w.addElement(b);
} }
id(x) { id(x) {

View File

@ -10,4 +10,3 @@ public class Lambda {
return lam1.apply(new Apply()); return lam1.apply(new Apply());
} }
} }

View File

@ -1,4 +1,3 @@
import java.lang.Integer;
import java.lang.Double; import java.lang.Double;
import java.lang.String; import java.lang.String;
import java.lang.Long; import java.lang.Long;

View File

@ -677,6 +677,7 @@ public abstract class GenerateGenerics {
if (!added) break; if (!added) break;
} }
System.out.println(chain + " " + chain.stream().map(e -> e.resolve().getVariance()).toList());
var variance = chain.get(0).resolve().getVariance(); var variance = chain.get(0).resolve().getVariance();
if (variance != 1) continue; if (variance != 1) continue;
var index = 0; var index = 0;