From d52fbeb1aebfb1dea2406627e24ff84a5ae8f087 Mon Sep 17 00:00:00 2001 From: luca9913 Date: Wed, 21 Jun 2023 21:06:14 +0200 Subject: [PATCH] Moved all javFiles to test/resources/javFiles and removed unused resources --- .../syntaxtreegenerator/TestComplete.java | 2 +- .../java/targetast/ASTToTypedTargetAST.java | 18 +++--- src/test/java/targetast/TestCodegen.java | 2 +- src/test/java/targetast/TestGenerics.java | 2 +- src/test/resources/AllgemeinTest/Box.jav | 13 ---- src/test/resources/AllgemeinTest/Box_Main.jav | 13 ---- src/test/resources/AllgemeinTest/FCTest1.jav | 12 ---- src/test/resources/AllgemeinTest/FCTest2.jav | 11 ---- src/test/resources/AllgemeinTest/FCTest3.jav | 19 ------ src/test/resources/AllgemeinTest/GenTest.jav | 10 --- src/test/resources/AllgemeinTest/Generics.jav | 9 --- src/test/resources/AllgemeinTest/M.jav | 7 -- .../AllgemeinTest/OverloadingMain.jav | 9 --- .../AllgemeinTest/Overloading_Generics.jav | 20 ------ .../resources/AllgemeinTest/OverrideMain.jav | 25 -------- .../AllgemeinTest/OverrideMainRet.jav | 11 ---- src/test/resources/AllgemeinTest/Pair.java | 18 ------ src/test/resources/AllgemeinTest/Put.jav | 19 ------ src/test/resources/AllgemeinTest/Test.jav | 4 -- .../AllgemeinTest/TestSubTypless.jav | 12 ---- src/test/resources/AllgemeinTest/Twice.jav | 3 - src/test/resources/AllgemeinTest/Var.jav | 5 -- .../AllgemeinTest/VectorConstAdd.jav | 15 ----- .../AllgemeinTest/VectorNotObject.jav | 9 --- .../WildcardCaptureConversionTest.jav | 16 ----- .../resources/AllgemeinTest/Wildcard_Andi.jav | 8 --- src/test/resources/AllgemeinTest/addList.jav | 8 --- .../resources/AllgemeinTest/wildcardPair.jav | 22 ------- .../bytecode/javFiles/EmptyMethod.jav | 8 --- .../resources/bytecode/javFiles/Faculty.jav | 52 --------------- .../resources/bytecode/javFiles/Generics.jav | 17 ----- .../resources/bytecode/javFiles/IfTest.jav | 15 ----- .../resources/bytecode/javFiles/Import.jav | 8 --- .../resources/bytecode/javFiles/Lambda.jav | 11 ---- .../resources/bytecode/javFiles/Lambda2.jav | 35 ---------- .../resources/bytecode/javFiles/Lambda3.jav | 23 ------- .../resources/bytecode/javFiles/Matrix.jav | 44 ------------- .../resources/bytecode/javFiles/Methods.jav | 14 ---- .../resources/bytecode/javFiles/Sorting.jav | 23 ------- .../resources/bytecode/javFiles/mathStruc.jav | 15 ----- .../resources/{bytecode => }/javFiles/AA.jav | 0 .../{bytecode => }/javFiles/AssignToLit.jav | 0 .../resources/{bytecode => }/javFiles/BB.jav | 0 .../{bytecode => }/javFiles/BinaryInMeth.jav | 0 .../resources/{bytecode => }/javFiles/Box.jav | 0 .../{bytecode => }/javFiles/Box.java | 0 .../resources/{bytecode => }/javFiles/CC.jav | 0 .../{bytecode => }/javFiles/ClassGenLam.jav | 0 .../{bytecode => }/javFiles/Cycle.jav | 0 .../resources/{bytecode => }/javFiles/DD.jav | 0 .../{bytecode => }/javFiles/DuMethod.jav | 0 src/test/resources/javFiles/EmptyMethod.jav | 31 +-------- .../{bytecode => }/javFiles/Example.jav | 0 .../{bytecode => }/javFiles/Exceptions.jav | 0 .../resources/{bytecode => }/javFiles/Fac.jav | 0 src/test/resources/javFiles/Faculty.jav | 64 +++++++++++++++---- .../{bytecode => }/javFiles/Faculty2.jav | 0 .../{bytecode => }/javFiles/Field.jav | 0 .../{bytecode => }/javFiles/FieldTph.jav | 0 .../{bytecode => }/javFiles/FieldTph2.jav | 0 .../javFiles/FieldTphConsMeth.jav | 0 .../{bytecode => }/javFiles/FieldTphMMeth.jav | 0 .../resources/{bytecode => }/javFiles/For.jav | 0 .../{bytecode => }/javFiles/FunOL.jav | 0 .../resources/{bytecode => }/javFiles/Gen.jav | 0 src/test/resources/javFiles/Generics.jav | 13 ++-- .../{bytecode => }/javFiles/Generics2.jav | 0 .../{bytecode => }/javFiles/Generics3.jav | 0 .../{bytecode => }/javFiles/Generics4.jav | 0 .../{bytecode => }/javFiles/GreaterEqual.jav | 0 .../{bytecode => }/javFiles/GreaterThan.jav | 0 .../resources/{bytecode => }/javFiles/Id.jav | 0 src/test/resources/javFiles/IfTest.jav | 7 +- src/test/resources/javFiles/Import.jav | 4 +- .../resources/{bytecode => }/javFiles/Inf.jav | 0 .../{bytecode => }/javFiles/Infimum.jav | 0 .../{bytecode => }/javFiles/Inherit.jav | 0 .../{bytecode => }/javFiles/Inherit2.jav | 0 .../{bytecode => }/javFiles/Interface1.jav | 0 .../{bytecode => }/javFiles/KompTph.jav | 0 .../{bytecode => }/javFiles/LamRunnable.jav | 0 src/test/resources/javFiles/Lambda.jav | 6 +- src/test/resources/javFiles/Lambda2.jav | 8 ++- src/test/resources/javFiles/Lambda3.jav | 1 - .../{bytecode => }/javFiles/Lambda4.jav | 0 .../{bytecode => }/javFiles/LambdaCapture.jav | 0 .../{bytecode => }/javFiles/LambdaVoid.jav | 0 .../{bytecode => }/javFiles/LessEqual.jav | 0 .../{bytecode => }/javFiles/LessThan.jav | 0 src/test/resources/javFiles/Matrix.jav | 32 +++++++--- .../{bytecode => }/javFiles/MatrixOP.jav | 0 .../{bytecode => }/javFiles/Merge.jav | 0 src/test/resources/javFiles/Methods.jav | 25 ++++---- .../resources/{bytecode => }/javFiles/OL.jav | 0 .../{bytecode => }/javFiles/OLFun.jav | 0 .../{bytecode => }/javFiles/OLFun2.jav | 0 .../resources/{bytecode => }/javFiles/Op.jav | 0 .../resources/{bytecode => }/javFiles/Op2.jav | 0 .../{bytecode => }/javFiles/OverlaodGen.jav | 0 .../{bytecode => }/javFiles/Overloading.jav | 0 .../{bytecode => }/javFiles/Plus.jav | 0 .../{bytecode => }/javFiles/PostIncDec.jav | 0 .../{bytecode => }/javFiles/PreInc.jav | 0 .../resources/{bytecode => }/javFiles/Put.jav | 0 .../{bytecode => }/javFiles/RecursiveMeth.jav | 0 .../{bytecode => }/javFiles/RelOps.jav | 0 .../{bytecode => }/javFiles/ReturnMethod.jav | 0 .../{bytecode => }/javFiles/SimpleCycle.jav | 0 src/test/resources/javFiles/Sorting.jav | 28 +++++--- .../{bytecode => }/javFiles/StaticM.jav | 0 .../{bytecode => }/javFiles/SubMatrix.jav | 0 .../resources/{bytecode => }/javFiles/Tph.jav | 0 .../{bytecode => }/javFiles/Tph2.jav | 0 .../{bytecode => }/javFiles/Tph3.jav | 0 .../{bytecode => }/javFiles/Tph4.jav | 0 .../{bytecode => }/javFiles/Tph5.jav | 0 .../{bytecode => }/javFiles/Tph6.jav | 0 .../{bytecode => }/javFiles/Tph7.jav | 0 .../{bytecode => }/javFiles/TypedID.jav | 0 .../{bytecode => }/javFiles/VectorAdd.jav | 0 .../{bytecode => }/javFiles/VectorSuper.jav | 0 .../{bytecode => }/javFiles/VoidMeth.jav | 0 .../resources/{bytecode => }/javFiles/WC.jav | 0 .../{bytecode => }/javFiles/While.jav | 0 .../resources/{bytecode => }/javFiles/Y.jav | 0 .../{bytecode => }/javFiles/applyLambda.jav | 0 .../insertGenericsJav/TestAny.jav | 0 .../insertGenericsJav/TestClassField.jav | 0 .../insertGenericsJav/TestContraVariant.jav | 0 .../insertGenericsJav/TestGGFinder.jav | 0 .../insertGenericsJav/TestLocalVarLambda.jav | 0 .../insertGenericsJav/TestMutualRecursion.jav | 0 .../TestMutualRecursionWithField.jav | 0 .../TestMutualRecursionWithField2.jav | 0 .../TestMutualRecursionWithField3.jav | 0 .../insertGenericsJav/TestReturnVar.jav | 0 .../TestSecondLineOfClassConstraints.jav | 0 .../insertGenericsJav/TestTPHsAndGenerics.jav | 0 .../TestTPHsAndGenerics2.jav | 0 .../insertGenericsJav/TestThreeArgs.jav | 0 .../insertGenericsJav/TestTwoArgs.jav | 0 .../insertGenericsJav/TestTwoArgs2.jav | 0 .../insertGenericsJav/TestTwoCalls.jav | 0 .../insertGenericsJav/TestVector.jav | 0 .../insertGenericsJav/TestVectorArg.jav | 0 .../insertGenericsJav/TestVoidMeth.jav | 0 src/test/resources/javFiles/mathStruc.jav | 17 +++-- .../javFiles/mathStrucInteger.jav | 0 .../javFiles/mathStrucMatrixOP.jav | 0 149 files changed, 145 insertions(+), 678 deletions(-) delete mode 100644 src/test/resources/AllgemeinTest/Box.jav delete mode 100644 src/test/resources/AllgemeinTest/Box_Main.jav delete mode 100644 src/test/resources/AllgemeinTest/FCTest1.jav delete mode 100644 src/test/resources/AllgemeinTest/FCTest2.jav delete mode 100644 src/test/resources/AllgemeinTest/FCTest3.jav delete mode 100644 src/test/resources/AllgemeinTest/GenTest.jav delete mode 100644 src/test/resources/AllgemeinTest/Generics.jav delete mode 100755 src/test/resources/AllgemeinTest/M.jav delete mode 100644 src/test/resources/AllgemeinTest/OverloadingMain.jav delete mode 100644 src/test/resources/AllgemeinTest/Overloading_Generics.jav delete mode 100644 src/test/resources/AllgemeinTest/OverrideMain.jav delete mode 100644 src/test/resources/AllgemeinTest/OverrideMainRet.jav delete mode 100644 src/test/resources/AllgemeinTest/Pair.java delete mode 100644 src/test/resources/AllgemeinTest/Put.jav delete mode 100644 src/test/resources/AllgemeinTest/Test.jav delete mode 100644 src/test/resources/AllgemeinTest/TestSubTypless.jav delete mode 100644 src/test/resources/AllgemeinTest/Twice.jav delete mode 100644 src/test/resources/AllgemeinTest/Var.jav delete mode 100644 src/test/resources/AllgemeinTest/VectorConstAdd.jav delete mode 100644 src/test/resources/AllgemeinTest/VectorNotObject.jav delete mode 100644 src/test/resources/AllgemeinTest/WildcardCaptureConversionTest.jav delete mode 100644 src/test/resources/AllgemeinTest/Wildcard_Andi.jav delete mode 100755 src/test/resources/AllgemeinTest/addList.jav delete mode 100644 src/test/resources/AllgemeinTest/wildcardPair.jav delete mode 100644 src/test/resources/bytecode/javFiles/EmptyMethod.jav delete mode 100644 src/test/resources/bytecode/javFiles/Faculty.jav delete mode 100644 src/test/resources/bytecode/javFiles/Generics.jav delete mode 100644 src/test/resources/bytecode/javFiles/IfTest.jav delete mode 100644 src/test/resources/bytecode/javFiles/Import.jav delete mode 100644 src/test/resources/bytecode/javFiles/Lambda.jav delete mode 100644 src/test/resources/bytecode/javFiles/Lambda2.jav delete mode 100644 src/test/resources/bytecode/javFiles/Lambda3.jav delete mode 100644 src/test/resources/bytecode/javFiles/Matrix.jav delete mode 100644 src/test/resources/bytecode/javFiles/Methods.jav delete mode 100644 src/test/resources/bytecode/javFiles/Sorting.jav delete mode 100644 src/test/resources/bytecode/javFiles/mathStruc.jav rename src/test/resources/{bytecode => }/javFiles/AA.jav (100%) rename src/test/resources/{bytecode => }/javFiles/AssignToLit.jav (100%) rename src/test/resources/{bytecode => }/javFiles/BB.jav (100%) rename src/test/resources/{bytecode => }/javFiles/BinaryInMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Box.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Box.java (100%) rename src/test/resources/{bytecode => }/javFiles/CC.jav (100%) rename src/test/resources/{bytecode => }/javFiles/ClassGenLam.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Cycle.jav (100%) rename src/test/resources/{bytecode => }/javFiles/DD.jav (100%) rename src/test/resources/{bytecode => }/javFiles/DuMethod.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Example.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Exceptions.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Fac.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Faculty2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Field.jav (100%) rename src/test/resources/{bytecode => }/javFiles/FieldTph.jav (100%) rename src/test/resources/{bytecode => }/javFiles/FieldTph2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/FieldTphConsMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/FieldTphMMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/For.jav (100%) rename src/test/resources/{bytecode => }/javFiles/FunOL.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Gen.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Generics2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Generics3.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Generics4.jav (100%) rename src/test/resources/{bytecode => }/javFiles/GreaterEqual.jav (100%) rename src/test/resources/{bytecode => }/javFiles/GreaterThan.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Id.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Inf.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Infimum.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Inherit.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Inherit2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Interface1.jav (100%) rename src/test/resources/{bytecode => }/javFiles/KompTph.jav (100%) rename src/test/resources/{bytecode => }/javFiles/LamRunnable.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Lambda4.jav (100%) rename src/test/resources/{bytecode => }/javFiles/LambdaCapture.jav (100%) rename src/test/resources/{bytecode => }/javFiles/LambdaVoid.jav (100%) rename src/test/resources/{bytecode => }/javFiles/LessEqual.jav (100%) rename src/test/resources/{bytecode => }/javFiles/LessThan.jav (100%) rename src/test/resources/{bytecode => }/javFiles/MatrixOP.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Merge.jav (100%) rename src/test/resources/{bytecode => }/javFiles/OL.jav (100%) rename src/test/resources/{bytecode => }/javFiles/OLFun.jav (100%) rename src/test/resources/{bytecode => }/javFiles/OLFun2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Op.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Op2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/OverlaodGen.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Overloading.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Plus.jav (100%) rename src/test/resources/{bytecode => }/javFiles/PostIncDec.jav (100%) rename src/test/resources/{bytecode => }/javFiles/PreInc.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Put.jav (100%) rename src/test/resources/{bytecode => }/javFiles/RecursiveMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/RelOps.jav (100%) rename src/test/resources/{bytecode => }/javFiles/ReturnMethod.jav (100%) rename src/test/resources/{bytecode => }/javFiles/SimpleCycle.jav (100%) rename src/test/resources/{bytecode => }/javFiles/StaticM.jav (100%) rename src/test/resources/{bytecode => }/javFiles/SubMatrix.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph2.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph3.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph4.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph5.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph6.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Tph7.jav (100%) rename src/test/resources/{bytecode => }/javFiles/TypedID.jav (100%) rename src/test/resources/{bytecode => }/javFiles/VectorAdd.jav (100%) rename src/test/resources/{bytecode => }/javFiles/VectorSuper.jav (100%) rename src/test/resources/{bytecode => }/javFiles/VoidMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/WC.jav (100%) rename src/test/resources/{bytecode => }/javFiles/While.jav (100%) rename src/test/resources/{bytecode => }/javFiles/Y.jav (100%) rename src/test/resources/{bytecode => }/javFiles/applyLambda.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestAny.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestClassField.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestContraVariant.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestGGFinder.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestLocalVarLambda.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestMutualRecursion.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestMutualRecursionWithField.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestMutualRecursionWithField2.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestMutualRecursionWithField3.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestReturnVar.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestSecondLineOfClassConstraints.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestTPHsAndGenerics.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestTPHsAndGenerics2.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestThreeArgs.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestTwoArgs.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestTwoArgs2.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestTwoCalls.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestVector.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestVectorArg.jav (100%) rename src/test/resources/{ => javFiles}/insertGenericsJav/TestVoidMeth.jav (100%) rename src/test/resources/{bytecode => }/javFiles/mathStrucInteger.jav (100%) rename src/test/resources/{bytecode => }/javFiles/mathStrucMatrixOP.jav (100%) diff --git a/src/test/java/syntaxtreegenerator/TestComplete.java b/src/test/java/syntaxtreegenerator/TestComplete.java index 2b56308d..8a23fbd1 100644 --- a/src/test/java/syntaxtreegenerator/TestComplete.java +++ b/src/test/java/syntaxtreegenerator/TestComplete.java @@ -24,7 +24,7 @@ public class TestComplete { @BeforeClass public static void setUp() { - final String testFileDirectory = "src/test/resources/bytecode/javFiles/"; + final String testFileDirectory = "src/test/resources/javFiles/"; final String expectedASTDirectory = "src/test/resources/syntaxtreegenerator/"; File dir = new File(testFileDirectory); for (File f : dir.listFiles(new JavFilter())) { diff --git a/src/test/java/targetast/ASTToTypedTargetAST.java b/src/test/java/targetast/ASTToTypedTargetAST.java index 613267cf..ecc070e1 100644 --- a/src/test/java/targetast/ASTToTypedTargetAST.java +++ b/src/test/java/targetast/ASTToTypedTargetAST.java @@ -35,7 +35,7 @@ public class ASTToTypedTargetAST { @Test public void overloading() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Overloading.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Overloading.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -57,7 +57,7 @@ public class ASTToTypedTargetAST { @Test public void tphsAndGenerics() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Tph2.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Tph2.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -68,7 +68,7 @@ public class ASTToTypedTargetAST { @Test public void cycles() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Cycle.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Cycle.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -79,7 +79,7 @@ public class ASTToTypedTargetAST { @Test public void infimum() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Infimum.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Infimum.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -90,7 +90,7 @@ public class ASTToTypedTargetAST { @Test public void gen() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Gen.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Gen.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -106,7 +106,7 @@ public class ASTToTypedTargetAST { @Test public void definedGenerics() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Generics.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Generics.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -124,7 +124,7 @@ public class ASTToTypedTargetAST { @Test public void definedGenerics2() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Generics2.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Generics2.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -140,7 +140,7 @@ public class ASTToTypedTargetAST { @Test @Ignore("Not implemented") public void definedGenerics3() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Generics3.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Generics3.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); @@ -151,7 +151,7 @@ public class ASTToTypedTargetAST { @Test public void definedGenerics4() throws Exception { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/Generics4.jav").toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/Generics4.jav").toFile(); var compiler = new JavaTXCompiler(file); var resultSet = compiler.typeInference(); var converter = new ASTToTargetAST(resultSet); diff --git a/src/test/java/targetast/TestCodegen.java b/src/test/java/targetast/TestCodegen.java index ca6a0bfe..8ec2a63f 100644 --- a/src/test/java/targetast/TestCodegen.java +++ b/src/test/java/targetast/TestCodegen.java @@ -41,7 +41,7 @@ public class TestCodegen { } public static Map> generateClassFiles(String filename, IByteArrayClassLoader classLoader) throws IOException, ClassNotFoundException { - var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/bytecode/javFiles/", filename).toFile(); + var file = Path.of(System.getProperty("user.dir"), "/src/test/resources/javFiles/", filename).toFile(); var compiler = new JavaTXCompiler(List.of(file), List.of(file.getParentFile())); var resultSet = compiler.typeInference(); diff --git a/src/test/java/targetast/TestGenerics.java b/src/test/java/targetast/TestGenerics.java index 343d6a58..2a72af78 100644 --- a/src/test/java/targetast/TestGenerics.java +++ b/src/test/java/targetast/TestGenerics.java @@ -22,7 +22,7 @@ import java.util.List; public class TestGenerics { - private static final String rootDirectory = System.getProperty("user.dir") + "/src/test/resources/insertGenericsJav/"; + private static final String rootDirectory = System.getProperty("user.dir") + "/src/test/resources/javFiles/insertGenericsJav/"; private static final String bytecodeDirectory = System.getProperty("user.dir") + "/src/test/resources/testBytecode/generatedBC/"; private record Result(List genericsResults, ClassOrInterface clazz) { diff --git a/src/test/resources/AllgemeinTest/Box.jav b/src/test/resources/AllgemeinTest/Box.jav deleted file mode 100644 index 411f0551..00000000 --- a/src/test/resources/AllgemeinTest/Box.jav +++ /dev/null @@ -1,13 +0,0 @@ -class Box{ -void m(A a){} -} - -class B { } - -class Box_Main extends B { - - m(b) { - b.m(new Box_Main()); - b.m(new B()); - } -} diff --git a/src/test/resources/AllgemeinTest/Box_Main.jav b/src/test/resources/AllgemeinTest/Box_Main.jav deleted file mode 100644 index 0ba86f19..00000000 --- a/src/test/resources/AllgemeinTest/Box_Main.jav +++ /dev/null @@ -1,13 +0,0 @@ -class Box{ - A f; -} - -class B { } - -class Box_Main extends B {//Fehler Bugzilla Bug 230 - - m(b) { - b.f = new Box_Main(); - b.f = new B(); - } -} diff --git a/src/test/resources/AllgemeinTest/FCTest1.jav b/src/test/resources/AllgemeinTest/FCTest1.jav deleted file mode 100644 index 98647278..00000000 --- a/src/test/resources/AllgemeinTest/FCTest1.jav +++ /dev/null @@ -1,12 +0,0 @@ -import java.util.Vector; -import java.util.List; -import java.lang.Integer; - -class FCTest1 extends Vector> { - fc1() { - var y; - var z; - y.add(z); - return y; - } -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/FCTest2.jav b/src/test/resources/AllgemeinTest/FCTest2.jav deleted file mode 100644 index c3f892dd..00000000 --- a/src/test/resources/AllgemeinTest/FCTest2.jav +++ /dev/null @@ -1,11 +0,0 @@ -import java.util.Vector; -import java.util.List; -import java.lang.Integer; - -class FCTest2 extends Vector> { - fc2(y) { - var z; - y.add(z); - return y; - } -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/FCTest3.jav b/src/test/resources/AllgemeinTest/FCTest3.jav deleted file mode 100644 index e862c4b8..00000000 --- a/src/test/resources/AllgemeinTest/FCTest3.jav +++ /dev/null @@ -1,19 +0,0 @@ -import java.util.Vector; -import java.lang.Integer; - -class FCTest3 extends Pair, Vector> { - - - fc2(x) { - x.snd().addElement(2); - } - - - - fc2a() { - var y; - y.snd().addElement(2); - return y; - } - -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/GenTest.jav b/src/test/resources/AllgemeinTest/GenTest.jav deleted file mode 100644 index 409838ae..00000000 --- a/src/test/resources/AllgemeinTest/GenTest.jav +++ /dev/null @@ -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); - } -} diff --git a/src/test/resources/AllgemeinTest/Generics.jav b/src/test/resources/AllgemeinTest/Generics.jav deleted file mode 100644 index efed04f0..00000000 --- a/src/test/resources/AllgemeinTest/Generics.jav +++ /dev/null @@ -1,9 +0,0 @@ -class Generics { - a; - id(b) { return b; } - setA(x) { - a = x; - return a; - } - m(x,y) { x = id(y); } -} diff --git a/src/test/resources/AllgemeinTest/M.jav b/src/test/resources/AllgemeinTest/M.jav deleted file mode 100755 index 39e6d482..00000000 --- a/src/test/resources/AllgemeinTest/M.jav +++ /dev/null @@ -1,7 +0,0 @@ -import java.util.List; -class M { -void m(p, p2){ - - new addList().addLists(p, p2); -} -} diff --git a/src/test/resources/AllgemeinTest/OverloadingMain.jav b/src/test/resources/AllgemeinTest/OverloadingMain.jav deleted file mode 100644 index 960f01db..00000000 --- a/src/test/resources/AllgemeinTest/OverloadingMain.jav +++ /dev/null @@ -1,9 +0,0 @@ -import java.util.Stack; -import java.util.Vector; - -class OverloadingMain { - - mmMain(x) { var y; return new O1().mm(y); } - -} - diff --git a/src/test/resources/AllgemeinTest/Overloading_Generics.jav b/src/test/resources/AllgemeinTest/Overloading_Generics.jav deleted file mode 100644 index d5691152..00000000 --- a/src/test/resources/AllgemeinTest/Overloading_Generics.jav +++ /dev/null @@ -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); - } -} - - - diff --git a/src/test/resources/AllgemeinTest/OverrideMain.jav b/src/test/resources/AllgemeinTest/OverrideMain.jav deleted file mode 100644 index 0ede39ae..00000000 --- a/src/test/resources/AllgemeinTest/OverrideMain.jav +++ /dev/null @@ -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 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 K = void)], -[(TPH M = ? extends Override2), (TPH N = java.lang.String), (TPH K = void), (TPH FTR, TPH FTQ), (TPH L = java.util.Vector)], -[(TPH FTT, TPH FTS), (TPH M = ? extends Override2), (TPH L = java.util.Vector), (TPH K = void), (TPH N = java.lang.String)], -[(TPH L = java.util.Vector), (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 K = void), (TPH N = java.lang.String)], -[(TPH M = ? extends Override2), (TPH L = java.util.Stack), (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 N = java.lang.String), (TPH L = java.util.Vector), (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 M = ? extends Override2), (TPH MNX, TPH MNY), (TPH N = java.lang.String), (TPH K = void), (TPH L = java.util.Stack)], [(TPH L = java.util.Stack), (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 K = void)], [(TPH L = java.util.Vector), (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 L = java.util.Vector), (TPH K = void), (TPH MOH, TPH MOI), (TPH M = ? extends Override2), (TPH N = java.lang.String)], [(TPH L = java.util.Vector), (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 M = ? extends Override2), (TPH K = void), (TPH N = java.lang.String)], [(TPH L = java.util.Vector), (TPH MON, TPH MOO), (TPH N = java.lang.String), (TPH K = void), (TPH M = ? extends Override2)], [(TPH L = java.util.Stack), (TPH N = java.lang.String), (TPH M = ? extends Override2), (TPH MOQ, TPH MOP), (TPH K = void)]] -*/ diff --git a/src/test/resources/AllgemeinTest/OverrideMainRet.jav b/src/test/resources/AllgemeinTest/OverrideMainRet.jav deleted file mode 100644 index 44759c81..00000000 --- a/src/test/resources/AllgemeinTest/OverrideMainRet.jav +++ /dev/null @@ -1,11 +0,0 @@ -import java.util.Vector; -import java.util.Stack; - -class OverrideMainRet { - ovrMain() { - var overide; - var x; - overide.ovr(x); - return x; - } -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Pair.java b/src/test/resources/AllgemeinTest/Pair.java deleted file mode 100644 index b47b1d84..00000000 --- a/src/test/resources/AllgemeinTest/Pair.java +++ /dev/null @@ -1,18 +0,0 @@ -class Pair { - 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; - } -} diff --git a/src/test/resources/AllgemeinTest/Put.jav b/src/test/resources/AllgemeinTest/Put.jav deleted file mode 100644 index b22977c6..00000000 --- a/src/test/resources/AllgemeinTest/Put.jav +++ /dev/null @@ -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); - } - -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Test.jav b/src/test/resources/AllgemeinTest/Test.jav deleted file mode 100644 index 3d505a85..00000000 --- a/src/test/resources/AllgemeinTest/Test.jav +++ /dev/null @@ -1,4 +0,0 @@ -class Test { - a; - Test b; -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/TestSubTypless.jav b/src/test/resources/AllgemeinTest/TestSubTypless.jav deleted file mode 100644 index 667fe6e7..00000000 --- a/src/test/resources/AllgemeinTest/TestSubTypless.jav +++ /dev/null @@ -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); - } -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Twice.jav b/src/test/resources/AllgemeinTest/Twice.jav deleted file mode 100644 index 396bc5e2..00000000 --- a/src/test/resources/AllgemeinTest/Twice.jav +++ /dev/null @@ -1,3 +0,0 @@ -class Twice { - twice = f -> x -> f.apply(f.apply(x)); -} diff --git a/src/test/resources/AllgemeinTest/Var.jav b/src/test/resources/AllgemeinTest/Var.jav deleted file mode 100644 index b95b3667..00000000 --- a/src/test/resources/AllgemeinTest/Var.jav +++ /dev/null @@ -1,5 +0,0 @@ -class Var { - - var(x) { var y; } - -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/VectorConstAdd.jav b/src/test/resources/AllgemeinTest/VectorConstAdd.jav deleted file mode 100644 index b179bdcc..00000000 --- a/src/test/resources/AllgemeinTest/VectorConstAdd.jav +++ /dev/null @@ -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; - } -} diff --git a/src/test/resources/AllgemeinTest/VectorNotObject.jav b/src/test/resources/AllgemeinTest/VectorNotObject.jav deleted file mode 100644 index d8ea900b..00000000 --- a/src/test/resources/AllgemeinTest/VectorNotObject.jav +++ /dev/null @@ -1,9 +0,0 @@ -import java.util.Vector; - -class VectorNotObject { - - vectorAddAll(v1, v2) { - v1.addAll(v2); - return v1; - } - } diff --git a/src/test/resources/AllgemeinTest/WildcardCaptureConversionTest.jav b/src/test/resources/AllgemeinTest/WildcardCaptureConversionTest.jav deleted file mode 100644 index 59016f7a..00000000 --- a/src/test/resources/AllgemeinTest/WildcardCaptureConversionTest.jav +++ /dev/null @@ -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(); - y = new Vector(); - x.add(1); - y.add("2"); - //Integer i = x.elementAt(0); - //String s = y.elementAt(0); - return z.vectorAddAll(x, y); - } -} \ No newline at end of file diff --git a/src/test/resources/AllgemeinTest/Wildcard_Andi.jav b/src/test/resources/AllgemeinTest/Wildcard_Andi.jav deleted file mode 100644 index e6160437..00000000 --- a/src/test/resources/AllgemeinTest/Wildcard_Andi.jav +++ /dev/null @@ -1,8 +0,0 @@ -class Wildcard_Andi { - - Test ex = new Test<>(); - - Test sup = new Test<>(); -} - - diff --git a/src/test/resources/AllgemeinTest/addList.jav b/src/test/resources/AllgemeinTest/addList.jav deleted file mode 100755 index a72023ea..00000000 --- a/src/test/resources/AllgemeinTest/addList.jav +++ /dev/null @@ -1,8 +0,0 @@ -import java.util.List; - -class addList { - addLists(a, b){ -a.add(b.get(0)); -b.add(a.get(0)); -} -} diff --git a/src/test/resources/AllgemeinTest/wildcardPair.jav b/src/test/resources/AllgemeinTest/wildcardPair.jav deleted file mode 100644 index 73f310f4..00000000 --- a/src/test/resources/AllgemeinTest/wildcardPair.jav +++ /dev/null @@ -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; - } - //Boolean compare(Pair x) { return true; } - void m(l) { - Object o = l.get(0); - - //Pair p; - //List b; - //this.compare(p); //1, type incorrect - make(l); - //this.compare(this.make(b)); //2, OK - } -} \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/EmptyMethod.jav b/src/test/resources/bytecode/javFiles/EmptyMethod.jav deleted file mode 100644 index 961989df..00000000 --- a/src/test/resources/bytecode/javFiles/EmptyMethod.jav +++ /dev/null @@ -1,8 +0,0 @@ -public class EmptyMethod{ - - public void m1(){ - System.out.println("test"); - } - - public void m2(){} -} diff --git a/src/test/resources/bytecode/javFiles/Faculty.jav b/src/test/resources/bytecode/javFiles/Faculty.jav deleted file mode 100644 index 14007ece..00000000 --- a/src/test/resources/bytecode/javFiles/Faculty.jav +++ /dev/null @@ -1,52 +0,0 @@ -import java.lang.Integer; -//import java.lang.Long; -//import java.lang.Short; - -public class Faculty { - public fact; - Faculty() { - fact = (x) -> { - if (x == 1) { - return 1; - } - else { - return x * (fact.apply(x-1)); - } - }; - } - - - - public getFact(x) { - return fact.apply(x); - } -} -// m (x) { -// -//// var fact = (x) -> { -//// if (x == 1) { -//// return x; -//// } -//// else { -//// return x * (fact.apply(x-1)); -//// } -//// }; -//// return fact; -//// var x = 13; -//// if(x>22) { -//// return 0; -//// }else if(x <1){ -//// return x; -//// }else { -//// return 1; -//// } -// -// if (x < 0) { -// return 0; -// }else if(x<2) { -// return x; -// } else { -// return x * m(x-1); -// } -// } -//} diff --git a/src/test/resources/bytecode/javFiles/Generics.jav b/src/test/resources/bytecode/javFiles/Generics.jav deleted file mode 100644 index bb7b2af5..00000000 --- a/src/test/resources/bytecode/javFiles/Generics.jav +++ /dev/null @@ -1,17 +0,0 @@ - -class Generics { - Generics(B b){ - } - B mt1(B b){ - return mt1(b); - } -} - - -/* -Problem: -auto test = new List(); -auto test2 = new List(); -... //code, welcher möglicherweise test und test2 vertauscht -test.add("hallo"); -*/ \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/IfTest.jav b/src/test/resources/bytecode/javFiles/IfTest.jav deleted file mode 100644 index bbcda96c..00000000 --- a/src/test/resources/bytecode/javFiles/IfTest.jav +++ /dev/null @@ -1,15 +0,0 @@ -import java.lang.Integer; -import java.lang.Boolean; -import java.lang.String; - -public class IfTest{ - Integer m1(Boolean b) { - Integer i; - String b; - if(b) { - return i; - }else{ - return b; - } - } -} \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Import.jav b/src/test/resources/bytecode/javFiles/Import.jav deleted file mode 100644 index c658568f..00000000 --- a/src/test/resources/bytecode/javFiles/Import.jav +++ /dev/null @@ -1,8 +0,0 @@ -import java.util.Vector; - -class Import { - void methode(){ - Vector v = new Vector<>(); - v.add("X"); - } -} \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Lambda.jav b/src/test/resources/bytecode/javFiles/Lambda.jav deleted file mode 100644 index ba466b18..00000000 --- a/src/test/resources/bytecode/javFiles/Lambda.jav +++ /dev/null @@ -1,11 +0,0 @@ -import java.lang.Integer; - -public class Lambda { - - m () { - var lam1 = (x) -> { - return x; - }; - return lam1; - } -} diff --git a/src/test/resources/bytecode/javFiles/Lambda2.jav b/src/test/resources/bytecode/javFiles/Lambda2.jav deleted file mode 100644 index 92f32b71..00000000 --- a/src/test/resources/bytecode/javFiles/Lambda2.jav +++ /dev/null @@ -1,35 +0,0 @@ -import java.lang.String; - -public class Lambda2 -{ - public static void main(List args){ - var listOfStrings = new List(); - var listOfObjects; - listOfObjects = map(listOfStrings, (a) -> a); -} - -public map(a , b){ - b.apply(a); - return a; -} - -/* -public static List map(List input, Function func) { - List output; - output = new List(); - output.add(func.apply(input.get())); - return output; -} -*/ -} - -class List{ - /* A get(); - void add(A); - */ -} -/* -class Function{ - B apply(A a); -} -*/ \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Lambda3.jav b/src/test/resources/bytecode/javFiles/Lambda3.jav deleted file mode 100644 index 9c4e960c..00000000 --- a/src/test/resources/bytecode/javFiles/Lambda3.jav +++ /dev/null @@ -1,23 +0,0 @@ - -public class Lambda2 -{ - /* - public static List map(List input, - Function func){ - input.add(func.apply(input.get())); - } - */ - public map(input,func){ - input.add(func.apply(input.get())); - return map(new List(), func); - } -} - -class List{ - A get(); - void add(A); -} - -class Function{ - B apply(A a); -} \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Matrix.jav b/src/test/resources/bytecode/javFiles/Matrix.jav deleted file mode 100644 index f8c426b4..00000000 --- a/src/test/resources/bytecode/javFiles/Matrix.jav +++ /dev/null @@ -1,44 +0,0 @@ -import java.util.Vector; -import java.lang.Integer; -import java.lang.Float; -//import java.lang.Byte; -//import java.lang.Boolean; - -public class Matrix extends Vector> { - - Matrix () { - } - - Matrix(vv) { - Integer i; - i = 0; - while(i < vv.size()) { -// Boolean a = this.add(vv.elementAt(i)); - this.add(vv.elementAt(i)); - i=i+1; - } - } - - mul(m) { - var ret = new Matrix(); - var i = 0; - while(i < size()) { - var v1 = this.elementAt(i); - var v2 = new Vector(); - var j = 0; - while(j < v1.size()) { - var erg = 0; - var k = 0; - while(k < v1.size()) { - erg = erg + v1.elementAt(k) - * m.elementAt(k).elementAt(j); - k++; } -// v2.addElement(new Integer(erg)); - v2.addElement(erg); - j++; } - ret.addElement(v2); - i++; - } - return ret; - } -} diff --git a/src/test/resources/bytecode/javFiles/Methods.jav b/src/test/resources/bytecode/javFiles/Methods.jav deleted file mode 100644 index 3c46739d..00000000 --- a/src/test/resources/bytecode/javFiles/Methods.jav +++ /dev/null @@ -1,14 +0,0 @@ -import java.lang.Integer; - -class Methods { - - m(a,b){ - var c=a+b; - return c; - } - - method2(x){ - Integer i = this.m(x,2); - return i; - } -} \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Sorting.jav b/src/test/resources/bytecode/javFiles/Sorting.jav deleted file mode 100644 index 345819d7..00000000 --- a/src/test/resources/bytecode/javFiles/Sorting.jav +++ /dev/null @@ -1,23 +0,0 @@ -import java.util.List; -import java.util.ArrayList; -import java.lang.String; - -public class Sorting{ - merge(a, b){ - a.addAll(b); - return a; - } - -sort(in){ - var firstHalf = in; - var secondHalf = in; - return merge(sort(firstHalf), sort(secondHalf)); -} - - - /* - void sort(a){ - a = merge(a,a); - } - */ -} diff --git a/src/test/resources/bytecode/javFiles/mathStruc.jav b/src/test/resources/bytecode/javFiles/mathStruc.jav deleted file mode 100644 index 171881b1..00000000 --- a/src/test/resources/bytecode/javFiles/mathStruc.jav +++ /dev/null @@ -1,15 +0,0 @@ -import java.util.Vector; -import java.lang.Integer; - -public class mathStruc { - model; - - //Fun1*, Fun1*,MathStruc >> - innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(model,ms.model)); - - public mathStruc(m) { - model =m; - //innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(this.model,ms.model)); - } -} - diff --git a/src/test/resources/bytecode/javFiles/AA.jav b/src/test/resources/javFiles/AA.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/AA.jav rename to src/test/resources/javFiles/AA.jav diff --git a/src/test/resources/bytecode/javFiles/AssignToLit.jav b/src/test/resources/javFiles/AssignToLit.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/AssignToLit.jav rename to src/test/resources/javFiles/AssignToLit.jav diff --git a/src/test/resources/bytecode/javFiles/BB.jav b/src/test/resources/javFiles/BB.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/BB.jav rename to src/test/resources/javFiles/BB.jav diff --git a/src/test/resources/bytecode/javFiles/BinaryInMeth.jav b/src/test/resources/javFiles/BinaryInMeth.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/BinaryInMeth.jav rename to src/test/resources/javFiles/BinaryInMeth.jav diff --git a/src/test/resources/bytecode/javFiles/Box.jav b/src/test/resources/javFiles/Box.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Box.jav rename to src/test/resources/javFiles/Box.jav diff --git a/src/test/resources/bytecode/javFiles/Box.java b/src/test/resources/javFiles/Box.java similarity index 100% rename from src/test/resources/bytecode/javFiles/Box.java rename to src/test/resources/javFiles/Box.java diff --git a/src/test/resources/bytecode/javFiles/CC.jav b/src/test/resources/javFiles/CC.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/CC.jav rename to src/test/resources/javFiles/CC.jav diff --git a/src/test/resources/bytecode/javFiles/ClassGenLam.jav b/src/test/resources/javFiles/ClassGenLam.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/ClassGenLam.jav rename to src/test/resources/javFiles/ClassGenLam.jav diff --git a/src/test/resources/bytecode/javFiles/Cycle.jav b/src/test/resources/javFiles/Cycle.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Cycle.jav rename to src/test/resources/javFiles/Cycle.jav diff --git a/src/test/resources/bytecode/javFiles/DD.jav b/src/test/resources/javFiles/DD.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/DD.jav rename to src/test/resources/javFiles/DD.jav diff --git a/src/test/resources/bytecode/javFiles/DuMethod.jav b/src/test/resources/javFiles/DuMethod.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/DuMethod.jav rename to src/test/resources/javFiles/DuMethod.jav diff --git a/src/test/resources/javFiles/EmptyMethod.jav b/src/test/resources/javFiles/EmptyMethod.jav index dd28fc69..961989df 100644 --- a/src/test/resources/javFiles/EmptyMethod.jav +++ b/src/test/resources/javFiles/EmptyMethod.jav @@ -1,37 +1,8 @@ public class EmptyMethod{ - static String s1 =""; - String s2; + public void m1(){ - //String s = ""; System.out.println("test"); - //Integer ab = Math.abs(1); - //Math.abs(1); - //String lV = "local"; - //s1 = "1"; - //s1.concat("2"); - s2 = s1; - //m2(); - Clazz i = new Clazz(); - Integer i = new Integer(1); } public void m2(){} } - -class Clazz{} -/* -public class EmptyMethod2{ - public static test = "5"; - public void m1(Integer i, String j, Boolean b){ - //String s = ""; - EmptyMethod em = new EmptyMethod(); - em.m1(); - em.s1 = ""; - //Integer ab = Math.abs(1); - //Math.abs(1); - //String lV = "local"; - //s1 = "1"; - //s1.concat("2"); - //s2 = s1; - } -}*/ \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Example.jav b/src/test/resources/javFiles/Example.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Example.jav rename to src/test/resources/javFiles/Example.jav diff --git a/src/test/resources/bytecode/javFiles/Exceptions.jav b/src/test/resources/javFiles/Exceptions.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Exceptions.jav rename to src/test/resources/javFiles/Exceptions.jav diff --git a/src/test/resources/bytecode/javFiles/Fac.jav b/src/test/resources/javFiles/Fac.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Fac.jav rename to src/test/resources/javFiles/Fac.jav diff --git a/src/test/resources/javFiles/Faculty.jav b/src/test/resources/javFiles/Faculty.jav index ed201ff9..14007ece 100644 --- a/src/test/resources/javFiles/Faculty.jav +++ b/src/test/resources/javFiles/Faculty.jav @@ -1,16 +1,52 @@ import java.lang.Integer; +//import java.lang.Long; +//import java.lang.Short; -class Faculty { - //fact; - - Integer mul(Integer x, Integer y) { - return x; - } - - m () { - var fact = (Integer x) -> { - return mul(x, fact.apply(x)); - }; - return fact; - } -} \ No newline at end of file +public class Faculty { + public fact; + Faculty() { + fact = (x) -> { + if (x == 1) { + return 1; + } + else { + return x * (fact.apply(x-1)); + } + }; + } + + + + public getFact(x) { + return fact.apply(x); + } +} +// m (x) { +// +//// var fact = (x) -> { +//// if (x == 1) { +//// return x; +//// } +//// else { +//// return x * (fact.apply(x-1)); +//// } +//// }; +//// return fact; +//// var x = 13; +//// if(x>22) { +//// return 0; +//// }else if(x <1){ +//// return x; +//// }else { +//// return 1; +//// } +// +// if (x < 0) { +// return 0; +// }else if(x<2) { +// return x; +// } else { +// return x * m(x-1); +// } +// } +//} diff --git a/src/test/resources/bytecode/javFiles/Faculty2.jav b/src/test/resources/javFiles/Faculty2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Faculty2.jav rename to src/test/resources/javFiles/Faculty2.jav diff --git a/src/test/resources/bytecode/javFiles/Field.jav b/src/test/resources/javFiles/Field.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Field.jav rename to src/test/resources/javFiles/Field.jav diff --git a/src/test/resources/bytecode/javFiles/FieldTph.jav b/src/test/resources/javFiles/FieldTph.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/FieldTph.jav rename to src/test/resources/javFiles/FieldTph.jav diff --git a/src/test/resources/bytecode/javFiles/FieldTph2.jav b/src/test/resources/javFiles/FieldTph2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/FieldTph2.jav rename to src/test/resources/javFiles/FieldTph2.jav diff --git a/src/test/resources/bytecode/javFiles/FieldTphConsMeth.jav b/src/test/resources/javFiles/FieldTphConsMeth.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/FieldTphConsMeth.jav rename to src/test/resources/javFiles/FieldTphConsMeth.jav diff --git a/src/test/resources/bytecode/javFiles/FieldTphMMeth.jav b/src/test/resources/javFiles/FieldTphMMeth.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/FieldTphMMeth.jav rename to src/test/resources/javFiles/FieldTphMMeth.jav diff --git a/src/test/resources/bytecode/javFiles/For.jav b/src/test/resources/javFiles/For.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/For.jav rename to src/test/resources/javFiles/For.jav diff --git a/src/test/resources/bytecode/javFiles/FunOL.jav b/src/test/resources/javFiles/FunOL.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/FunOL.jav rename to src/test/resources/javFiles/FunOL.jav diff --git a/src/test/resources/bytecode/javFiles/Gen.jav b/src/test/resources/javFiles/Gen.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Gen.jav rename to src/test/resources/javFiles/Gen.jav diff --git a/src/test/resources/javFiles/Generics.jav b/src/test/resources/javFiles/Generics.jav index dd7b4eba..bb7b2af5 100644 --- a/src/test/resources/javFiles/Generics.jav +++ b/src/test/resources/javFiles/Generics.jav @@ -1,17 +1,12 @@ -import java.lang.String; class Generics { - // A mt1(A a, B b){ - B mt1(B a, B b){ - return mt1(a, a); + Generics(B b){ + } + B mt1(B b){ + return mt1(b); } } -class Test { - methode(String s){ - return new Generics().mt1(s,s); - } -} /* Problem: diff --git a/src/test/resources/bytecode/javFiles/Generics2.jav b/src/test/resources/javFiles/Generics2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Generics2.jav rename to src/test/resources/javFiles/Generics2.jav diff --git a/src/test/resources/bytecode/javFiles/Generics3.jav b/src/test/resources/javFiles/Generics3.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Generics3.jav rename to src/test/resources/javFiles/Generics3.jav diff --git a/src/test/resources/bytecode/javFiles/Generics4.jav b/src/test/resources/javFiles/Generics4.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Generics4.jav rename to src/test/resources/javFiles/Generics4.jav diff --git a/src/test/resources/bytecode/javFiles/GreaterEqual.jav b/src/test/resources/javFiles/GreaterEqual.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/GreaterEqual.jav rename to src/test/resources/javFiles/GreaterEqual.jav diff --git a/src/test/resources/bytecode/javFiles/GreaterThan.jav b/src/test/resources/javFiles/GreaterThan.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/GreaterThan.jav rename to src/test/resources/javFiles/GreaterThan.jav diff --git a/src/test/resources/bytecode/javFiles/Id.jav b/src/test/resources/javFiles/Id.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Id.jav rename to src/test/resources/javFiles/Id.jav diff --git a/src/test/resources/javFiles/IfTest.jav b/src/test/resources/javFiles/IfTest.jav index 88885561..bbcda96c 100644 --- a/src/test/resources/javFiles/IfTest.jav +++ b/src/test/resources/javFiles/IfTest.jav @@ -1,10 +1,11 @@ import java.lang.Integer; import java.lang.Boolean; -import java.lang.Object; +import java.lang.String; -public class IfTest { - Object m1(b) { +public class IfTest{ + Integer m1(Boolean b) { Integer i; + String b; if(b) { return i; }else{ diff --git a/src/test/resources/javFiles/Import.jav b/src/test/resources/javFiles/Import.jav index 2fc3a8b3..c658568f 100644 --- a/src/test/resources/javFiles/Import.jav +++ b/src/test/resources/javFiles/Import.jav @@ -2,7 +2,7 @@ import java.util.Vector; class Import { void methode(){ - var v; - v.add(v); + Vector v = new Vector<>(); + v.add("X"); } } \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/Inf.jav b/src/test/resources/javFiles/Inf.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Inf.jav rename to src/test/resources/javFiles/Inf.jav diff --git a/src/test/resources/bytecode/javFiles/Infimum.jav b/src/test/resources/javFiles/Infimum.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Infimum.jav rename to src/test/resources/javFiles/Infimum.jav diff --git a/src/test/resources/bytecode/javFiles/Inherit.jav b/src/test/resources/javFiles/Inherit.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Inherit.jav rename to src/test/resources/javFiles/Inherit.jav diff --git a/src/test/resources/bytecode/javFiles/Inherit2.jav b/src/test/resources/javFiles/Inherit2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Inherit2.jav rename to src/test/resources/javFiles/Inherit2.jav diff --git a/src/test/resources/bytecode/javFiles/Interface1.jav b/src/test/resources/javFiles/Interface1.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Interface1.jav rename to src/test/resources/javFiles/Interface1.jav diff --git a/src/test/resources/bytecode/javFiles/KompTph.jav b/src/test/resources/javFiles/KompTph.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/KompTph.jav rename to src/test/resources/javFiles/KompTph.jav diff --git a/src/test/resources/bytecode/javFiles/LamRunnable.jav b/src/test/resources/javFiles/LamRunnable.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/LamRunnable.jav rename to src/test/resources/javFiles/LamRunnable.jav diff --git a/src/test/resources/javFiles/Lambda.jav b/src/test/resources/javFiles/Lambda.jav index 5bd67a0b..ba466b18 100644 --- a/src/test/resources/javFiles/Lambda.jav +++ b/src/test/resources/javFiles/Lambda.jav @@ -1,5 +1,4 @@ - -class Apply { } +import java.lang.Integer; public class Lambda { @@ -7,7 +6,6 @@ public class Lambda { var lam1 = (x) -> { return x; }; - return lam1.apply(new Apply()); + return lam1; } } - diff --git a/src/test/resources/javFiles/Lambda2.jav b/src/test/resources/javFiles/Lambda2.jav index cf1e910b..92f32b71 100644 --- a/src/test/resources/javFiles/Lambda2.jav +++ b/src/test/resources/javFiles/Lambda2.jav @@ -24,10 +24,12 @@ public static List map(List input, Function func) { } class List{ - A get(); + /* A get(); void add(A); + */ } - +/* class Function{ B apply(A a); -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/src/test/resources/javFiles/Lambda3.jav b/src/test/resources/javFiles/Lambda3.jav index 9e22f302..9c4e960c 100644 --- a/src/test/resources/javFiles/Lambda3.jav +++ b/src/test/resources/javFiles/Lambda3.jav @@ -1,4 +1,3 @@ -import java.lang.String; public class Lambda2 { diff --git a/src/test/resources/bytecode/javFiles/Lambda4.jav b/src/test/resources/javFiles/Lambda4.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Lambda4.jav rename to src/test/resources/javFiles/Lambda4.jav diff --git a/src/test/resources/bytecode/javFiles/LambdaCapture.jav b/src/test/resources/javFiles/LambdaCapture.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/LambdaCapture.jav rename to src/test/resources/javFiles/LambdaCapture.jav diff --git a/src/test/resources/bytecode/javFiles/LambdaVoid.jav b/src/test/resources/javFiles/LambdaVoid.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/LambdaVoid.jav rename to src/test/resources/javFiles/LambdaVoid.jav diff --git a/src/test/resources/bytecode/javFiles/LessEqual.jav b/src/test/resources/javFiles/LessEqual.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/LessEqual.jav rename to src/test/resources/javFiles/LessEqual.jav diff --git a/src/test/resources/bytecode/javFiles/LessThan.jav b/src/test/resources/javFiles/LessThan.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/LessThan.jav rename to src/test/resources/javFiles/LessThan.jav diff --git a/src/test/resources/javFiles/Matrix.jav b/src/test/resources/javFiles/Matrix.jav index 5e1eac08..f8c426b4 100644 --- a/src/test/resources/javFiles/Matrix.jav +++ b/src/test/resources/javFiles/Matrix.jav @@ -1,9 +1,24 @@ import java.util.Vector; import java.lang.Integer; +import java.lang.Float; +//import java.lang.Byte; +//import java.lang.Boolean; + +public class Matrix extends Vector> { + + Matrix () { + } + + Matrix(vv) { + Integer i; + i = 0; + while(i < vv.size()) { +// Boolean a = this.add(vv.elementAt(i)); + this.add(vv.elementAt(i)); + i=i+1; + } + } -class Matrix extends Vector> { - Integer mul1(Integer x, Integer y) { return x;} - Integer add1(Integer x, Integer y) { return x;} mul(m) { var ret = new Matrix(); var i = 0; @@ -15,14 +30,15 @@ class Matrix extends Vector> { var erg = 0; var k = 0; while(k < v1.size()) { - erg = erg + v1.elementAt(k) * m.elementAt(k).elementAt(j); - //erg = add1(erg, mul1(v1.elementAt(k), - // m.elementAt(k).elementAt(j))); + erg = erg + v1.elementAt(k) + * m.elementAt(k).elementAt(j); k++; } - v2.addElement(new Integer(erg)); +// v2.addElement(new Integer(erg)); + v2.addElement(erg); j++; } ret.addElement(v2); - i++; } + i++; + } return ret; } } diff --git a/src/test/resources/bytecode/javFiles/MatrixOP.jav b/src/test/resources/javFiles/MatrixOP.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/MatrixOP.jav rename to src/test/resources/javFiles/MatrixOP.jav diff --git a/src/test/resources/bytecode/javFiles/Merge.jav b/src/test/resources/javFiles/Merge.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Merge.jav rename to src/test/resources/javFiles/Merge.jav diff --git a/src/test/resources/javFiles/Methods.jav b/src/test/resources/javFiles/Methods.jav index e45d9830..3c46739d 100644 --- a/src/test/resources/javFiles/Methods.jav +++ b/src/test/resources/javFiles/Methods.jav @@ -1,17 +1,14 @@ +import java.lang.Integer; class Methods { - mt4(a,b,c) { return a.add(b).sub(c) ; } - - mt1(a) {return a;} - - mt2(a) {return a.f; } - - mt3(a) {return a.add(); } -} - -class Test { - java.lang.Object f; - add(){} - add(b){return b;} - sub(b){} + + m(a,b){ + var c=a+b; + return c; + } + + method2(x){ + Integer i = this.m(x,2); + return i; + } } \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/OL.jav b/src/test/resources/javFiles/OL.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/OL.jav rename to src/test/resources/javFiles/OL.jav diff --git a/src/test/resources/bytecode/javFiles/OLFun.jav b/src/test/resources/javFiles/OLFun.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/OLFun.jav rename to src/test/resources/javFiles/OLFun.jav diff --git a/src/test/resources/bytecode/javFiles/OLFun2.jav b/src/test/resources/javFiles/OLFun2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/OLFun2.jav rename to src/test/resources/javFiles/OLFun2.jav diff --git a/src/test/resources/bytecode/javFiles/Op.jav b/src/test/resources/javFiles/Op.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Op.jav rename to src/test/resources/javFiles/Op.jav diff --git a/src/test/resources/bytecode/javFiles/Op2.jav b/src/test/resources/javFiles/Op2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Op2.jav rename to src/test/resources/javFiles/Op2.jav diff --git a/src/test/resources/bytecode/javFiles/OverlaodGen.jav b/src/test/resources/javFiles/OverlaodGen.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/OverlaodGen.jav rename to src/test/resources/javFiles/OverlaodGen.jav diff --git a/src/test/resources/bytecode/javFiles/Overloading.jav b/src/test/resources/javFiles/Overloading.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Overloading.jav rename to src/test/resources/javFiles/Overloading.jav diff --git a/src/test/resources/bytecode/javFiles/Plus.jav b/src/test/resources/javFiles/Plus.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Plus.jav rename to src/test/resources/javFiles/Plus.jav diff --git a/src/test/resources/bytecode/javFiles/PostIncDec.jav b/src/test/resources/javFiles/PostIncDec.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/PostIncDec.jav rename to src/test/resources/javFiles/PostIncDec.jav diff --git a/src/test/resources/bytecode/javFiles/PreInc.jav b/src/test/resources/javFiles/PreInc.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/PreInc.jav rename to src/test/resources/javFiles/PreInc.jav diff --git a/src/test/resources/bytecode/javFiles/Put.jav b/src/test/resources/javFiles/Put.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Put.jav rename to src/test/resources/javFiles/Put.jav diff --git a/src/test/resources/bytecode/javFiles/RecursiveMeth.jav b/src/test/resources/javFiles/RecursiveMeth.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/RecursiveMeth.jav rename to src/test/resources/javFiles/RecursiveMeth.jav diff --git a/src/test/resources/bytecode/javFiles/RelOps.jav b/src/test/resources/javFiles/RelOps.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/RelOps.jav rename to src/test/resources/javFiles/RelOps.jav diff --git a/src/test/resources/bytecode/javFiles/ReturnMethod.jav b/src/test/resources/javFiles/ReturnMethod.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/ReturnMethod.jav rename to src/test/resources/javFiles/ReturnMethod.jav diff --git a/src/test/resources/bytecode/javFiles/SimpleCycle.jav b/src/test/resources/javFiles/SimpleCycle.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/SimpleCycle.jav rename to src/test/resources/javFiles/SimpleCycle.jav diff --git a/src/test/resources/javFiles/Sorting.jav b/src/test/resources/javFiles/Sorting.jav index e5897914..345819d7 100644 --- a/src/test/resources/javFiles/Sorting.jav +++ b/src/test/resources/javFiles/Sorting.jav @@ -1,15 +1,23 @@ import java.util.List; -import java.util.Collection; +import java.util.ArrayList; +import java.lang.String; -class Sorting{ - void merge(a, b){ +public class Sorting{ + merge(a, b){ a.addAll(b); return a; } - - sort(in){ - var firstHalf = in; - var secondHalf = in; - return merge(sort(firstHalf), sort(secondHalf)); - } -} \ No newline at end of file + +sort(in){ + var firstHalf = in; + var secondHalf = in; + return merge(sort(firstHalf), sort(secondHalf)); +} + + + /* + void sort(a){ + a = merge(a,a); + } + */ +} diff --git a/src/test/resources/bytecode/javFiles/StaticM.jav b/src/test/resources/javFiles/StaticM.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/StaticM.jav rename to src/test/resources/javFiles/StaticM.jav diff --git a/src/test/resources/bytecode/javFiles/SubMatrix.jav b/src/test/resources/javFiles/SubMatrix.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/SubMatrix.jav rename to src/test/resources/javFiles/SubMatrix.jav diff --git a/src/test/resources/bytecode/javFiles/Tph.jav b/src/test/resources/javFiles/Tph.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph.jav rename to src/test/resources/javFiles/Tph.jav diff --git a/src/test/resources/bytecode/javFiles/Tph2.jav b/src/test/resources/javFiles/Tph2.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph2.jav rename to src/test/resources/javFiles/Tph2.jav diff --git a/src/test/resources/bytecode/javFiles/Tph3.jav b/src/test/resources/javFiles/Tph3.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph3.jav rename to src/test/resources/javFiles/Tph3.jav diff --git a/src/test/resources/bytecode/javFiles/Tph4.jav b/src/test/resources/javFiles/Tph4.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph4.jav rename to src/test/resources/javFiles/Tph4.jav diff --git a/src/test/resources/bytecode/javFiles/Tph5.jav b/src/test/resources/javFiles/Tph5.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph5.jav rename to src/test/resources/javFiles/Tph5.jav diff --git a/src/test/resources/bytecode/javFiles/Tph6.jav b/src/test/resources/javFiles/Tph6.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph6.jav rename to src/test/resources/javFiles/Tph6.jav diff --git a/src/test/resources/bytecode/javFiles/Tph7.jav b/src/test/resources/javFiles/Tph7.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Tph7.jav rename to src/test/resources/javFiles/Tph7.jav diff --git a/src/test/resources/bytecode/javFiles/TypedID.jav b/src/test/resources/javFiles/TypedID.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/TypedID.jav rename to src/test/resources/javFiles/TypedID.jav diff --git a/src/test/resources/bytecode/javFiles/VectorAdd.jav b/src/test/resources/javFiles/VectorAdd.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/VectorAdd.jav rename to src/test/resources/javFiles/VectorAdd.jav diff --git a/src/test/resources/bytecode/javFiles/VectorSuper.jav b/src/test/resources/javFiles/VectorSuper.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/VectorSuper.jav rename to src/test/resources/javFiles/VectorSuper.jav diff --git a/src/test/resources/bytecode/javFiles/VoidMeth.jav b/src/test/resources/javFiles/VoidMeth.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/VoidMeth.jav rename to src/test/resources/javFiles/VoidMeth.jav diff --git a/src/test/resources/bytecode/javFiles/WC.jav b/src/test/resources/javFiles/WC.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/WC.jav rename to src/test/resources/javFiles/WC.jav diff --git a/src/test/resources/bytecode/javFiles/While.jav b/src/test/resources/javFiles/While.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/While.jav rename to src/test/resources/javFiles/While.jav diff --git a/src/test/resources/bytecode/javFiles/Y.jav b/src/test/resources/javFiles/Y.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/Y.jav rename to src/test/resources/javFiles/Y.jav diff --git a/src/test/resources/bytecode/javFiles/applyLambda.jav b/src/test/resources/javFiles/applyLambda.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/applyLambda.jav rename to src/test/resources/javFiles/applyLambda.jav diff --git a/src/test/resources/insertGenericsJav/TestAny.jav b/src/test/resources/javFiles/insertGenericsJav/TestAny.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestAny.jav rename to src/test/resources/javFiles/insertGenericsJav/TestAny.jav diff --git a/src/test/resources/insertGenericsJav/TestClassField.jav b/src/test/resources/javFiles/insertGenericsJav/TestClassField.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestClassField.jav rename to src/test/resources/javFiles/insertGenericsJav/TestClassField.jav diff --git a/src/test/resources/insertGenericsJav/TestContraVariant.jav b/src/test/resources/javFiles/insertGenericsJav/TestContraVariant.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestContraVariant.jav rename to src/test/resources/javFiles/insertGenericsJav/TestContraVariant.jav diff --git a/src/test/resources/insertGenericsJav/TestGGFinder.jav b/src/test/resources/javFiles/insertGenericsJav/TestGGFinder.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestGGFinder.jav rename to src/test/resources/javFiles/insertGenericsJav/TestGGFinder.jav diff --git a/src/test/resources/insertGenericsJav/TestLocalVarLambda.jav b/src/test/resources/javFiles/insertGenericsJav/TestLocalVarLambda.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestLocalVarLambda.jav rename to src/test/resources/javFiles/insertGenericsJav/TestLocalVarLambda.jav diff --git a/src/test/resources/insertGenericsJav/TestMutualRecursion.jav b/src/test/resources/javFiles/insertGenericsJav/TestMutualRecursion.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestMutualRecursion.jav rename to src/test/resources/javFiles/insertGenericsJav/TestMutualRecursion.jav diff --git a/src/test/resources/insertGenericsJav/TestMutualRecursionWithField.jav b/src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestMutualRecursionWithField.jav rename to src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField.jav diff --git a/src/test/resources/insertGenericsJav/TestMutualRecursionWithField2.jav b/src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField2.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestMutualRecursionWithField2.jav rename to src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField2.jav diff --git a/src/test/resources/insertGenericsJav/TestMutualRecursionWithField3.jav b/src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField3.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestMutualRecursionWithField3.jav rename to src/test/resources/javFiles/insertGenericsJav/TestMutualRecursionWithField3.jav diff --git a/src/test/resources/insertGenericsJav/TestReturnVar.jav b/src/test/resources/javFiles/insertGenericsJav/TestReturnVar.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestReturnVar.jav rename to src/test/resources/javFiles/insertGenericsJav/TestReturnVar.jav diff --git a/src/test/resources/insertGenericsJav/TestSecondLineOfClassConstraints.jav b/src/test/resources/javFiles/insertGenericsJav/TestSecondLineOfClassConstraints.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestSecondLineOfClassConstraints.jav rename to src/test/resources/javFiles/insertGenericsJav/TestSecondLineOfClassConstraints.jav diff --git a/src/test/resources/insertGenericsJav/TestTPHsAndGenerics.jav b/src/test/resources/javFiles/insertGenericsJav/TestTPHsAndGenerics.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestTPHsAndGenerics.jav rename to src/test/resources/javFiles/insertGenericsJav/TestTPHsAndGenerics.jav diff --git a/src/test/resources/insertGenericsJav/TestTPHsAndGenerics2.jav b/src/test/resources/javFiles/insertGenericsJav/TestTPHsAndGenerics2.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestTPHsAndGenerics2.jav rename to src/test/resources/javFiles/insertGenericsJav/TestTPHsAndGenerics2.jav diff --git a/src/test/resources/insertGenericsJav/TestThreeArgs.jav b/src/test/resources/javFiles/insertGenericsJav/TestThreeArgs.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestThreeArgs.jav rename to src/test/resources/javFiles/insertGenericsJav/TestThreeArgs.jav diff --git a/src/test/resources/insertGenericsJav/TestTwoArgs.jav b/src/test/resources/javFiles/insertGenericsJav/TestTwoArgs.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestTwoArgs.jav rename to src/test/resources/javFiles/insertGenericsJav/TestTwoArgs.jav diff --git a/src/test/resources/insertGenericsJav/TestTwoArgs2.jav b/src/test/resources/javFiles/insertGenericsJav/TestTwoArgs2.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestTwoArgs2.jav rename to src/test/resources/javFiles/insertGenericsJav/TestTwoArgs2.jav diff --git a/src/test/resources/insertGenericsJav/TestTwoCalls.jav b/src/test/resources/javFiles/insertGenericsJav/TestTwoCalls.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestTwoCalls.jav rename to src/test/resources/javFiles/insertGenericsJav/TestTwoCalls.jav diff --git a/src/test/resources/insertGenericsJav/TestVector.jav b/src/test/resources/javFiles/insertGenericsJav/TestVector.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestVector.jav rename to src/test/resources/javFiles/insertGenericsJav/TestVector.jav diff --git a/src/test/resources/insertGenericsJav/TestVectorArg.jav b/src/test/resources/javFiles/insertGenericsJav/TestVectorArg.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestVectorArg.jav rename to src/test/resources/javFiles/insertGenericsJav/TestVectorArg.jav diff --git a/src/test/resources/insertGenericsJav/TestVoidMeth.jav b/src/test/resources/javFiles/insertGenericsJav/TestVoidMeth.jav similarity index 100% rename from src/test/resources/insertGenericsJav/TestVoidMeth.jav rename to src/test/resources/javFiles/insertGenericsJav/TestVoidMeth.jav diff --git a/src/test/resources/javFiles/mathStruc.jav b/src/test/resources/javFiles/mathStruc.jav index c8518e5d..171881b1 100644 --- a/src/test/resources/javFiles/mathStruc.jav +++ b/src/test/resources/javFiles/mathStruc.jav @@ -1,8 +1,15 @@ -class MathStruc { +import java.util.Vector; +import java.lang.Integer; - A model; +public class mathStruc { + model; - innerOp = o -> ms -> new MathStruc(o.apply(this.model, ms.model)); + //Fun1*, Fun1*,MathStruc >> + innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(model,ms.model)); + + public mathStruc(m) { + model =m; + //innerOp = (o) -> (ms) -> new mathStruc<>(o.apply(this.model,ms.model)); + } +} - MathStruc(A m) { model=m; } - } \ No newline at end of file diff --git a/src/test/resources/bytecode/javFiles/mathStrucInteger.jav b/src/test/resources/javFiles/mathStrucInteger.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/mathStrucInteger.jav rename to src/test/resources/javFiles/mathStrucInteger.jav diff --git a/src/test/resources/bytecode/javFiles/mathStrucMatrixOP.jav b/src/test/resources/javFiles/mathStrucMatrixOP.jav similarity index 100% rename from src/test/resources/bytecode/javFiles/mathStrucMatrixOP.jav rename to src/test/resources/javFiles/mathStrucMatrixOP.jav