Compare commits
213 Commits
fixPlugin
...
fba7f0ee81
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fba7f0ee81 | ||
|
|
e0da2a4c46 | ||
| f588ece7c3 | |||
| 9ad5b76542 | |||
| 3d2c699964 | |||
| f95c3c5fcf | |||
| 4654ecacaf | |||
| 1be27746e3 | |||
|
|
c51190feef | ||
|
|
c4ce97f20c | ||
| 837317c84c | |||
|
|
df852ef36e | ||
|
|
c00722823a | ||
| e31f1c59e1 | |||
| 5d0d7a6d94 | |||
| b372c6ac1c | |||
| 124dea2e58 | |||
| eaef00ff54 | |||
| 892ba5fff0 | |||
| 628f1631e8 | |||
| 0b815950e1 | |||
| f10e7e6d72 | |||
| 700ecf3e5d | |||
|
|
f7c53fc6c3 | ||
|
|
9764ec6db1 | ||
|
|
b21faa30fc | ||
|
|
87f8b8799e | ||
|
|
769f1bb677 | ||
|
|
5623fdc020 | ||
|
|
dfd91b5f8b | ||
|
|
3c43978c55 | ||
|
|
fb7b51a971 | ||
| 56c360104b | |||
| e414da3369 | |||
| 5f1f698530 | |||
| 729e88bc6d | |||
| bffc7f9f1c | |||
| 011b272af6 | |||
| ee359da751 | |||
| 6025e17186 | |||
| 93d7aca9e6 | |||
| 677c784b6d | |||
| e69a367c33 | |||
| 14d0475d59 | |||
| 762d344e42 | |||
| be5591f7dc | |||
| 7193f5a646 | |||
| f46c2ad0f7 | |||
| b0f7a264c2 | |||
| 4f3164a48a | |||
| be55d661cb | |||
| 3de9fde672 | |||
| a0582e918b | |||
|
|
18429d9cf9 | ||
|
|
b65df7c390 | ||
|
|
22d1be5ea4 | ||
|
|
18fc82f036 | ||
|
|
f5b843ec11 | ||
|
|
bad5d26969 | ||
|
|
951d741d90 | ||
|
|
fe6c9858a2 | ||
|
|
1df354d5f1 | ||
|
|
6119bc92ed | ||
|
|
e8140b3160 | ||
|
|
75789e574e | ||
|
|
c0c46e197f | ||
|
|
a0e6df7cfd | ||
|
|
1643412f1b | ||
|
|
3ed6edc323 | ||
|
|
fa7a331a66 | ||
|
|
939d402b1e | ||
|
|
492cbe48e9 | ||
| a17e1f473a | |||
|
|
359f3e68ab | ||
| 5c62191f3b | |||
| b04201de42 | |||
|
|
a15cbcba7b | ||
|
|
9019d90b1e | ||
| d07b2bdf0a | |||
| d05054755c | |||
|
|
1a89920430 | ||
|
|
54a836b734 | ||
|
|
8b3b07e32c | ||
| d55b402269 | |||
|
|
24900b8fcc | ||
|
|
2368a087c0 | ||
|
|
994a1571b7 | ||
|
|
aed1d3848b | ||
|
|
93cf39cfe9 | ||
| bdaf578f86 | |||
| 6079e96efa | |||
| bb01e78123 | |||
|
|
41d8e223ce | ||
| e1e1f3eafc | |||
| 9c1e016bb1 | |||
|
|
eaeb3c4106 | ||
|
|
1fb431ab36 | ||
|
|
124313cb16 | ||
|
|
d48b888075 | ||
| f5aa90bdbd | |||
| 4bcb91ce2d | |||
| 97a1bcbbe1 | |||
| f32b1ee5b2 | |||
| 711aa70d48 | |||
|
|
168a499811 | ||
|
|
d52fbeb1ae | ||
|
|
ce0ef10c8d | ||
|
|
81e19f5315 | ||
|
|
89a791b81e | ||
|
|
2d1caf9ded | ||
|
|
49b0494f36 | ||
|
|
60e2d8177b | ||
|
|
62e7a1c871 | ||
|
|
761dd48fa1 | ||
| 4a18a81b33 | |||
| 9eb0dd1cf5 | |||
| bb0ee7d517 | |||
| fe2b3accb3 | |||
|
|
78ad7bc003 | ||
|
|
f08744479a | ||
|
|
bf15ff693e | ||
|
|
48199b5d2e | ||
|
|
7556b9f590 | ||
| 03b7f12541 | |||
| ecc5dfcef6 | |||
| f33aab9cfb | |||
| 3875de7f80 | |||
|
|
69f44c2927 | ||
|
|
26398a692f | ||
|
|
e13baa8acb | ||
|
|
3c86eecf8b | ||
|
|
63c5cb8390 | ||
|
|
e3edd0410a | ||
|
|
eb5cf1ab33 | ||
| b409175a25 | |||
|
|
a54938cb65 | ||
|
|
30a62a6621 | ||
| dce3ed8051 | |||
| 8e5a20e59e | |||
| 337ff8b865 | |||
| 1d7e755a98 | |||
| 67a582b4a2 | |||
|
|
034a398515 | ||
|
|
58a72b0286 | ||
| 677d68428d | |||
| d2ef5ccb24 | |||
| 66944cf3c1 | |||
|
|
9d9a1f6614 | ||
|
|
0b33948945 | ||
|
|
5e1631439a | ||
| 8992260264 | |||
| f8f76e9f7d | |||
|
|
52b7040337 | ||
|
|
4986fd0f31 | ||
|
|
dc8578632c | ||
|
|
9a780127c0 | ||
|
|
0311f5ed77 | ||
|
|
b1b7c23166 | ||
|
|
0ca32ca6a7 | ||
|
|
1ab0f42fd1 | ||
| 856d343ed3 | |||
| 2c7037708b | |||
|
|
78a898db37 | ||
| aeb4b18069 | |||
| 79c82c122a | |||
| 27ee00b069 | |||
| af28e033a2 | |||
| 761e693984 | |||
|
|
d6c22a60bc | ||
|
|
a8012a3ea6 | ||
|
|
31ee90b3ff | ||
|
|
96d19efa5d | ||
|
|
1919e34eed | ||
|
|
043dda660b | ||
|
|
8c6a614157 | ||
|
|
09cc88062e | ||
|
|
2197e09307 | ||
|
|
d362858184 | ||
|
|
c118c05bb2 | ||
|
|
aa5f79257e | ||
|
|
f282d7a212 | ||
|
|
4c685a9ed9 | ||
|
|
55636436d2 | ||
|
|
5981a9362c | ||
|
|
c38bf658fc | ||
|
|
0e981ce95c | ||
|
|
40d0d6b63e | ||
|
|
a77970b5e7 | ||
|
|
ca327375c8 | ||
|
|
4f4ca50c75 | ||
|
|
1cf23bec90 | ||
|
|
3bdc3b764d | ||
|
|
a13294edf4 | ||
|
|
a85b60b95f | ||
| def76724b5 | |||
|
|
eb5a339f56 | ||
|
|
d6b25bc76e | ||
|
|
c78a148766 | ||
|
|
cb564dc436 | ||
|
|
6d52949215 | ||
|
|
b0bec83900 | ||
|
|
0ee3117d6e | ||
|
|
96142339e0 | ||
|
|
3cf076fd82 | ||
| 2e4cd0384f | |||
|
|
a7dc943692 | ||
|
|
4b6d69d748 | ||
|
|
1145f010c6 | ||
|
|
d89e414ca7 | ||
|
|
58cd490639 | ||
| f444003aee | |||
|
|
df3e2b55f9 | ||
|
|
09ac2fc5cf |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,7 +19,9 @@ bin
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.project
|
.project
|
||||||
.settings/
|
.settings/
|
||||||
|
.vscode/
|
||||||
/target/
|
/target/
|
||||||
|
settings.json
|
||||||
|
|
||||||
#
|
#
|
||||||
manually/
|
manually/
|
||||||
|
|||||||
@@ -9,3 +9,6 @@ Stand: 24.5.21
|
|||||||
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
|
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
|
||||||
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
|
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
|
||||||
|
|
||||||
|
Stand 21.2.23
|
||||||
|
unif23: Testbranch fuer Tagungseinrecihung Unif23
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
doc/Studienarbeiten_Bachelorarbeiten/S2022_Daniel_Holle.pdf
Normal file
BIN
doc/Studienarbeiten_Bachelorarbeiten/S2022_Daniel_Holle.pdf
Normal file
Binary file not shown.
14165
doc/Studienarbeiten_Bachelorarbeiten/S2023_Luca_Trumpfheller.pdf
Normal file
14165
doc/Studienarbeiten_Bachelorarbeiten/S2023_Luca_Trumpfheller.pdf
Normal file
File diff suppressed because it is too large
Load Diff
24
doc/pluginBau.md
Normal file
24
doc/pluginBau.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
## Bau und installation des Eclipse plugins
|
||||||
|
|
||||||
|
1. Zunächst muss der JavaTX Compiler gebaut werden. Dafür wird im Rootverzeichnis des JavaTX Compilers
|
||||||
|
`mvn install` ausgeführt. Falls die Tests nicht laufen kann das mit `-DskipTests` beseitigt werden.
|
||||||
|
|
||||||
|
2. Dann muss das Plugin gebaut werden. Dafür muss ebenfalls `mvn install` ausgeführt werden, im Rootverzeichnis des Plugins.
|
||||||
|
Falls es dabei zu Fehlern mit der Java-Version kommen sollte muss man in ~\.mavenrc oder \~.mavenrc_pre.bat die Zeile
|
||||||
|
`set JAVA_HOME=<JDK-19-Pfad>` (Windows) oder `JAVA_HOME="<JDK-19-Pfad>"` (Linux) einfügen. Damit sollte maven korrekt konfiguriert sein.
|
||||||
|
|
||||||
|
3. Als letzter Schritt muss nun das Plugin in Eclipse geladen werden. Wichtig dabei ist, dass Eclipse selber mit Java 19 startet.
|
||||||
|
Dafür kann die Datei `eclipse.ini` angepasst werden die im Installationsverzeichnis von Eclipse vorhanden ist. Hier müssen zwei Zeilen
|
||||||
|
eingetragen werden:
|
||||||
|
```
|
||||||
|
-vm
|
||||||
|
<JDK-19-Pfad>/javaw.exe
|
||||||
|
```
|
||||||
|
Ganz am Anfang der Datei
|
||||||
|
und unter -vmargs die Option `--enable-preview`
|
||||||
|
|
||||||
|
4. Das gebaute Plugin befindet sich unter `JavaCompilerPlugin\releng\JavaCompilerPlugin.Update\target`
|
||||||
|
Um dieses Plugin in Eclipse laden zu können muss den Dialog `Help > Install new Software` öffnen. Oben rechts steht die Option `Add...`
|
||||||
|
Im sich öffnenden Dialog muss man `Archive` anklicken und dort das Zip Archiv aus dem Oben genannten Pfad einfügen. Nun mit Add den Dialog schließen.
|
||||||
|
Als letztes muss in der Liste oben der Eintrag `JavaCompilerPlugin.Update` ausgewählt werden. Hier sollte nun unten das Plugin angezeigt werden.
|
||||||
|
Einfach auswählen und unten Next drücken. Damit sollte der Vorgang abgeschlossen sein.
|
||||||
24
pom.xml
24
pom.xml
@@ -42,7 +42,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ow2.asm</groupId>
|
<groupId>org.ow2.asm</groupId>
|
||||||
<artifactId>asm</artifactId>
|
<artifactId>asm</artifactId>
|
||||||
<version>7.0</version>
|
<version>9.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@@ -51,13 +51,24 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.11.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerArgs>--enable-preview</compilerArgs>
|
<compilerArgs>--enable-preview</compilerArgs>
|
||||||
<source>19</source>
|
<source>21</source>
|
||||||
<target>19</target>
|
<target>21</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<configuration>
|
||||||
|
<argLine>--enable-preview</argLine>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4-maven-plugin</artifactId>
|
<artifactId>antlr4-maven-plugin</artifactId>
|
||||||
@@ -74,6 +85,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.3.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
@@ -112,8 +124,6 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>19</maven.compiler.source>
|
|
||||||
<maven.compiler.target>19</maven.compiler.target>
|
|
||||||
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
||||||
</properties>
|
</properties>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -123,4 +133,4 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
|||||||
<url>file:///${project.basedir}/maven-repository/</url>
|
<url>file:///${project.basedir}/maven-repository/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
class Box<A>{
|
|
||||||
void m(A a){}
|
|
||||||
}
|
|
||||||
|
|
||||||
class B { }
|
|
||||||
|
|
||||||
class Box_Main extends B {
|
|
||||||
|
|
||||||
m(b) {
|
|
||||||
b.m(new Box_Main());
|
|
||||||
b.m(new B());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
class Box<A>{
|
|
||||||
A f;
|
|
||||||
}
|
|
||||||
|
|
||||||
class B { }
|
|
||||||
|
|
||||||
class Box_Main extends B {//Fehler Bugzilla Bug 230
|
|
||||||
|
|
||||||
m(b) {
|
|
||||||
b.f = new Box_Main();
|
|
||||||
b.f = new B();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
22
resources/AllgemeinTest/Complex.jav
Normal file
22
resources/AllgemeinTest/Complex.jav
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
class Pair<U, T> {
|
||||||
|
U a;
|
||||||
|
T b;
|
||||||
|
Pair(U x, T y) {
|
||||||
|
a = x; b = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Complex {
|
||||||
|
m(b) {
|
||||||
|
var c = b;
|
||||||
|
var d = c;
|
||||||
|
var e;
|
||||||
|
d = e;
|
||||||
|
var r1 = e;
|
||||||
|
var f = e;
|
||||||
|
var g;
|
||||||
|
f = g;
|
||||||
|
var r2 = g;
|
||||||
|
return new Pair<>(r1, r2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.util.List;
|
|
||||||
import java.lang.Integer;
|
|
||||||
|
|
||||||
class FCTest1 extends Vector<Vector<Integer>> {
|
|
||||||
fc1() {
|
|
||||||
var y;
|
|
||||||
var z;
|
|
||||||
y.add(z);
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.util.List;
|
|
||||||
import java.lang.Integer;
|
|
||||||
|
|
||||||
class FCTest2 extends Vector<Vector<Integer>> {
|
|
||||||
fc2(y) {
|
|
||||||
var z;
|
|
||||||
y.add(z);
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.lang.Integer;
|
|
||||||
|
|
||||||
class FCTest3 extends Pair<Vector<Integer>, Vector<Integer>> {
|
|
||||||
|
|
||||||
|
|
||||||
fc2(x) {
|
|
||||||
x.snd().addElement(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fc2a() {
|
|
||||||
var y;
|
|
||||||
y.snd().addElement(2);
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import java.lang.Integer;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
public class GenTest {
|
|
||||||
|
|
||||||
main(x) {
|
|
||||||
var v = new Vector();
|
|
||||||
return 1 + v.elementAt(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class Generics {
|
|
||||||
a;
|
|
||||||
id(b) { return b; }
|
|
||||||
setA(x) {
|
|
||||||
a = x;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
m(x,y) { x = id(y); }
|
|
||||||
}
|
|
||||||
7
resources/AllgemeinTest/InfReturn.jav
Normal file
7
resources/AllgemeinTest/InfReturn.jav
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
public class InfReturn {
|
||||||
|
m(a) {
|
||||||
|
var ret;
|
||||||
|
a = ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
resources/AllgemeinTest/InfReturnII.jav
Normal file
8
resources/AllgemeinTest/InfReturnII.jav
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
public class InfReturnII {
|
||||||
|
m(a, b) {
|
||||||
|
var ret;
|
||||||
|
a = ret;
|
||||||
|
b = ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
7
resources/AllgemeinTest/InnerInf.jav
Normal file
7
resources/AllgemeinTest/InnerInf.jav
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
class InnerInf {
|
||||||
|
m(a, b) {
|
||||||
|
var i;
|
||||||
|
a = i;
|
||||||
|
b = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
resources/AllgemeinTest/Iteration.jav
Normal file
43
resources/AllgemeinTest/Iteration.jav
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
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 {
|
||||||
|
id(x) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
m1(x, y) {
|
||||||
|
var help;
|
||||||
|
help = m2(x, y);
|
||||||
|
var y2 = help.snd();
|
||||||
|
var x2 = id(x);
|
||||||
|
return new Pair<>(x2,y2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
m2(x,y) {
|
||||||
|
var help = m1(x, y);
|
||||||
|
var x2 = help.fst();
|
||||||
|
var y2 = id(y);
|
||||||
|
return new Pair<>(x2, y2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import java.util.List;
|
|
||||||
class M {
|
|
||||||
void m(p, p2){
|
|
||||||
|
|
||||||
new addList().addLists(p, p2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
7
resources/AllgemeinTest/Overloading.jav
Normal file
7
resources/AllgemeinTest/Overloading.jav
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Double;
|
||||||
|
|
||||||
|
class Overloading {
|
||||||
|
m(x) { return x + x; }
|
||||||
|
m(x) { return x || x; }
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import java.util.Stack;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
class OverloadingMain {
|
|
||||||
|
|
||||||
mmMain(x) { var y; return new O1().mm(y); }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import java.lang.Integer;
|
|
||||||
|
|
||||||
|
|
||||||
public class Overloading_Generics {
|
|
||||||
|
|
||||||
id1 (x) { return x; }
|
|
||||||
|
|
||||||
//Integer id (Integer x) { return x; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Overloading_Generics1 {
|
|
||||||
main(x) {
|
|
||||||
var olg = new Overloading_Generics();
|
|
||||||
return olg.id1(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
class OverrideMain {
|
|
||||||
ovrMain(x) {
|
|
||||||
var overide;
|
|
||||||
overide.ovr(x);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
[
|
|
||||||
[(TPH L = java.util.Stack<TPH FTM>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH FTN, TPH FTM), (TPH K = void)],
|
|
||||||
[(TPH FTO, TPH FTP), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Stack<TPH FTP>), (TPH K = void)],
|
|
||||||
[(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH K = void), (TPH FTR, TPH FTQ), (TPH L = java.util.Vector<TPH FTQ>)],
|
|
||||||
[(TPH FTT, TPH FTS), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTS>), (TPH K = void), (TPH N = java.lang.String)],
|
|
||||||
[(TPH L = java.util.Vector<TPH FTV>), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH FTU, TPH FTV), (TPH K = void)],
|
|
||||||
[(TPH FTX, TPH FTW), (TPH M = ? extends Override2), (TPH L = java.util.Vector<TPH FTW>), (TPH K = void), (TPH N = java.lang.String)],
|
|
||||||
[(TPH M = ? extends Override2), (TPH L = java.util.Stack<TPH FTZ>), (TPH K = void), (TPH FTY, TPH FTZ), (TPH N = java.lang.String)],
|
|
||||||
[(TPH FUB, TPH FUA), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUA>)],
|
|
||||||
[(TPH N = java.lang.String), (TPH L = java.util.Vector<TPH FUC>), (TPH FUD, TPH FUC), (TPH M = ? extends Override2), (TPH K = void)],
|
|
||||||
[(TPH N = java.lang.String), (TPH FUF, TPH FUE), (TPH M = ? extends Override2), (TPH K = void), (TPH L = java.util.Vector<TPH FUE>)]]
|
|
||||||
|
|
||||||
[[(TPH M = ? extends Override2), (TPH MNX, TPH MNY), (TPH N = java.lang.String), (TPH K = void), (TPH L = java.util.Stack<TPH MNY>)], [(TPH L = java.util.Stack<TPH MOC>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH K = void), (TPH MOB, TPH MOC)], [(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH MNZ, TPH MOA), (TPH L = java.util.Vector<TPH MOA>), (TPH K = void)], [(TPH L = java.util.Vector<TPH MOE>), (TPH K = void), (TPH M = ? extends Override2), (TPH MOD, TPH MOE), (TPH N = java.lang.String)], [(TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String), (TPH MOF, TPH MOG), (TPH L = java.util.Stack<TPH MOG>)], [(TPH L = java.util.Vector<TPH MOI>), (TPH K = void), (TPH MOH, TPH MOI), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOK>), (TPH MOJ, TPH MOK), (TPH K = void), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH MOL, TPH MOM), (TPH L = java.util.Stack<TPH MOM>), (TPH M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String)], [(TPH L = java.util.Vector<TPH MOO>), (TPH MON, TPH MOO), (TPH N = java.lang.String), (TPH K = void), (TPH M = ? extends Override2)], [(TPH L = java.util.Stack<TPH MOP>), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH MOQ, TPH MOP), (TPH K = void)]]
|
|
||||||
*/
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
class OverrideMainRet {
|
|
||||||
ovrMain() {
|
|
||||||
var overide;
|
|
||||||
var x;
|
|
||||||
overide.ovr(x);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,7 +13,7 @@ class Pair<U, T> {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eq(a, b) {
|
eq(a, b) {
|
||||||
b = a;
|
b = a;
|
||||||
return a == b;
|
return a == b;
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
8
resources/AllgemeinTest/RecursionCond.jav
Normal file
8
resources/AllgemeinTest/RecursionCond.jav
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
class RecursionCond {
|
||||||
|
m(a, b, c) {
|
||||||
|
if (1 == 2) {
|
||||||
|
b = m(a, b);
|
||||||
|
c = m(a, b);
|
||||||
|
} else return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
14
resources/AllgemeinTest/StreamTest.jav
Normal file
14
resources/AllgemeinTest/StreamTest.jav
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import java.util.stream.Stream;
|
||||||
|
import java.util.Vector;
|
||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
class StreamTest {
|
||||||
|
|
||||||
|
m() {
|
||||||
|
var vecInt = new Vector<Integer>();
|
||||||
|
var strInt = vecInt.stream();
|
||||||
|
var dup = x -> x*2;
|
||||||
|
strInt.map(dup);
|
||||||
|
return dup;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
class Test {
|
import java.lang.Boolean;
|
||||||
a;
|
import java.lang.Integer;
|
||||||
Test b;
|
|
||||||
|
public class Test {
|
||||||
|
fac = (x) -> {
|
||||||
|
if (x == 1) { return 1; }
|
||||||
|
return x * fac.apply(x - 1);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
19
resources/AllgemeinTest/TripleTest.jav
Normal file
19
resources/AllgemeinTest/TripleTest.jav
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
class Triple<U, T, S> {
|
||||||
|
U a;
|
||||||
|
T b;
|
||||||
|
S c;
|
||||||
|
|
||||||
|
Triple(U x, T y, S z) {
|
||||||
|
a = x; b = y; c = z;
|
||||||
|
}
|
||||||
|
|
||||||
|
U fst() { return a; }
|
||||||
|
T snd() { return b; }
|
||||||
|
S thrd() { return c; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TripleTest {
|
||||||
|
m() {
|
||||||
|
return new Triple<>(m().thrd(), m().thrd(), m().thrd());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
class Twice {
|
|
||||||
twice = f -> x -> f.apply(f.apply(x));
|
|
||||||
}
|
|
||||||
12
resources/AllgemeinTest/Twice2.jav
Normal file
12
resources/AllgemeinTest/Twice2.jav
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
class Twice2 {
|
||||||
|
id1inst = new Id<>();
|
||||||
|
id1 = id1inst.id;
|
||||||
|
id2inst = new Id<>();
|
||||||
|
id2 = id2inst.id;
|
||||||
|
twice = id1.apply(id2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Id<T> {
|
||||||
|
id = (T x) -> x;
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
class Var {
|
|
||||||
|
|
||||||
var(x) { var y; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.lang.Integer;
|
|
||||||
|
|
||||||
|
|
||||||
public class VectorConstAdd {
|
|
||||||
vectorAdd(v1) {
|
|
||||||
var i = 0;
|
|
||||||
var erg = new Vector<>();
|
|
||||||
while (i < v1.size()) {
|
|
||||||
erg.addElement(v1.elementAt(i) + 1);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return erg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
class VectorNotObject {
|
|
||||||
|
|
||||||
vectorAddAll(v1, v2) {
|
|
||||||
v1.addAll(v2);
|
|
||||||
return v1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import java.util.Vector;
|
|
||||||
import java.lang.Integer;
|
|
||||||
import java.lang.String;
|
|
||||||
|
|
||||||
class WildcardCaptureConversionTest {
|
|
||||||
|
|
||||||
m(x, y ,z) {
|
|
||||||
x = new Vector<Integer>();
|
|
||||||
y = new Vector<String>();
|
|
||||||
x.add(1);
|
|
||||||
y.add("2");
|
|
||||||
//Integer i = x.elementAt(0);
|
|
||||||
//String s = y.elementAt(0);
|
|
||||||
return z.vectorAddAll(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
class Wildcard_Andi {
|
|
||||||
|
|
||||||
Test<? extends A> ex = new Test<>();
|
|
||||||
|
|
||||||
Test<? super A> sup = new Test<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import java.util.List;
|
|
||||||
|
|
||||||
class addList {
|
|
||||||
addLists(a, b){
|
|
||||||
a.add(b.get(0));
|
|
||||||
b.add(a.get(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import java.util.List;
|
|
||||||
import java.lang.Integer;
|
|
||||||
import java.lang.Object;
|
|
||||||
import java.lang.Boolean;
|
|
||||||
|
|
||||||
class wildcardPair {
|
|
||||||
|
|
||||||
make(l) {
|
|
||||||
var p = new Pair(l.get(0), l.get(1));
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
//<X>Boolean compare(Pair<X, X> x) { return true; }
|
|
||||||
void m(l) {
|
|
||||||
Object o = l.get(0);
|
|
||||||
|
|
||||||
//Pair<? extends Object, ? extends Object> p;
|
|
||||||
//List<?> b;
|
|
||||||
//this.compare(p); //1, type incorrect
|
|
||||||
make(l);
|
|
||||||
//this.compare(this.make(b)); //2, OK
|
|
||||||
}
|
|
||||||
}
|
|
||||||
13
resources/bytecode/javFiles/Chain.jav
Normal file
13
resources/bytecode/javFiles/Chain.jav
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
public class Chain {
|
||||||
|
x = 5;
|
||||||
|
|
||||||
|
chain() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
m() {
|
||||||
|
return this.chain().chain().chain().x;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
resources/bytecode/javFiles/Cycle.class
Executable file
BIN
resources/bytecode/javFiles/Cycle.class
Executable file
Binary file not shown.
@@ -1,12 +1,12 @@
|
|||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
//import java.lang.Double;
|
import java.lang.Double;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
public class Fac {
|
public class Fac {
|
||||||
|
getFac(n) {
|
||||||
getFac(n){
|
|
||||||
var res = 1;
|
var res = 1;
|
||||||
var i = 1;
|
var i = 1;
|
||||||
while(i<=n) {
|
while (i <= n) {
|
||||||
res = res * i;
|
res = res * i;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class Faculty {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public getFact(x) {
|
public getFact(java.lang.Integer x) {
|
||||||
return fact.apply(x);
|
return fact.apply(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.lang.String;
|
||||||
|
|
||||||
public class FieldTph2 {
|
public class FieldTph2 {
|
||||||
a;
|
a;
|
||||||
|
|
||||||
|
|||||||
@@ -4,20 +4,20 @@ import java.lang.Boolean;
|
|||||||
class For{
|
class For{
|
||||||
Integer m(Integer x){
|
Integer m(Integer x){
|
||||||
var c = x + 2;
|
var c = x + 2;
|
||||||
// Boolean b = true;
|
Boolean b = true;
|
||||||
// c = 5;
|
c = 5;
|
||||||
// c++;
|
c++;
|
||||||
// ++c;
|
++c;
|
||||||
// c--;
|
c--;
|
||||||
// --c;
|
--c;
|
||||||
// while(x<2){
|
while(x<2){
|
||||||
// x = x +1;
|
x = x +1;
|
||||||
// b = false;
|
b = false;
|
||||||
// }
|
}
|
||||||
return c;
|
for(int i = 0; i<10; i++) {
|
||||||
// for(int i = 0;i<10;i++) {
|
x = x + 5;
|
||||||
// x = x + 5;
|
}
|
||||||
// }
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
// m2(Integer x){
|
// m2(Integer x){
|
||||||
|
|||||||
15
resources/bytecode/javFiles/FunctionalInterface.jav
Normal file
15
resources/bytecode/javFiles/FunctionalInterface.jav
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class FunctionalInterface {
|
||||||
|
Integer accept(Function<Integer, Integer> f) {
|
||||||
|
return f.apply(20);
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer m() {
|
||||||
|
var v = accept(i -> {
|
||||||
|
return i * 10;
|
||||||
|
});
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
9
resources/bytecode/javFiles/HelloWorld.jav
Normal file
9
resources/bytecode/javFiles/HelloWorld.jav
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import java.lang.System;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
|
||||||
|
public class HelloWorld {
|
||||||
|
static hello() {
|
||||||
|
System.out.println("Hello World!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
public class Id {
|
public class Id <FAU> {
|
||||||
// a;
|
// a;
|
||||||
// id(b){
|
// id(b){
|
||||||
// return b;
|
// return b;
|
||||||
|
|||||||
18
resources/bytecode/javFiles/InstanceOf.jav
Normal file
18
resources/bytecode/javFiles/InstanceOf.jav
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import java.lang.Number;
|
||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Double;
|
||||||
|
import java.lang.String;
|
||||||
|
|
||||||
|
public class InstanceOf {
|
||||||
|
main(n) {
|
||||||
|
if (n instanceof Integer i) {
|
||||||
|
takes(i);
|
||||||
|
return "Integer";
|
||||||
|
} else if (n instanceof Double d) {
|
||||||
|
takes(d);
|
||||||
|
return "Double";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
takes(i) {} // Should be overloaded
|
||||||
|
}
|
||||||
33
resources/bytecode/javFiles/Interfaces.jav
Normal file
33
resources/bytecode/javFiles/Interfaces.jav
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
void method1();
|
||||||
|
default method2() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
void method3();
|
||||||
|
}
|
||||||
|
|
||||||
|
interface C {
|
||||||
|
Integer myInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ClassX implements A {
|
||||||
|
}
|
||||||
|
|
||||||
|
record ClassY(Integer myInt) implements C {}
|
||||||
|
|
||||||
|
public class Interfaces implements A, B {
|
||||||
|
public void method1() {
|
||||||
|
}
|
||||||
|
public void method3() {
|
||||||
|
var intf = new Interfaces();
|
||||||
|
intf = new ClassX();
|
||||||
|
intf.method1();
|
||||||
|
|
||||||
|
C c = new ClassY(10);
|
||||||
|
c.myInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
17
resources/bytecode/javFiles/LambdaRunnable.jav
Normal file
17
resources/bytecode/javFiles/LambdaRunnable.jav
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.Runnable;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.System;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
|
||||||
|
public class LambdaRunnable {
|
||||||
|
|
||||||
|
public LambdaRunnable(){
|
||||||
|
|
||||||
|
|
||||||
|
Runnable lam = () -> {
|
||||||
|
System.out.println("Runnable is running");
|
||||||
|
};
|
||||||
|
lam.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,32 +1,15 @@
|
|||||||
|
import java.lang.Double;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.lang.Integer;
|
import java.lang.Long;
|
||||||
import java.lang.Double;
|
|
||||||
import java.lang.Boolean;
|
|
||||||
//import java.util.Vector;
|
|
||||||
|
|
||||||
|
class OL {
|
||||||
public class OL {
|
m (x) { return x + x; }
|
||||||
|
|
||||||
java.lang.Double m(java.lang.Double x) { return x + x; }
|
|
||||||
java.lang.Integer m(java.lang.Integer x) { return x + x; }
|
|
||||||
java.lang.String m(java.lang.String x) { return x + x; }
|
|
||||||
java.lang.Boolean m(Boolean x) { return x; }
|
|
||||||
|
|
||||||
// if the class contains just this method, then correct BC will be generated.
|
|
||||||
// But if another methods are contained then the generated BC is not correct
|
|
||||||
// m(x) {
|
|
||||||
// //x.add(1);
|
|
||||||
// x.addAll(x);
|
|
||||||
// return x;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OLMain {
|
class OLMain {
|
||||||
|
main(x) {
|
||||||
main(x) {
|
|
||||||
var ol;
|
var ol;
|
||||||
ol = new OL();
|
ol = new OL();
|
||||||
return ol.m(x);
|
return ol.m(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
50
resources/bytecode/javFiles/OverloadPattern.jav
Normal file
50
resources/bytecode/javFiles/OverloadPattern.jav
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Number;
|
||||||
|
import java.lang.Float;
|
||||||
|
|
||||||
|
record Point(Number x, Number y) {}
|
||||||
|
|
||||||
|
public class OverloadPattern {
|
||||||
|
m(Point(Integer x, Integer y)) {
|
||||||
|
return x + y;
|
||||||
|
}
|
||||||
|
|
||||||
|
m(Point(Float x, Float y)) {
|
||||||
|
return x * y;
|
||||||
|
}
|
||||||
|
|
||||||
|
m(Integer x) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public class OverloadPattern {
|
||||||
|
Integer m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(Point point) {
|
||||||
|
var x = point.x();
|
||||||
|
var y = point.y();
|
||||||
|
return x + y;
|
||||||
|
}
|
||||||
|
|
||||||
|
Float m$Point$_$java$lang$Float$_$java$lang$Float$_$(Point point) {
|
||||||
|
var x = point.x();
|
||||||
|
var y = point.y();
|
||||||
|
return x * y;
|
||||||
|
}
|
||||||
|
|
||||||
|
Number m(Point point) {
|
||||||
|
return switch(point) {
|
||||||
|
case Point(Integer x, Integer y) ->
|
||||||
|
m$Point$_$java$lang$Integer$_$java$lang$Integer$_$(point);
|
||||||
|
case Point(Float x, Float y) ->
|
||||||
|
m$Point$_$java$lang$Float$_$java$lang$Float$_$(point);
|
||||||
|
default -> throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer m(Integer x) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
0
resources/bytecode/javFiles/PairNoGenerics.jav
Normal file
0
resources/bytecode/javFiles/PairNoGenerics.jav
Normal file
22
resources/bytecode/javFiles/RecordTest.jav
Normal file
22
resources/bytecode/javFiles/RecordTest.jav
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
record Rec(Integer a, Integer b) {}
|
||||||
|
|
||||||
|
/*public class Rec {
|
||||||
|
x; y;
|
||||||
|
Rec(Integer a, Integer b) {
|
||||||
|
x = a;
|
||||||
|
y = b;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public class RecordTest {
|
||||||
|
a = new Rec(10, 20);
|
||||||
|
b = new Rec(10, 20);
|
||||||
|
c = new Rec(20, 40);
|
||||||
|
|
||||||
|
doesEqual() { return a.equals(b); }
|
||||||
|
doesNotEqual() { return b.equals(c); }
|
||||||
|
hashCode() { return a.hashCode(); }
|
||||||
|
toString() { return a.toString(); }
|
||||||
|
}
|
||||||
18
resources/bytecode/javFiles/Static.jav
Normal file
18
resources/bytecode/javFiles/Static.jav
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
class Other {
|
||||||
|
static field = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Static {
|
||||||
|
static i = 20;
|
||||||
|
|
||||||
|
static {
|
||||||
|
var x = 30;
|
||||||
|
i = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
static m() {
|
||||||
|
return i + Other.field;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
resources/bytecode/javFiles/Switch.jav
Normal file
17
resources/bytecode/javFiles/Switch.jav
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.Object;
|
||||||
|
import java.lang.Float;
|
||||||
|
|
||||||
|
record Rec(Integer a, Object b) {}
|
||||||
|
|
||||||
|
public class Switch {
|
||||||
|
main(o) {
|
||||||
|
return switch (o) {
|
||||||
|
case Rec(Integer a, Integer b) -> a + b;
|
||||||
|
case Rec(Integer a, Float b) -> a + 10;
|
||||||
|
case Rec(Integer a, Rec(Integer b, Integer c)) -> a + b + c;
|
||||||
|
case Integer i -> i;
|
||||||
|
default -> 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
13
resources/bytecode/javFiles/Switch2.jav
Normal file
13
resources/bytecode/javFiles/Switch2.jav
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
|
||||||
|
record Point(x, y) {}
|
||||||
|
|
||||||
|
class Switch2 {
|
||||||
|
m() {
|
||||||
|
var pt = new Point(10, 20);
|
||||||
|
return switch (pt) {
|
||||||
|
case Point(x, y) -> 10;
|
||||||
|
default -> 20;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
14
resources/bytecode/javFiles/SwitchString.jav
Normal file
14
resources/bytecode/javFiles/SwitchString.jav
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import java.lang.Integer;
|
||||||
|
import java.lang.String;
|
||||||
|
import java.lang.Object;
|
||||||
|
|
||||||
|
public class SwitchString {
|
||||||
|
main(o) {
|
||||||
|
return switch (o) {
|
||||||
|
case "AaAaAa" -> 1; // These two have the same hash code!
|
||||||
|
case "AaAaBB" -> 2;
|
||||||
|
case "test", "TEST" -> 3;
|
||||||
|
default -> 4;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,6 @@
|
|||||||
public class Tph2 {
|
public class Tph2 {
|
||||||
id = x->x;
|
id = x->x;
|
||||||
id3 (x) {
|
id3 (x) {
|
||||||
return id.apply(x);
|
return id.apply(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
m(a,b){
|
|
||||||
var c = m2(a,b);
|
|
||||||
//m2(a,b);
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
m2(a,b){
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user