Compare commits

..

No commits in common. "targetBytecode" and "fixPlugin" have entirely different histories.

492 changed files with 10348 additions and 29242 deletions

View File

@ -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
View File

@ -19,9 +19,7 @@ bin
.DS_Store
.project
.settings/
.vscode/
/target/
settings.json
#
manually/

View File

@ -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

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -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
View File

@ -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>

View File

@ -1,10 +0,0 @@
public class Bar{
void visit(Object o){
System.out.println("Object");
}
void visit(Bla f){
System.out.println("Foo");
}
}

View File

@ -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());
}
}

View 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();
}
}

View File

@ -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);
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View File

@ -1,6 +0,0 @@
public class Foo{
public accept(Bar b){
b.visit(this);
}
}

View 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);
}
}

View File

@ -0,0 +1,9 @@
class Generics {
a;
id(b) { return b; }
setA(x) {
a = x;
return a;
}
m(x,y) { x = id(y); }
}

View File

@ -1,7 +0,0 @@
public class InfReturn {
m(a) {
var ret;
a = ret;
return ret;
}
}

View File

@ -1,8 +0,0 @@
public class InfReturnII {
m(a, b) {
var ret;
a = ret;
b = ret;
return ret;
}
}

View File

@ -1,7 +0,0 @@
class InnerInf {
m(a, b) {
var i;
a = i;
b = i;
}
}

View File

@ -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);
}
}

View File

@ -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
View File

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

View File

@ -1,7 +0,0 @@
import java.lang.Integer;
import java.lang.Double;
class Overloading {
m(x) { return x + x; }
m(x) { return x || x; }
}

View File

@ -0,0 +1,9 @@
import java.util.Stack;
import java.util.Vector;
class OverloadingMain {
mmMain(x) { var y; return new O1().mm(y); }
}

View 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);
}
}

View 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)]]
*/

View 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;
}
}

View File

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

View 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;
}
}

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

@ -1,8 +0,0 @@
class RecursionCond {
m(a, b, c) {
if (1 == 2) {
b = m(a, b);
c = m(a, b);
} else return a;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

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

@ -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());
}
}

View File

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

View File

@ -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;
}

View File

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

View 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;
}
}

View File

@ -0,0 +1,9 @@
import java.util.Vector;
class VectorNotObject {
vectorAddAll(v1, v2) {
v1.addAll(v2);
return v1;
}
}

View File

@ -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);
}
}
}

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));
}
}

View 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
}
}

View File

@ -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"; }
}

View File

@ -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 {
}

View File

@ -1,8 +0,0 @@
class Base {
public void foo() {}
}
public class Annotation extends Base {
@Override
public void foo() {}
}

View File

@ -1,4 +1,3 @@
import java.lang.Integer;
import AA;
public class BB extends AA { }

View File

@ -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);
}
}

View File

@ -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());
}
}

View File

@ -0,0 +1,3 @@
class Box<A> {
void m(A a) { }
}

View File

@ -1,7 +0,0 @@
public class Bug112 {
public m(x) {
var y;
x = y;
return y;
}
}

View File

@ -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++) {
}
}
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -1,7 +0,0 @@
import Bug290B;
public class Bug290A {
public void m() {
new Bug290B();
}
}

View File

@ -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() + "$$";
}
}

View File

@ -1,13 +0,0 @@
import java.lang.Integer;
import java.lang.Float;
public class Bug293 {
bar(a) {
return 2 * a;
}
}
interface IFoo {
void ga();
}

View File

@ -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;
}
}

View File

@ -1,11 +0,0 @@
import java.lang.Integer;
public class Bug296 {
public static m1() {
return m2();
}
static m2() {
return 10;
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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";
}
}

View File

@ -1,4 +0,0 @@
import java.util.HashSet;
public class Bug301<A> extends HashSet<A> {
}

View File

@ -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>());
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -1,9 +0,0 @@
import java.lang.Integer;
import java.lang.String;
public class Bug310 {
Integer i = 3;
public toString() {
return i.toString();
}
}

View File

@ -1,10 +0,0 @@
import java.lang.String;
public class Bug311 {
Bug311A i = new Bug311A();
public toString() {
return i.toString();
}
}
class Bug311A {}

View File

@ -1,8 +0,0 @@
public class Bug312 {
Bug312A i = new Bug312A();
public main() {
if (i == null) {}
}
}
class Bug312A {}

View File

@ -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());
}
}

View File

@ -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();
}
}

View File

@ -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);
}
}

View File

@ -1,8 +0,0 @@
import java.lang.Integer;
import Bug328B;
public class Bug328 extends Bug328B {
public Bug328() {
super(1);
}
}

View File

@ -1,3 +0,0 @@
public class Bug328B {
public Bug328B(int a) {}
}

View File

@ -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