diff --git a/pom.xml b/pom.xml
index c6ccd6ab..d0642d4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,7 @@ http://maven.apache.org/maven-v4_0_0.xsd">
true
**/JavaTXCompilerTest.java
+ **/AllgemeinTest.java
**/syntaxtreegenerator/*.java
diff --git a/resources/bytecode/javFiles/BinaryInMeth.jav b/resources/bytecode/javFiles/BinaryInMeth.jav
index 3b5fa77b..0e1ddc53 100644
--- a/resources/bytecode/javFiles/BinaryInMeth.jav
+++ b/resources/bytecode/javFiles/BinaryInMeth.jav
@@ -3,15 +3,15 @@ import java.lang.Double;
public class BinaryInMeth {
- m(a){
+ public m(a){
return ++a;
}
- m2(a,b){
+ public m2(a,b){
return m(a+b);
}
- m3(a) {
+ public m3(a) {
return m(++a);
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Bug112.jav b/resources/bytecode/javFiles/Bug112.jav
index 34567f03..a3f1bad8 100644
--- a/resources/bytecode/javFiles/Bug112.jav
+++ b/resources/bytecode/javFiles/Bug112.jav
@@ -1,5 +1,5 @@
public class Bug112 {
- m(x) {
+ public m(x) {
var y;
x = y;
return y;
diff --git a/resources/bytecode/javFiles/Bug122.jav b/resources/bytecode/javFiles/Bug122.jav
index 78a1c019..746f311c 100644
--- a/resources/bytecode/javFiles/Bug122.jav
+++ b/resources/bytecode/javFiles/Bug122.jav
@@ -1,8 +1,8 @@
import java.lang.Integer;
import java.lang.Boolean;
-class Bug122 {
- void main() {
+public class Bug122 {
+ public void main() {
if (true) {
for (Integer i = 0; i < 10; i++) {
diff --git a/resources/bytecode/javFiles/Bug123.jav b/resources/bytecode/javFiles/Bug123.jav
index 24cca90e..daecc919 100644
--- a/resources/bytecode/javFiles/Bug123.jav
+++ b/resources/bytecode/javFiles/Bug123.jav
@@ -1,12 +1,12 @@
import java.lang.Boolean;
import java.lang.Integer;
-class Bug123 {
- Boolean works(){
+public class Bug123 {
+ public Boolean works(){
if(true) return true;
else return false;
}
- void fails(){
+ public void fails(){
Boolean a = true;
if(true) a = false;
}
diff --git a/resources/bytecode/javFiles/Bug125.jav b/resources/bytecode/javFiles/Bug125.jav
index 26474ae2..692106c2 100644
--- a/resources/bytecode/javFiles/Bug125.jav
+++ b/resources/bytecode/javFiles/Bug125.jav
@@ -5,11 +5,11 @@ import java.util.List;
import java.util.LinkedList;
import java.util.ArrayList;
-class Bug125 {
+public class Bug125 {
static ArrayList works = new ArrayList<>();
static List fails = new ArrayList<>();
- void main() {
+ public void main() {
works.toString();
fails.toString();
}
diff --git a/resources/bytecode/javFiles/Bug285.jav b/resources/bytecode/javFiles/Bug285.jav
index e6b0696c..5f17b662 100644
--- a/resources/bytecode/javFiles/Bug285.jav
+++ b/resources/bytecode/javFiles/Bug285.jav
@@ -1,14 +1,14 @@
import java.util.Optional;
import java.lang.Integer;
-class StaticClass {
- static StaticClass barbar() {
+public class StaticClass {
+ public static StaticClass barbar() {
return new StaticClass();
}
}
public class Bug285 {
- void foo() {
+ public void foo() {
Optional opt = Optional.empty();
StaticClass b = StaticClass.barbar();
}
diff --git a/resources/bytecode/javFiles/Bug290A.jav b/resources/bytecode/javFiles/Bug290A.jav
new file mode 100644
index 00000000..7667cac6
--- /dev/null
+++ b/resources/bytecode/javFiles/Bug290A.jav
@@ -0,0 +1,7 @@
+import Bug290B;
+
+public class Bug290A {
+ public void m() {
+ new Bug290B();
+ }
+}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Bug290B.jav b/resources/bytecode/javFiles/Bug290B.jav
new file mode 100644
index 00000000..1a9201b2
--- /dev/null
+++ b/resources/bytecode/javFiles/Bug290B.jav
@@ -0,0 +1,11 @@
+import java.lang.String;
+import java.lang.Integer;
+
+public class Bug290B {
+ String name;
+
+ public Bug290B() {
+ Integer i = 0;
+ name = i.toString() + "$$";
+ }
+}
diff --git a/resources/bytecode/javFiles/Bug98.jav b/resources/bytecode/javFiles/Bug98.jav
index 2da3a4ef..6a7a9e48 100644
--- a/resources/bytecode/javFiles/Bug98.jav
+++ b/resources/bytecode/javFiles/Bug98.jav
@@ -4,7 +4,7 @@ import java.lang.String;
public class Bug98 {
- m(x, y ,z) {
+ public m(x, y ,z) {
x = new Vector();
y = new Vector();
x.add(1);
diff --git a/resources/bytecode/javFiles/Chain.jav b/resources/bytecode/javFiles/Chain.jav
index c6b034a3..bd43a01f 100644
--- a/resources/bytecode/javFiles/Chain.jav
+++ b/resources/bytecode/javFiles/Chain.jav
@@ -7,7 +7,7 @@ public class Chain {
return this;
}
- m() {
+ public m() {
return this.chain().chain().chain().x;
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Cycle.jav b/resources/bytecode/javFiles/Cycle.jav
index 85f2ba9a..b49e9066 100644
--- a/resources/bytecode/javFiles/Cycle.jav
+++ b/resources/bytecode/javFiles/Cycle.jav
@@ -1,5 +1,5 @@
-class Cycle {
- m(x, y) {
+public class Cycle {
+ public m(x, y) {
y = x;
x = y;
}
diff --git a/resources/bytecode/javFiles/Exceptions.jav b/resources/bytecode/javFiles/Exceptions.jav
index 7b804a6a..5b901ba7 100644
--- a/resources/bytecode/javFiles/Exceptions.jav
+++ b/resources/bytecode/javFiles/Exceptions.jav
@@ -2,7 +2,7 @@ import java.lang.String;
import java.lang.RuntimeException;
public class Exceptions {
- m() {
+ public m() {
throw new RuntimeException("Some Exception");
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/FieldTph2.jav b/resources/bytecode/javFiles/FieldTph2.jav
index ed0d4521..21d9445a 100644
--- a/resources/bytecode/javFiles/FieldTph2.jav
+++ b/resources/bytecode/javFiles/FieldTph2.jav
@@ -1,14 +1,14 @@
import java.lang.String;
public class FieldTph2 {
- a;
+ public a;
- m(b){
+ public m(b){
b = a;
return b;
}
- m2(c){
+ public m2(c){
a = c;
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/FieldTphConsMeth.jav b/resources/bytecode/javFiles/FieldTphConsMeth.jav
index cf195bd2..e8d01c10 100644
--- a/resources/bytecode/javFiles/FieldTphConsMeth.jav
+++ b/resources/bytecode/javFiles/FieldTphConsMeth.jav
@@ -1,20 +1,20 @@
public class FieldTphConsMeth {
- a;
+ public a;
public FieldTphConsMeth(c) {
a = id(c);
}
- id(b) {
+ public id(b) {
return b;
}
- setA(x) {
+ public setA(x) {
a = x;
return a;
}
- m(x,y) {
+ public m(x,y) {
x = id(y);
}
diff --git a/resources/bytecode/javFiles/FieldTphMMeth.jav b/resources/bytecode/javFiles/FieldTphMMeth.jav
index ad97edc4..e1277bfe 100644
--- a/resources/bytecode/javFiles/FieldTphMMeth.jav
+++ b/resources/bytecode/javFiles/FieldTphMMeth.jav
@@ -1,13 +1,13 @@
import java.lang.Boolean;
public class FieldTphMMeth {
- a;
+ public a;
public FieldTphMMeth(c,d,e) {
a = m(c,d,e);
}
- m(b,d,e) {
+ public m(b,d,e) {
if(e) {
return m3(b);
} else{
@@ -16,11 +16,11 @@ public class FieldTphMMeth {
}
- m2(b) {
+ public m2(b) {
a = m3(b);
}
- m3(b){
+ public m3(b){
return b;
}
diff --git a/resources/bytecode/javFiles/For.jav b/resources/bytecode/javFiles/For.jav
index 2d967f97..e96184ea 100644
--- a/resources/bytecode/javFiles/For.jav
+++ b/resources/bytecode/javFiles/For.jav
@@ -1,8 +1,8 @@
import java.lang.Integer;
import java.lang.Boolean;
-class For{
- Integer m(Integer x){
+public class For{
+ public Integer m(Integer x){
var c = x + 2;
Boolean b = true;
c = 5;
diff --git a/resources/bytecode/javFiles/FunctionalInterface.jav b/resources/bytecode/javFiles/FunctionalInterface.jav
index 62120fa2..39b3b348 100644
--- a/resources/bytecode/javFiles/FunctionalInterface.jav
+++ b/resources/bytecode/javFiles/FunctionalInterface.jav
@@ -6,7 +6,7 @@ public class FunctionalInterface {
return f.apply(20);
}
- Integer m() {
+ public Integer m() {
var v = accept(i -> {
return i * 10;
});
diff --git a/resources/bytecode/javFiles/HelloWorld.jav b/resources/bytecode/javFiles/HelloWorld.jav
index ff3df087..7f5f75d5 100644
--- a/resources/bytecode/javFiles/HelloWorld.jav
+++ b/resources/bytecode/javFiles/HelloWorld.jav
@@ -3,7 +3,7 @@ import java.lang.String;
import java.io.PrintStream;
public class HelloWorld {
- static hello() {
+ public static hello() {
System.out.println("Hello World!");
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/InstanceOf.jav b/resources/bytecode/javFiles/InstanceOf.jav
index e7b1cbd8..52a7473c 100644
--- a/resources/bytecode/javFiles/InstanceOf.jav
+++ b/resources/bytecode/javFiles/InstanceOf.jav
@@ -12,7 +12,7 @@ class Test2 {
public class InstanceOf {
a = new Test();
- test1() { return this.a instanceof Test; }
- test2() { return this.a instanceof Interface; }
- test3() { return this.a instanceof Integer; }
+ public test1() { return this.a instanceof Test; }
+ public test2() { return this.a instanceof Interface; }
+ public test3() { return this.a instanceof Integer; }
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Lambda.jav b/resources/bytecode/javFiles/Lambda.jav
index ba466b18..2e725bfa 100644
--- a/resources/bytecode/javFiles/Lambda.jav
+++ b/resources/bytecode/javFiles/Lambda.jav
@@ -2,7 +2,7 @@ import java.lang.Integer;
public class Lambda {
- m () {
+ public m() {
var lam1 = (x) -> {
return x;
};
diff --git a/resources/bytecode/javFiles/Literal.jav b/resources/bytecode/javFiles/Literal.jav
index 52e1c8c9..eee2caa8 100644
--- a/resources/bytecode/javFiles/Literal.jav
+++ b/resources/bytecode/javFiles/Literal.jav
@@ -1,6 +1,6 @@
import java.lang.Character;
public class Literal {
- m() { return null; }
- m2() { return 'C'; }
+ public m() { return null; }
+ public m2() { return 'C'; }
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Matrix.jav b/resources/bytecode/javFiles/Matrix.jav
index b94c0783..35d65d51 100644
--- a/resources/bytecode/javFiles/Matrix.jav
+++ b/resources/bytecode/javFiles/Matrix.jav
@@ -9,7 +9,7 @@ public class Matrix extends Vector> {
Matrix () {
}
- Matrix(vv) {
+ public Matrix(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
@@ -19,7 +19,7 @@ public class Matrix extends Vector> {
}
}
- mul(m) {
+ public mul(m) {
var ret = new Matrix();
var i = 0;
while(i < size()) {
diff --git a/resources/bytecode/javFiles/MatrixOP.jav b/resources/bytecode/javFiles/MatrixOP.jav
index 21d37347..749f208f 100644
--- a/resources/bytecode/javFiles/MatrixOP.jav
+++ b/resources/bytecode/javFiles/MatrixOP.jav
@@ -8,7 +8,7 @@ public class MatrixOP extends Vector> {
MatrixOP () {
}
- MatrixOP(vv) {
+ public MatrixOP(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
diff --git a/resources/bytecode/javFiles/Merge.jav b/resources/bytecode/javFiles/Merge.jav
index ad5e103e..c25c00a4 100644
--- a/resources/bytecode/javFiles/Merge.jav
+++ b/resources/bytecode/javFiles/Merge.jav
@@ -2,16 +2,16 @@ import java.util.List;
import java.lang.Integer;
//import java.util.Collection;
-class Merge {
+public class Merge {
- merge(a, b) {
+ public merge(a, b) {
a.addAll(b);
return a;
}
- sort(in){
+ public sort(in){
var firstHalf = in.subList(1,2);
var secondHalf = in.subList(1,2);
return merge(sort(firstHalf), sort(secondHalf));
diff --git a/resources/bytecode/javFiles/OL.jav b/resources/bytecode/javFiles/OL.jav
index afeaa2f5..1c0230b7 100644
--- a/resources/bytecode/javFiles/OL.jav
+++ b/resources/bytecode/javFiles/OL.jav
@@ -2,7 +2,7 @@ import java.lang.Double;
import java.lang.String;
import java.lang.Long;
-class OL {
+public class OL {
m (x) { return x + x; }
}
diff --git a/resources/bytecode/javFiles/OLConstructor.jav b/resources/bytecode/javFiles/OLConstructor.jav
index 815c80be..1e315097 100644
--- a/resources/bytecode/javFiles/OLConstructor.jav
+++ b/resources/bytecode/javFiles/OLConstructor.jav
@@ -10,8 +10,8 @@ public class Parent {
public Parent() {}
}
-class Child extends Parent {
- Child() {
+public class Child extends Parent {
+ public Child() {
super(3);
}
}
diff --git a/resources/bytecode/javFiles/Op2.jav b/resources/bytecode/javFiles/Op2.jav
index 4bf3b77e..cda23aef 100644
--- a/resources/bytecode/javFiles/Op2.jav
+++ b/resources/bytecode/javFiles/Op2.jav
@@ -3,9 +3,9 @@ import java.lang.Double;
import java.lang.String;
public class Op2 {
- m(){
- //var x = "";
- //var a = 5+x;
+ public m(){
+ var x = "";
+ var a = 5+x;
Integer x = 10;
Double y = 10.5;
diff --git a/resources/bytecode/javFiles/OverloadPattern.jav b/resources/bytecode/javFiles/OverloadPattern.jav
index 5e864164..e7f777de 100644
--- a/resources/bytecode/javFiles/OverloadPattern.jav
+++ b/resources/bytecode/javFiles/OverloadPattern.jav
@@ -5,15 +5,15 @@ import java.lang.Float;
record Point(Number x, Number y) {}
public class OverloadPattern {
- m(Point(Integer x, Integer y)) {
+ public m(Point(Integer x, Integer y)) {
return x + y;
}
- m(Point(Float x, Float y)) {
+ public m(Point(Float x, Float y)) {
return x * y;
}
- m(Integer x) {
+ public m(Integer x) {
return x;
}
}
diff --git a/resources/bytecode/javFiles/Overloading.jav b/resources/bytecode/javFiles/Overloading.jav
index fb48fe0f..c44a7a9b 100644
--- a/resources/bytecode/javFiles/Overloading.jav
+++ b/resources/bytecode/javFiles/Overloading.jav
@@ -2,17 +2,17 @@ import java.lang.String;
public class Overloading{
- test(x){
+ public test(x){
return x.methode();
}
- methode(){
+ public methode(){
return "Overloading";
}
}
public class Overloading2{
- methode(){
+ public methode(){
return "Overloading2";
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Pair.jav b/resources/bytecode/javFiles/Pair.jav
index 9b32bc02..4547ad10 100644
--- a/resources/bytecode/javFiles/Pair.jav
+++ b/resources/bytecode/javFiles/Pair.jav
@@ -3,15 +3,15 @@ import java.lang.Boolean;
import java.lang.Object;
-class Pair {
+public class Pair {
T x;
U y;
- fst () {
+ public fst() {
return x;
}
- snd () {
+ public snd() {
return y;
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/Plus.jav b/resources/bytecode/javFiles/Plus.jav
index 1cdecc8c..74bdc61c 100644
--- a/resources/bytecode/javFiles/Plus.jav
+++ b/resources/bytecode/javFiles/Plus.jav
@@ -3,7 +3,7 @@ import java.lang.String;
public class Plus {
- m(a,b) {
+ public m(a,b) {
return a+b;
}
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/RecordTest.jav b/resources/bytecode/javFiles/RecordTest.jav
index c64c3d94..b758f5e4 100644
--- a/resources/bytecode/javFiles/RecordTest.jav
+++ b/resources/bytecode/javFiles/RecordTest.jav
@@ -15,8 +15,8 @@ public class RecordTest {
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(); }
+ public doesEqual() { return a.equals(b); }
+ public doesNotEqual() { return b.equals(c); }
+ public hashCode() { return a.hashCode(); }
+ public toString() { return a.toString(); }
}
\ No newline at end of file
diff --git a/resources/bytecode/javFiles/RelOps.jav b/resources/bytecode/javFiles/RelOps.jav
index 0fdd2cff..63491d90 100644
--- a/resources/bytecode/javFiles/RelOps.jav
+++ b/resources/bytecode/javFiles/RelOps.jav
@@ -2,7 +2,7 @@ import java.lang.Integer;
import java.lang.Boolean;
public class RelOps {
- m(a,b){
+ public m(a,b){
return a {
- Scalar(v) {
+ public Scalar(v) {
Integer i;
i = 0;
while(i < v.size()) {
@@ -15,7 +15,7 @@ public class Scalar extends Vector {
}
}
- mul(v) {
+ public mul(v) {
var ret = 0;
var i = 0;
while(i < size()) {
diff --git a/resources/bytecode/javFiles/Static.jav b/resources/bytecode/javFiles/Static.jav
index aa0c3373..a02ef3c3 100644
--- a/resources/bytecode/javFiles/Static.jav
+++ b/resources/bytecode/javFiles/Static.jav
@@ -12,7 +12,7 @@ public class Static {
i = x;
}
- static m() {
+ public static m() {
return i + Other.field;
}
}
diff --git a/resources/bytecode/javFiles/Switch.jav b/resources/bytecode/javFiles/Switch.jav
index 9c0e741f..f120f819 100644
--- a/resources/bytecode/javFiles/Switch.jav
+++ b/resources/bytecode/javFiles/Switch.jav
@@ -2,10 +2,10 @@ import java.lang.Integer;
import java.lang.Object;
import java.lang.Float;
-record Rec(Integer a, Object b) {}
+public record Rec(Integer a, Object b) {}
public class Switch {
- main(o) {
+ public main(o) {
return switch (o) {
case Rec(Integer a, Integer b) -> a + b;
case Rec(Integer a, Float b) -> a + 10;
diff --git a/resources/bytecode/javFiles/SwitchString.jav b/resources/bytecode/javFiles/SwitchString.jav
index e8758c25..53dcc93e 100644
--- a/resources/bytecode/javFiles/SwitchString.jav
+++ b/resources/bytecode/javFiles/SwitchString.jav
@@ -3,7 +3,7 @@ import java.lang.String;
import java.lang.Object;
public class SwitchString {
- main(o) {
+ public main(o) {
return switch (o) {
case "AaAaAa" -> 1; // These two have the same hash code!
case "AaAaBB" -> 2;
diff --git a/resources/bytecode/javFiles/TXGenerics.jav b/resources/bytecode/javFiles/TXGenerics.jav
index 8dd7ab76..7f0f7081 100644
--- a/resources/bytecode/javFiles/TXGenerics.jav
+++ b/resources/bytecode/javFiles/TXGenerics.jav
@@ -1,10 +1,10 @@
import java.lang.String;
-class TXGenerics {
+public class TXGenerics {
a;
b;
- test() {
+ public test() {
var c = new Cycle();
c.m(a, b);
}
diff --git a/resources/bytecode/javFiles/Y.jav b/resources/bytecode/javFiles/Y.jav
index a97360d4..0c14b498 100644
--- a/resources/bytecode/javFiles/Y.jav
+++ b/resources/bytecode/javFiles/Y.jav
@@ -1,10 +1,10 @@
import java.lang.Integer;
-class Y {
+public class Y {
y;
//factorial;
- Y() {
+ public Y() {
y = f -> t -> f.apply(y.apply(f)).apply(t);
//factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); });
}
diff --git a/resources/bytecode/javFiles/applyLambda.jav b/resources/bytecode/javFiles/applyLambda.jav
index 331bfbfe..37a3fbab 100644
--- a/resources/bytecode/javFiles/applyLambda.jav
+++ b/resources/bytecode/javFiles/applyLambda.jav
@@ -3,7 +3,7 @@ class Apply { }
public class applyLambda {
- m () {
+ public m () {
var lam1 = (x) -> {
return x;
};
diff --git a/src/test/java/TestComplete.java b/src/test/java/TestComplete.java
index f5fab9ec..4d1fbc94 100644
--- a/src/test/java/TestComplete.java
+++ b/src/test/java/TestComplete.java
@@ -670,6 +670,7 @@ public class TestComplete {
assertEquals(swtch.invoke(instance, "Some string"), 0);
}
+ @Ignore("Not implemented")
@Test
public void testSwitch2() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Switch2.jav");
@@ -698,6 +699,7 @@ public class TestComplete {
var instance = clazz.getDeclaredConstructor().newInstance();
}
+ @Ignore("Not implemented")
@Test
public void testOverloadPattern() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "OverloadPattern.jav");
@@ -833,6 +835,7 @@ public class TestComplete {
assertEquals(clazz.getSuperclass().getDeclaredField("x").get(instance), 3);
}
+ @Ignore("Not implemented")
@Test
public void testStringConcat() throws Exception {
var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Op2.jav");
@@ -923,4 +926,11 @@ public class TestComplete {
var clazz = classFiles.get("Bug285");
var instance = clazz.getDeclaredConstructor().newInstance();
}
+
+ @Test
+ public void testBug290() throws Exception {
+ var classFiles = generateClassFiles(new ByteArrayClassLoader(), "Bug290A.jav");
+ var clazz = classFiles.get("Bug290A");
+ var instance = clazz.getDeclaredConstructor().newInstance();
+ }
}