Compare commits
No commits in common. "targetBytecode" and "fixPlugin" have entirely different histories.
targetByte
...
fixPlugin
@ -1,25 +0,0 @@
|
||||
name: Build and Test with Maven
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Build-and-test-with-Maven:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Install maven
|
||||
run: |
|
||||
apt update
|
||||
apt install -y maven
|
||||
- name: Install java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
cache: 'maven'
|
||||
- name: Compile project
|
||||
run: |
|
||||
mvn compile
|
||||
- name: Run tests
|
||||
run: |
|
||||
mvn test
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,9 +19,7 @@ bin
|
||||
.DS_Store
|
||||
.project
|
||||
.settings/
|
||||
.vscode/
|
||||
/target/
|
||||
settings.json
|
||||
|
||||
#
|
||||
manually/
|
||||
|
@ -9,6 +9,3 @@ Stand: 24.5.21
|
||||
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
|
||||
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
|
||||
|
||||
Stand 21.2.23
|
||||
unif23: Testbranch fuer Tagungseinrecihung Unif23
|
||||
|
||||
|
BIN
doc/PluginBau.pdf
Normal file
BIN
doc/PluginBau.pdf
Normal file
Binary file not shown.
BIN
doc/Studienarbeiten/S2005_Joerg_Baeuerle.pdf
Executable file
BIN
doc/Studienarbeiten/S2005_Joerg_Baeuerle.pdf
Executable file
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
|
||||
## 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.
|
41
pom.xml
41
pom.xml
@ -28,21 +28,21 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.classgraph</groupId>
|
||||
<artifactId>classgraph</artifactId>
|
||||
<version>4.8.172</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>33.2.0-jre</version>
|
||||
<version>22.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.11</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>9.5</version>
|
||||
<version>7.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -51,29 +51,13 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<version>3.8.0</version>
|
||||
<configuration>
|
||||
<compilerArgs>--enable-preview</compilerArgs>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
<source>19</source>
|
||||
<target>19</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<redirectTestOutputToFile>true</redirectTestOutputToFile>
|
||||
<reportsDirectory>${project.build.directory}/test-reports</reportsDirectory>
|
||||
<argLine>--enable-preview</argLine>
|
||||
<trimStackTrace>false</trimStackTrace>
|
||||
<excludes>
|
||||
<exclude>**/JavaTXCompilerTest.java</exclude>
|
||||
<exclude>**/AllgemeinTest.java</exclude>
|
||||
<exclude>**/syntaxtreegenerator/*.java</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr4-maven-plugin</artifactId>
|
||||
@ -90,7 +74,6 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
@ -129,6 +112,8 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<maven.compiler.source>19</maven.compiler.source>
|
||||
<maven.compiler.target>19</maven.compiler.target>
|
||||
<mainClass>de.dhbwstuttgart.core.ConsoleInterface</mainClass>
|
||||
</properties>
|
||||
<distributionManagement>
|
||||
@ -138,4 +123,4 @@ http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<url>file:///${project.basedir}/maven-repository/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
</project>
|
||||
|
@ -1,10 +0,0 @@
|
||||
public class Bar{
|
||||
|
||||
void visit(Object o){
|
||||
System.out.println("Object");
|
||||
}
|
||||
|
||||
void visit(Bla f){
|
||||
System.out.println("Foo");
|
||||
}
|
||||
}
|
@ -1,9 +1,13 @@
|
||||
public class Box<A> {
|
||||
class Box<A>{
|
||||
void m(A a){}
|
||||
}
|
||||
|
||||
A a;
|
||||
class B { }
|
||||
|
||||
public Box() { }
|
||||
public Box(A a) {
|
||||
//this.a = a;
|
||||
}
|
||||
}
|
||||
class Box_Main extends B {
|
||||
|
||||
m(b) {
|
||||
b.m(new Box_Main());
|
||||
b.m(new B());
|
||||
}
|
||||
}
|
||||
|
13
resources/AllgemeinTest/Box_Main.jav
Normal file
13
resources/AllgemeinTest/Box_Main.jav
Normal file
@ -0,0 +1,13 @@
|
||||
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();
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
12
resources/AllgemeinTest/FCTest1.jav
Normal file
12
resources/AllgemeinTest/FCTest1.jav
Normal file
@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
||||
}
|
11
resources/AllgemeinTest/FCTest2.jav
Normal file
11
resources/AllgemeinTest/FCTest2.jav
Normal file
@ -0,0 +1,11 @@
|
||||
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;
|
||||
}
|
||||
}
|
19
resources/AllgemeinTest/FCTest3.jav
Normal file
19
resources/AllgemeinTest/FCTest3.jav
Normal file
@ -0,0 +1,19 @@
|
||||
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,6 +0,0 @@
|
||||
public class Foo{
|
||||
|
||||
public accept(Bar b){
|
||||
b.visit(this);
|
||||
}
|
||||
}
|
10
resources/AllgemeinTest/GenTest.jav
Normal file
10
resources/AllgemeinTest/GenTest.jav
Normal file
@ -0,0 +1,10 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.Vector;
|
||||
|
||||
public class GenTest {
|
||||
|
||||
main(x) {
|
||||
var v = new Vector();
|
||||
return 1 + v.elementAt(0);
|
||||
}
|
||||
}
|
9
resources/AllgemeinTest/Generics.jav
Normal file
9
resources/AllgemeinTest/Generics.jav
Normal file
@ -0,0 +1,9 @@
|
||||
class Generics {
|
||||
a;
|
||||
id(b) { return b; }
|
||||
setA(x) {
|
||||
a = x;
|
||||
return a;
|
||||
}
|
||||
m(x,y) { x = id(y); }
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
public class InfReturn {
|
||||
m(a) {
|
||||
var ret;
|
||||
a = ret;
|
||||
return ret;
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
public class InfReturnII {
|
||||
m(a, b) {
|
||||
var ret;
|
||||
a = ret;
|
||||
b = ret;
|
||||
return ret;
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
class InnerInf {
|
||||
m(a, b) {
|
||||
var i;
|
||||
a = i;
|
||||
b = i;
|
||||
}
|
||||
}
|
@ -1,43 +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;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
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,46 +0,0 @@
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Object;
|
||||
|
||||
class List {
|
||||
elem;
|
||||
next;
|
||||
|
||||
List() {
|
||||
super();
|
||||
}
|
||||
|
||||
List(elem, next) {
|
||||
this.elem = elem;
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
addElement(newElem) {
|
||||
return new List(newElem, this);
|
||||
}
|
||||
|
||||
append(l) {
|
||||
if (next == null) {
|
||||
return l;
|
||||
}
|
||||
else {
|
||||
return new List(elem, next.append(l));
|
||||
}
|
||||
}
|
||||
/*
|
||||
addAll(l) {
|
||||
var nextLoc = next;
|
||||
while (//nextLoc != null
|
||||
true) {
|
||||
nextLoc = nextLoc.next;
|
||||
}
|
||||
nextLoc = l;
|
||||
}
|
||||
|
||||
void m() {
|
||||
List<? extends Object> l; // = new List<Integer>(1, null);
|
||||
List<? extends Object> l2; // = new List<String>("SSS", null);
|
||||
l.addAll(l2);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
7
resources/AllgemeinTest/M.jav
Executable file
7
resources/AllgemeinTest/M.jav
Executable file
@ -0,0 +1,7 @@
|
||||
import java.util.List;
|
||||
class M {
|
||||
void m(p, p2){
|
||||
|
||||
new addList().addLists(p, p2);
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.Double;
|
||||
|
||||
class Overloading {
|
||||
m(x) { return x + x; }
|
||||
m(x) { return x || x; }
|
||||
}
|
9
resources/AllgemeinTest/OverloadingMain.jav
Normal file
9
resources/AllgemeinTest/OverloadingMain.jav
Normal file
@ -0,0 +1,9 @@
|
||||
import java.util.Stack;
|
||||
import java.util.Vector;
|
||||
|
||||
class OverloadingMain {
|
||||
|
||||
mmMain(x) { var y; return new O1().mm(y); }
|
||||
|
||||
}
|
||||
|
20
resources/AllgemeinTest/Overloading_Generics.jav
Normal file
20
resources/AllgemeinTest/Overloading_Generics.jav
Normal file
@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
25
resources/AllgemeinTest/OverrideMain.jav
Normal file
25
resources/AllgemeinTest/OverrideMain.jav
Normal file
@ -0,0 +1,25 @@
|
||||
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)]]
|
||||
*/
|
11
resources/AllgemeinTest/OverrideMainRet.jav
Normal file
11
resources/AllgemeinTest/OverrideMainRet.jav
Normal file
@ -0,0 +1,11 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
eq(a, b) {
|
||||
b = a;
|
||||
return a == b;
|
||||
|
18
resources/AllgemeinTest/Pair.java
Normal file
18
resources/AllgemeinTest/Pair.java
Normal file
@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
19
resources/AllgemeinTest/Put.jav
Normal file
19
resources/AllgemeinTest/Put.jav
Normal 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);
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
class RecursionCond {
|
||||
m(a, b, c) {
|
||||
if (1 == 2) {
|
||||
b = m(a, b);
|
||||
c = m(a, b);
|
||||
} else return a;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
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,9 +1,4 @@
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Test {
|
||||
fac = (x) -> {
|
||||
if (x == 1) { return 1; }
|
||||
return x * fac.apply(x - 1);
|
||||
};
|
||||
class Test {
|
||||
a;
|
||||
Test b;
|
||||
}
|
12
resources/AllgemeinTest/TestSubTypless.jav
Normal file
12
resources/AllgemeinTest/TestSubTypless.jav
Normal 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);
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
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());
|
||||
}
|
||||
}
|
3
resources/AllgemeinTest/Twice.jav
Normal file
3
resources/AllgemeinTest/Twice.jav
Normal file
@ -0,0 +1,3 @@
|
||||
class Twice {
|
||||
twice = f -> x -> f.apply(f.apply(x));
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
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;
|
||||
}
|
5
resources/AllgemeinTest/Var.jav
Normal file
5
resources/AllgemeinTest/Var.jav
Normal file
@ -0,0 +1,5 @@
|
||||
class Var {
|
||||
|
||||
var(x) { var y; }
|
||||
|
||||
}
|
15
resources/AllgemeinTest/VectorConstAdd.jav
Normal file
15
resources/AllgemeinTest/VectorConstAdd.jav
Normal file
@ -0,0 +1,15 @@
|
||||
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;
|
||||
}
|
||||
}
|
9
resources/AllgemeinTest/VectorNotObject.jav
Normal file
9
resources/AllgemeinTest/VectorNotObject.jav
Normal file
@ -0,0 +1,9 @@
|
||||
import java.util.Vector;
|
||||
|
||||
class VectorNotObject {
|
||||
|
||||
vectorAddAll(v1, v2) {
|
||||
v1.addAll(v2);
|
||||
return v1;
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@ import java.util.Vector;
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
public class Bug98 {
|
||||
class WildcardCaptureConversionTest {
|
||||
|
||||
public m(x, y ,z) {
|
||||
m(x, y ,z) {
|
||||
x = new Vector<Integer>();
|
||||
y = new Vector<String>();
|
||||
x.add(1);
|
||||
@ -13,4 +13,4 @@ public class Bug98 {
|
||||
//String s = y.elementAt(0);
|
||||
return z.vectorAddAll(x, y);
|
||||
}
|
||||
}
|
||||
}
|
8
resources/AllgemeinTest/Wildcard_Andi.jav
Normal file
8
resources/AllgemeinTest/Wildcard_Andi.jav
Normal file
@ -0,0 +1,8 @@
|
||||
class Wildcard_Andi {
|
||||
|
||||
Test<? extends A> ex = new Test<>();
|
||||
|
||||
Test<? super A> sup = new Test<>();
|
||||
}
|
||||
|
||||
|
8
resources/AllgemeinTest/addList.jav
Executable file
8
resources/AllgemeinTest/addList.jav
Executable file
@ -0,0 +1,8 @@
|
||||
import java.util.List;
|
||||
|
||||
class addList {
|
||||
addLists(a, b){
|
||||
a.add(b.get(0));
|
||||
b.add(a.get(0));
|
||||
}
|
||||
}
|
22
resources/AllgemeinTest/wildcardPair.jav
Normal file
22
resources/AllgemeinTest/wildcardPair.jav
Normal file
@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
public class AA {
|
||||
public m(Integer i) { return "AA"; }
|
||||
m(Integer i) { return "AA"; }
|
||||
|
||||
public m2(AA x) { return "AA"; }
|
||||
m2(AA x) { return "AA"; }
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
public class Access {
|
||||
public int fPublic;
|
||||
int fDefault;
|
||||
private int fPrivate;
|
||||
protected int fProtected;
|
||||
|
||||
public void mPublic() {}
|
||||
void mDefault() {}
|
||||
private void mPrivate() {}
|
||||
protected void mProtected() {}
|
||||
}
|
||||
|
||||
class AccessDefault {
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
class Base {
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
public class Annotation extends Base {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
import java.lang.Integer;
|
||||
import AA;
|
||||
|
||||
public class BB extends AA { }
|
@ -3,15 +3,15 @@ import java.lang.Double;
|
||||
|
||||
public class BinaryInMeth {
|
||||
|
||||
public m(a){
|
||||
m(a){
|
||||
return ++a;
|
||||
}
|
||||
|
||||
public m2(a,b){
|
||||
m2(a,b){
|
||||
return m(a+b);
|
||||
}
|
||||
|
||||
public m3(a) {
|
||||
m3(a) {
|
||||
return m(++a);
|
||||
}
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
public class Box<A> {
|
||||
|
||||
A a;
|
||||
|
||||
public Box() { }
|
||||
public Box(A a) {
|
||||
//this.a = a;
|
||||
}
|
||||
}
|
||||
class B { }
|
||||
class Box_Main extends B {
|
||||
m(b) {
|
||||
b.m(new Box_Main());
|
||||
b.m(new B());
|
||||
}
|
||||
}
|
||||
|
3
resources/bytecode/javFiles/Box.java
Normal file
3
resources/bytecode/javFiles/Box.java
Normal file
@ -0,0 +1,3 @@
|
||||
class Box<A> {
|
||||
void m(A a) { }
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
public class Bug112 {
|
||||
public m(x) {
|
||||
var y;
|
||||
x = y;
|
||||
return y;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.Boolean;
|
||||
|
||||
public class Bug122 {
|
||||
public void main() {
|
||||
if (true) {
|
||||
for (Integer i = 0; i < 10; i++) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug123 {
|
||||
public Boolean works(){
|
||||
if(true) return true;
|
||||
else return false;
|
||||
}
|
||||
public void fails(){
|
||||
Boolean a = true;
|
||||
if(true) a = false;
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import java.lang.Boolean;
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Bug125 {
|
||||
static ArrayList<String> works = new ArrayList<>();
|
||||
static List<String> fails = new ArrayList<>();
|
||||
|
||||
public void main() {
|
||||
works.toString();
|
||||
fails.toString();
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
import java.util.Optional;
|
||||
import java.lang.Integer;
|
||||
|
||||
public class StaticClass {
|
||||
public static StaticClass barbar() {
|
||||
return new StaticClass();
|
||||
}
|
||||
}
|
||||
|
||||
public class Bug285 {
|
||||
public void foo() {
|
||||
Optional<Integer> opt = Optional.empty();
|
||||
StaticClass b = StaticClass.barbar();
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import Bug290B;
|
||||
|
||||
public class Bug290A {
|
||||
public void m() {
|
||||
new Bug290B();
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import java.lang.String;
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug290B {
|
||||
String name;
|
||||
|
||||
public Bug290B() {
|
||||
Integer i = 0;
|
||||
name = i.toString() + "$$";
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.Float;
|
||||
|
||||
public class Bug293 {
|
||||
bar(a) {
|
||||
return 2 * a;
|
||||
}
|
||||
}
|
||||
|
||||
interface IFoo {
|
||||
void ga();
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug295 {
|
||||
public Integer a;
|
||||
public Integer b;
|
||||
public Integer c;
|
||||
|
||||
public Bug295(a, b, c) {
|
||||
this(a);
|
||||
this.b = b;
|
||||
this.c = c;
|
||||
}
|
||||
|
||||
public Bug295(a) {
|
||||
this.a = a;
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug296 {
|
||||
public static m1() {
|
||||
return m2();
|
||||
}
|
||||
|
||||
static m2() {
|
||||
return 10;
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug297 {
|
||||
public static operation(func, a, b) {
|
||||
return func.apply(a, b);
|
||||
}
|
||||
|
||||
public exec() {
|
||||
return Foo.operation((x, y) -> x + y, 10, 10);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.lang.Integer;
|
||||
import java.lang.System;
|
||||
import java.lang.Boolean;
|
||||
import java.io.PrintStream;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class Bug298 {
|
||||
public void m() {
|
||||
List<Integer> list = new ArrayList<>();
|
||||
list.stream().map(x -> 2 * x);
|
||||
|
||||
Function<Integer, Boolean> filter = x -> true;
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import java.lang.String;
|
||||
|
||||
class Base {
|
||||
toString() {
|
||||
return "Base";
|
||||
}
|
||||
}
|
||||
|
||||
public class Bug300 extends Base {
|
||||
public m() {
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
toString() {
|
||||
return "Derived";
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
import java.util.HashSet;
|
||||
|
||||
public class Bug301<A> extends HashSet<A> {
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug302 {
|
||||
public Bug302(List<Integer> a){}
|
||||
|
||||
public static m() {
|
||||
new Bug302(new ArrayList<Integer>());
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.List;
|
||||
|
||||
class Base {
|
||||
m(List<Integer> a) {}
|
||||
}
|
||||
|
||||
public class Bug306 extends Base {
|
||||
@Override
|
||||
m(List<Integer> b) {
|
||||
b.add(1);
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
public class Bug307 {
|
||||
public void main() {
|
||||
IVisitor v = new Visitor();
|
||||
Impl2 f = new Impl2();
|
||||
Impl1 g = new Impl1();
|
||||
|
||||
f.accept(v);
|
||||
g.accept(v);
|
||||
}
|
||||
}
|
||||
|
||||
interface IVisitor {
|
||||
void visit(Impl1 f);
|
||||
void visit(Impl2 fb);
|
||||
}
|
||||
|
||||
interface IAcceptor {
|
||||
void accept(IVisitor v);
|
||||
}
|
||||
|
||||
class Visitor implements IVisitor {
|
||||
|
||||
@Override
|
||||
public void visit(Impl1 f) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visit(Impl2 fb) {
|
||||
}
|
||||
}
|
||||
|
||||
class Impl1 implements IAcceptor {
|
||||
|
||||
@Override
|
||||
public void accept(IVisitor v) {
|
||||
v.visit(this);
|
||||
}
|
||||
}
|
||||
|
||||
class Impl2 implements IAcceptor {
|
||||
|
||||
@Override
|
||||
public void accept(IVisitor v) {
|
||||
v.visit(this);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.lang.Integer;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.Optional;
|
||||
|
||||
public class Bug309 {
|
||||
public main() {
|
||||
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9));
|
||||
var res = list.stream().filter(x -> x == 5).map(x -> x * 2).findFirst();
|
||||
return res;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
|
||||
public class Bug310 {
|
||||
Integer i = 3;
|
||||
public toString() {
|
||||
return i.toString();
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import java.lang.String;
|
||||
|
||||
public class Bug311 {
|
||||
Bug311A i = new Bug311A();
|
||||
public toString() {
|
||||
return i.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class Bug311A {}
|
@ -1,8 +0,0 @@
|
||||
public class Bug312 {
|
||||
Bug312A i = new Bug312A();
|
||||
public main() {
|
||||
if (i == null) {}
|
||||
}
|
||||
}
|
||||
|
||||
class Bug312A {}
|
@ -1,13 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Bug314 {
|
||||
public List<Integer> convert(List<Integer> in) {
|
||||
return in.stream().filter(x -> x > 5).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import java.util.function.Function;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Bug325 {
|
||||
public main() {
|
||||
List<Integer> list = new ArrayList<>(List.of(1,2,3,4,5));
|
||||
var func = x -> x*2;
|
||||
return list.stream().map(func).toList();
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
|
||||
public class Bug326 {
|
||||
public Bug326() {
|
||||
var func = x -> y -> x * y;
|
||||
return func.apply(3).apply(4);
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import java.lang.Integer;
|
||||
import Bug328B;
|
||||
|
||||
public class Bug328 extends Bug328B {
|
||||
public Bug328() {
|
||||
super(1);
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
public class Bug328B {
|
||||
public Bug328B(int a) {}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
import java.lang.Object;
|
||||
|
||||
interface Visitor {
|
||||
public void visit(Object obj);
|
||||
public void visit(ClassA a);
|
||||
}
|
||||
|
||||
class ClassA {
|
||||
void accept(Visitor v) {
|
||||
v.visit(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class Bug332 {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user