diff --git a/src/mycompiler/mybytecode/Attribute.java b/src/mycompiler/mybytecode/Attribute.java index f89b5c8ca..19a21e56d 100755 --- a/src/mycompiler/mybytecode/Attribute.java +++ b/src/mycompiler/mybytecode/Attribute.java @@ -5,12 +5,15 @@ package mycompiler.mybytecode; // ino.module.Attribute.8529.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; + import mycompiler.myexception.JVMCodeException; + import org.apache.log4j.Logger; // ino.end // ino.class.Attribute.21446.declaration -public abstract class Attribute +public abstract class Attribute implements ClassFileMember // ino.end // ino.class.Attribute.21446.body { @@ -44,7 +47,8 @@ public abstract class Attribute // ino.end // ino.method.codegen.21461.declaration - public abstract void codegen(ClassFile classfile, FileOutputStream f) + @Override + public abstract void codegen(ClassFile classfile, OutputStream f) throws JVMCodeException, IOException; // ino.end diff --git a/src/mycompiler/mybytecode/AttributeInfo.java b/src/mycompiler/mybytecode/AttributeInfo.java index 405e75815..0c6eb249a 100755 --- a/src/mycompiler/mybytecode/AttributeInfo.java +++ b/src/mycompiler/mybytecode/AttributeInfo.java @@ -4,8 +4,10 @@ package mycompiler.mybytecode; // ino.module.AttributeInfo.8530.import import java.io.FileOutputStream; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.Vector; + import mycompiler.myexception.JVMCodeException; // ino.end @@ -70,7 +72,8 @@ public class AttributeInfo extends Attribute // ino.end // ino.method.codegen.21489.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws JVMCodeException, java.io.IOException // ino.end // ino.method.codegen.21489.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Class_info.java b/src/mycompiler/mybytecode/CONSTANT_Class_info.java index b54c6d7f7..76f61b2cd 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Class_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Class_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Class_info.8533.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end // ino.class.CONSTANT_Class_info.21763.declaration @@ -35,7 +36,8 @@ public class CONSTANT_Class_info extends CPInfo // ino.end // ino.method.codegen.21776.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21776.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Double_info.java b/src/mycompiler/mybytecode/CONSTANT_Double_info.java index a720799e4..18c3523c0 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Double_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Double_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Double_info.21782.declaration public class CONSTANT_Double_info extends CPInfo @@ -46,7 +47,8 @@ public class CONSTANT_Double_info extends CPInfo // ino.end // ino.method.codegen.21804.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21804.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java b/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java index fca75546d..05dbd5f9c 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Fieldref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Fieldref_info.21810.declaration public class CONSTANT_Fieldref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_Fieldref_info extends CPInfo // ino.end // ino.method.codegen.21832.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21832.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Float_info.java b/src/mycompiler/mybytecode/CONSTANT_Float_info.java index 95317a506..8c1d8f393 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Float_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Float_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Float_info.21838.declaration public class CONSTANT_Float_info extends CPInfo @@ -29,7 +30,8 @@ public class CONSTANT_Float_info extends CPInfo // ino.end // ino.method.codegen.21851.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21851.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Integer_info.java b/src/mycompiler/mybytecode/CONSTANT_Integer_info.java index 7150cc6eb..c317bfb4f 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Integer_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Integer_info.java @@ -4,6 +4,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Integer_info.8537.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end @@ -32,7 +33,8 @@ public class CONSTANT_Integer_info extends CPInfo // ino.end // ino.method.codegen.21870.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21870.body diff --git a/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java b/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java index c00288e6b..6701db8a8 100755 --- a/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_InterfaceMethodref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_InterfaceMethodref_info.21876.declaration public class CONSTANT_InterfaceMethodref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_InterfaceMethodref_info extends CPInfo // ino.end // ino.method.codegen.21898.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21898.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Long_info.java b/src/mycompiler/mybytecode/CONSTANT_Long_info.java index 76b2719c4..6aacc7472 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Long_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Long_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Long_info.8539.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; // ino.end // ino.class.CONSTANT_Long_info.21904.declaration @@ -57,7 +58,8 @@ public class CONSTANT_Long_info extends CPInfo // ino.end // ino.method.codegen.21926.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21926.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java b/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java index 692ef0d94..2f9790530 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Methodref_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_Methodref_info.21932.declaration public class CONSTANT_Methodref_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_Methodref_info extends CPInfo // ino.end // ino.method.codegen.21954.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21954.body diff --git a/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java b/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java index 2bd63b58d..d13049be7 100755 --- a/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_NameAndType_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_NameAndType_info.21960.declaration public class CONSTANT_NameAndType_info extends CPInfo @@ -57,7 +58,8 @@ public class CONSTANT_NameAndType_info extends CPInfo // ino.end // ino.method.codegen.21982.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.21982.body diff --git a/src/mycompiler/mybytecode/CONSTANT_String_info.java b/src/mycompiler/mybytecode/CONSTANT_String_info.java index 1c36bfac2..b8ffb5980 100755 --- a/src/mycompiler/mybytecode/CONSTANT_String_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_String_info.java @@ -6,6 +6,7 @@ package mycompiler.mybytecode; import java.io.FileOutputStream; import java.io.IOException; // ino.end +import java.io.OutputStream; // ino.class.CONSTANT_String_info.21988.declaration public class CONSTANT_String_info extends CPInfo @@ -35,7 +36,8 @@ public class CONSTANT_String_info extends CPInfo // ino.end // ino.method.codegen.22001.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.22001.body diff --git a/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java b/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java index 8425249c9..58a44c2d9 100755 --- a/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java +++ b/src/mycompiler/mybytecode/CONSTANT_Utf8_info.java @@ -5,6 +5,7 @@ package mycompiler.mybytecode; // ino.module.CONSTANT_Utf8_info.8543.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Array; // ino.end @@ -36,7 +37,8 @@ public class CONSTANT_Utf8_info extends CPInfo // ino.end // ino.method.codegen.22020.definition - public void codegen(ClassFile classfile, FileOutputStream f) + @Override + public void codegen(ClassFile classfile, OutputStream f) throws IOException // ino.end // ino.method.codegen.22020.body diff --git a/src/mycompiler/mybytecode/CPInfo.java b/src/mycompiler/mybytecode/CPInfo.java index de91ff93c..9ee33ba6c 100755 --- a/src/mycompiler/mybytecode/CPInfo.java +++ b/src/mycompiler/mybytecode/CPInfo.java @@ -5,11 +5,13 @@ package mycompiler.mybytecode; // ino.module.CPInfo.8544.import import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; + import org.apache.log4j.Logger; // ino.end // ino.class.CPInfo.22026.declaration -public abstract class CPInfo +public abstract class CPInfo implements ClassFileMember // ino.end // ino.class.CPInfo.22026.body { @@ -43,7 +45,8 @@ public abstract class CPInfo // ino.end // ino.method.codegen.22041.declaration - public abstract void codegen(ClassFile classfile, FileOutputStream f) + @Override + public abstract void codegen(ClassFile classfile, OutputStream f) throws IOException; // ino.end diff --git a/src/mycompiler/mybytecode/ClassFile.java b/src/mycompiler/mybytecode/ClassFile.java index 90136ede9..661eae1b1 100755 --- a/src/mycompiler/mybytecode/ClassFile.java +++ b/src/mycompiler/mybytecode/ClassFile.java @@ -2,11 +2,14 @@ package mycompiler.mybytecode; // ino.end // ino.module.ClassFile.8531.import +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.Vector; + import mycompiler.myclass.ParameterList; import mycompiler.myclass.UsedId; import mycompiler.MyCompiler; @@ -16,6 +19,7 @@ import mycompiler.mystatement.Assign; import mycompiler.mystatement.Block; import mycompiler.mytype.Type; import mycompiler.SourceFile; + import org.apache.log4j.Logger; // ino.end @@ -34,6 +38,7 @@ public class ClassFile // ino.end // ino.class.ClassFile.21492.body { + //Beschreibung des Classfiles: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4 public boolean hamaAload0 = false; //hama: f�gt in Konstruktor und set Methode ein aload_0 ein wird f�r StoreSomethingParmCon ben�tigt // ino.attribute.codegenlog.21495.decldescription type=line @@ -794,7 +799,7 @@ public class ClassFile // ino.end // ino.method.writeInt.21669.definition - public void writeInt(FileOutputStream f, int i) + public void writeInt(OutputStream f, int i) throws IOException // ino.end // ino.method.writeInt.21669.body @@ -807,7 +812,7 @@ public class ClassFile // ino.end // ino.method.writeShort.21672.definition - public void writeShort(FileOutputStream f, short i) + public void writeShort(OutputStream f, short i) throws IOException // ino.end // ino.method.writeShort.21672.body @@ -818,7 +823,7 @@ public class ClassFile // ino.end // ino.method.writeByte.21675.definition - public void writeByte(FileOutputStream f, byte i) + public void writeByte(OutputStream f, byte i) throws IOException // ino.end // ino.method.writeByte.21675.body @@ -828,7 +833,7 @@ public class ClassFile // ino.end // ino.method.writeByteArray.21678.definition - public void writeByteArray(FileOutputStream f, byte[] b) + public void writeByteArray(OutputStream f, byte[] b) throws IOException // ino.end // ino.method.writeByteArray.21678.body @@ -836,6 +841,78 @@ public class ClassFile for(int i = 0; i < Array.getLength(b); i++) f.write(b[i]); } // ino.end + + public byte[] getBytecode() { + ByteArrayOutputStream f = new ByteArrayOutputStream(); + try { + // Schreiben der Header-Infos + writeInt(f, magic); + + writeShort(f, minor_version); + writeShort(f, major_version); + codegenlog.debug("Header: magic=" + Integer.toHexString(magic)); + codegenlog.debug("Header: minor_version=" + minor_version); + codegenlog.debug("Header: major_version=" + major_version); + codegenlog.info("Verarbeite Konstanten-Pool: " + (constant_pool.size()+1)); + + // Constant-Pool verarbeiten + writeShort(f, (short)(constant_pool.size() + 1)); + for(int i = 0; i < constant_pool.size(); i++) + { + codegenlog.debug((i+1) +". " + + constant_pool.elementAt(i).toString()); + constant_pool.elementAt(i).codegen(this, f); + } + + // Informationen ueber die Klasse selbst verarbeiten + writeShort(f, access_flags); + writeShort(f, this_class); + writeShort(f, super_class); + codegenlog.debug("Klasseninfos: access_flags=" + access_flags); + codegenlog.debug("Klasseninfos: this_class=" + this_class); + codegenlog.debug("Klasseninfos: super_class=" + super_class); + + // Interfaces verarbeiten + codegenlog.info("Verarbeite Interfaces: " + interfaces.size()); + writeShort(f, (short)interfaces.size()); + for (int i=0; i testCodegen(String sourceCode){ + MyCompilerAPI compiler = MyCompiler.getAPI(); + compiler.parse("class EmptyClass{}"); + Vector ret = null; + try { + ret = compiler.codeGeneration(null); + } catch (NullPointerException | JVMCodeException e) { + e.printStackTrace(); + TestCase.fail(); + } + TestCase.assertTrue("Es wurden keine ClassFiles generiert",ret != null && ret.size()>0); + return ret; + } + + public static Vector readFileAndTestCodegen(String fileName) throws IOException{ + return testCodegen(getFileContent(rootDirectory + fileName)); + } + + private static String getFileContent(String path)throws IOException + { + byte[] encoded = Files.readAllBytes(Paths.get(path)); + return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)).toString(); + } +} diff --git a/test/bytecode/EmptyClassTest.java b/test/bytecode/EmptyClassTest.java index db89b73a1..471640ef5 100644 --- a/test/bytecode/EmptyClassTest.java +++ b/test/bytecode/EmptyClassTest.java @@ -14,15 +14,7 @@ public class EmptyClassTest extends TestCase { @Test public void test(){ - MyCompilerAPI compiler = MyCompiler.getAPI(); - compiler.parse("class EmptyClass{}"); - try { - compiler.codeGeneration(null); - } catch (NullPointerException | JVMCodeException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - assertTrue("Test erfolgreich",true); + BytecodeTester.testCodegen("class EmptyClass{}"); } } diff --git a/test/bytecode/FieldTest.jav b/test/bytecode/FieldTest.jav new file mode 100644 index 000000000..57f1614ab --- /dev/null +++ b/test/bytecode/FieldTest.jav @@ -0,0 +1,6 @@ +class FieldTest{ + String var; + String methode(String para1){ + return var; + } +} \ No newline at end of file diff --git a/test/bytecode/GeneralTest.java b/test/bytecode/GeneralTest.java new file mode 100644 index 000000000..2f9090503 --- /dev/null +++ b/test/bytecode/GeneralTest.java @@ -0,0 +1,35 @@ +package bytecode; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Vector; + +import junit.framework.TestCase; + +import org.junit.Test; + +import sun.misc.IOUtils; +import mycompiler.mybytecode.ClassFile; + +public class GeneralTest extends TestCase{ + @Test + public void test(){ + Vector cfs = null; + try { + cfs = BytecodeTester.readFileAndTestCodegen("FieldTest.jav"); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + assertTrue("Es darf nur eine ClassFile erstellt werden", cfs.size()==1); + try { + FileOutputStream output = new FileOutputStream(new File(BytecodeTester.rootDirectory+"target-file")); + output.write(cfs.firstElement().getBytecode()); + } catch (IOException e) { + e.printStackTrace(); + fail(); + } + } + +} diff --git a/test/bytecode/MethodTest.java b/test/bytecode/MethodTest.java new file mode 100644 index 000000000..6df9d4199 --- /dev/null +++ b/test/bytecode/MethodTest.java @@ -0,0 +1,12 @@ +package bytecode; + +import org.junit.Test; + +public class MethodTest { + + @Test + public void test(){ + BytecodeTester.testCodegen("class MethodTest{ public void method(){} }"); + } + +} diff --git a/test/mycompiler/test/lambda/TestInterface.jav b/test/mycompiler/test/lambda/TestInterface.jav new file mode 100644 index 000000000..0adbc2a18 --- /dev/null +++ b/test/mycompiler/test/lambda/TestInterface.jav @@ -0,0 +1,3 @@ +interface TestInterface{ + +} \ No newline at end of file diff --git a/test/mycompiler/test/lambda/TestInterface.java b/test/mycompiler/test/lambda/TestInterface.java new file mode 100644 index 000000000..a73aa9520 --- /dev/null +++ b/test/mycompiler/test/lambda/TestInterface.java @@ -0,0 +1,24 @@ +package mycompiler.test.lambda; + +import java.util.HashMap; + +import mycompiler.mytest.LambdaTest; + +import org.junit.Test; + +public class TestInterface { + @Test + public void test() { + //Testet nur ob ein Interface ohne Fehler geparst und inferiert wird. + executeTest(); + } + + private static final String exampleJavFile = "TestInterface.jav"; + + private HashMap variableTypeAssumptions = new HashMap(); + + public void executeTest(){ + LambdaTest tester = new LambdaTest(exampleJavFile); + tester.runTest(); + } +} diff --git a/test/mycompiler/test/lambda/testResults/LambdaTest.log b/test/mycompiler/test/lambda/testResults/LambdaTest.log index 47aabcb4a..03bd567ce 100644 --- a/test/mycompiler/test/lambda/testResults/LambdaTest.log +++ b/test/mycompiler/test/lambda/testResults/LambdaTest.log @@ -1,165 +1,123 @@ -Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse2Method Assumptions: -[MethodAssumption: TPH B null { [(var1 = NEW Klasse1), null Return null (var1.getVar1( [ ]))], MethodAssumption: Klasse2 null { []] +Class DEBUG [Typeinference] Erstellte Assumptions: this: MatrixMethod Assumptions: +[MethodAssumption: Matrix null { []] FieldVar Assumptions: -[typinferenz.assumptions.FieldAssumption@3ea4e3ae] +[typinferenz.assumptions.FieldAssumption@cd7e6ef] LocalVar Assumptions: [] Parameter Assumptions: [] -Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse1Method Assumptions: -[MethodAssumption: int int { [null Return var1], MethodAssumption: Klasse1 null { []] -FieldVar Assumptions: -[typinferenz.assumptions.FieldAssumption@1799e2e2] -LocalVar Assumptions: -[] -Parameter Assumptions: -[] +Block DEBUG [Typeinference] Prozessing statement: null Return null (( [ f, ]) -> null { [null Return null (f.apply( [ null (this(null)), m, ]))]) +Block DEBUG [Typeinference] Prozessing statement: null Return null (f.apply( [ null (this(null)), m, ])) +Block DEBUG [Typeinference] Prozessing statement: TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ])) +Block DEBUG [Typeinference] Prozessing statement: TPH CK Return TPH CE (( [ TPH CD f, ]) -> TPH CJ { [TPH CJ Return TPH CF (f: TPH CD.apply( [ Matrix (this(null)), m: TPH CB, ]))]) +Class DEBUG [Typeinference] Erstellte Constraints: TPH BZ < TPH BZ +[(TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), ] +TPH CF < TPH CJ +Fun1< TPH CJ, TPH CD > < TPH CE +TPH CE < TPH CK +Fun1< TPH CK, TPH CB > < TPH CC +TPH CC < TPH BZ -Block DEBUG [Typeinference] Prozessing statement: (var1 = NEW Klasse1) -Block DEBUG [Typeinference] Prozessing statement: null Return null (var1.getVar1( [ ])) -Block DEBUG [Typeinference] Prozessing statement: TPH K Return TPH J (var1: TPH A.getVar1( [ ])) -Block DEBUG [Typeinference] Prozessing statement: void(var1: TPH A = NEW Klasse1) -Class DEBUG [Typeinference] Erstellte Constraints: TPH A < TPH A -[(Klasse1 <. Klasse1), (Klasse1 <. Klasse1), ] -Klasse1 < TPH A -TPH A < TPH I -[(int <. TPH J), (TPH A <. Klasse1), (int <. TPH J), (TPH A <. Klasse1), ] -TPH J < TPH K -TPH K < TPH B - -SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)], [(TPH A <. TPH A), (Klasse1 <. Klasse1), (Klasse1 <. TPH A), (TPH A <. TPH I), (int <. TPH J), (TPH A <. Klasse1), (TPH J <. TPH K), (TPH K <. TPH B)]] -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]] +SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH BZ <. TPH BZ), (TPH CG <. TPH CF), (Matrix <. TPH CH), (TPH CB <. TPH CI), (TPH CD <. FunN), (TPH CF <. TPH CJ), (Fun1< TPH CJ, TPH CD > <. TPH CE), (TPH CE <. TPH CK), (Fun1< TPH CK, TPH CB > <. TPH CC), (TPH CC <. TPH BZ)]] +SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)], [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)]] SourceFile DEBUG [Typeinference] JavaFiles: -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Matrix), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -SourceFile DEBUG [Typeinference] class Klasse2 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Klasse1 var1; -int testMethode() -{ -var1 = new Klasse1(); -return var1.getVar1();; -} -Klasse2 Klasse2() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } } -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]] -SourceFile DEBUG [Typeinference] -JavaFiles: +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)] - -SourceFile DEBUG [Typeinference] class Klasse2 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Klasse1 var1; -int testMethode() -{ -var1 = new Klasse1(); -return var1.getVar1();; -} -Klasse2 Klasse2() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } } -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]] -SourceFile DEBUG [Typeinference] -JavaFiles: +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)] - -SourceFile DEBUG [Typeinference] class Klasse2 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Klasse1 var1; -int testMethode() -{ -var1 = new Klasse1(); -return var1.getVar1();; -} -Klasse2 Klasse2() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } } -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)]] -SourceFile DEBUG [Typeinference] -JavaFiles: +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? extends GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH B = int), (TPH I = Klasse1), (TPH K = int), (TPH A = Klasse1), (TPH J = int)] - -SourceFile DEBUG [Typeinference] class Klasse2 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -Klasse1 var1; -int testMethode() -{ -var1 = new Klasse1(); -return var1.getVar1();; -} -Klasse2 Klasse2() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } } -Block DEBUG [Typeinference] Prozessing statement: null Return var1 -Block DEBUG [Typeinference] Prozessing statement: TPH L Return var1: TPH D -Class DEBUG [Typeinference] Erstellte Constraints: TPH D < TPH D -TPH D < TPH L -TPH L < int +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? extends Vector< ? super GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH D <. TPH D), (TPH D <. TPH L), (TPH L <. int)]] -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH D = int), (TPH L = int)]] -SourceFile DEBUG [Typeinference] -JavaFiles: - -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH D = int), (TPH L = int)] - -SourceFile DEBUG [Typeinference] class Klasse1 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -int var1; -int getVar1() -{ -return var1; -} -Klasse1 Klasse1() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } } -Class DEBUG [Typeinference] Erstellte Assumptions: this: Klasse1Method Assumptions: -[MethodAssumption: int int { [null Return var1], MethodAssumption: Klasse1 null { []] -FieldVar Assumptions: -[typinferenz.assumptions.FieldAssumption@744578e0] -LocalVar Assumptions: -[] -Parameter Assumptions: -[] +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Vector< GTV Integer > >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] -Block DEBUG [Typeinference] Prozessing statement: null Return var1 -Block DEBUG [Typeinference] Prozessing statement: TPH M Return var1: TPH F -Class DEBUG [Typeinference] Erstellte Constraints: TPH F < TPH F -TPH F < TPH M -TPH M < int - -SourceFile DEBUG [Typeinference] Karthesisches Produkt der Constraints: [[(TPH F <. TPH F), (TPH F <. TPH M), (TPH M <. int)]] -SourceFile DEBUG [Typeinference] Unifiziertes Ergebnis: [[(TPH F = int), (TPH M = int)]] -SourceFile DEBUG [Typeinference] -JavaFiles: - -SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH F = int), (TPH M = int)] - -SourceFile DEBUG [Typeinference] class Klasse1 extends Object +SourceFile DEBUG [Typeinference] class Matrix extends Vector> { -int var1; -int getVar1() -{ -return var1; -} -Klasse1 Klasse1() +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() +{ +} +} + +SourceFile DEBUG [Typeinference] JavaFile für ResultSet Unified Constraints: [(TPH CG <. TPH CF), (TPH CB <. TPH CI), (TPH CF <. TPH CJ), (TPH CK = Fun1< TPH CJ, FunN >), (TPH BZ = Fun1< Fun1< TPH CJ, FunN >, TPH CB >), (TPH CH = Vector< ? super Matrix >), (TPH CD = FunN), (TPH CE = Fun1< TPH CJ, FunN >), (TPH CC = Fun1< Fun1< TPH CJ, FunN >, TPH CB >)] + +SourceFile DEBUG [Typeinference] class Matrix extends Vector> +{ +Fun1, CB> op = (CB m) -> { +return (FunN f) -> { +return f.apply(this, m);; +}; +}; +Matrix Matrix() { } }