Bytecodegenerierung angepasst. Tests erstellt

This commit is contained in:
JanUlrich 2014-03-12 18:28:30 +01:00
parent 931e90e7f2
commit d7e6a7848d
31 changed files with 376 additions and 160 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<EFBFBD>gt in Konstruktor und set Methode ein aload_0 ein wird f<EFBFBD>r StoreSomethingParmCon ben<EFBFBD>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<interfaces.size(); i++) {
writeShort(f, interfaces.elementAt(i));
}
// Felder verarbeiten
codegenlog.info("Verarbeite Fields: " + fields.size());
writeShort(f, (short)fields.size());
for(int i = 0; i < fields.size(); i++)
{
fields.elementAt(i).codegen(this, f);
}
// Methodenvektor
codegenlog.info("Verarbeite Methodenliste: " + methods.size());
writeShort(f, (short)methods.size());
for(int i = 0; i < methods.size(); i++)
{
codegenlog.debug("Verarbeite Methode " + (i+1));
methods.elementAt(i).codegen(this, f);
}
// Attribut-Vektor
codegenlog.info("Verarbeite Attribute: " + attributes.size());
writeShort(f, (short)attributes.size());
for(int i = 0; i < attributes.size(); i++)
{
attributes.elementAt(i).codegen(this, f);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JVMCodeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return f.toByteArray();
}
}
// ino.end

View File

@ -0,0 +1,10 @@
package mycompiler.mybytecode;
import java.io.IOException;
import java.io.OutputStream;
import mycompiler.myexception.JVMCodeException;
public interface ClassFileMember {
public void codegen(ClassFile cf, OutputStream out) throws JVMCodeException, IOException;
}

View File

@ -5,8 +5,10 @@ package mycompiler.mybytecode;
// ino.module.CodeAttribute.8532.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.util.Vector;
import mycompiler.myexception.JVMCodeException;
import mycompiler.mytype.Type;
// ino.end
@ -231,7 +233,8 @@ public class CodeAttribute extends Attribute
// ino.end
// ino.method.codegen.21757.definition
public void codegen(ClassFile classfile, FileOutputStream f)
@Override
public void codegen(ClassFile classfile, OutputStream f)
throws JVMCodeException, IOException
// ino.end
// ino.method.codegen.21757.body

View File

@ -5,11 +5,13 @@ package mycompiler.mybytecode;
// ino.module.ExceptionTable.8545.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.log4j.Logger;
// ino.end
// ino.class.ExceptionTable.22047.declaration
public class ExceptionTable
public class ExceptionTable implements ClassFileMember
// ino.end
// ino.class.ExceptionTable.22047.body
{
@ -36,7 +38,8 @@ public class ExceptionTable
// ino.end
// ino.method.codegen.22065.definition
public void codegen(ClassFile classfile, FileOutputStream f)
@Override
public void codegen(ClassFile classfile, OutputStream f)
throws IOException
// ino.end
// ino.method.codegen.22065.body

View File

@ -5,13 +5,16 @@ package mycompiler.mybytecode;
// ino.module.FieldInfo.8546.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import mycompiler.myexception.JVMCodeException;
import org.apache.log4j.Logger;
// ino.end
// ino.class.FieldInfo.22068.declaration
public class FieldInfo
public class FieldInfo implements ClassFileMember
// ino.end
// ino.class.FieldInfo.22068.body
{
@ -177,7 +180,8 @@ public class FieldInfo
// ino.end
// ino.method.codegen.22137.definition
public void codegen(ClassFile classfile, FileOutputStream f)
@Override
public void codegen(ClassFile classfile, OutputStream f)
throws IOException, JVMCodeException
// ino.end
// ino.method.codegen.22137.body

View File

@ -4,11 +4,13 @@ package mycompiler.mybytecode;
// ino.module.Key.8548.import
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.log4j.Logger;
// ino.end
// ino.class.Key.22890.declaration
public class Key
public class Key implements ClassFileMember
// ino.end
// ino.class.Key.22890.body
{
@ -87,7 +89,8 @@ public class Key
// ino.end
// ino.method.codegen.22920.definition
public void codegen(ClassFile classfile, FileOutputStream f)
@Override
public void codegen(ClassFile classfile, OutputStream f)
// ino.end
// ino.method.codegen.22920.body
{

View File

@ -5,13 +5,16 @@ package mycompiler.mybytecode;
// ino.module.MethodInfo.8549.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import mycompiler.myexception.JVMCodeException;
import org.apache.log4j.Logger;
// ino.end
// ino.class.MethodInfo.22923.declaration
public class MethodInfo
public class MethodInfo implements ClassFileMember
// ino.end
// ino.class.MethodInfo.22923.body
{
@ -111,7 +114,7 @@ public class MethodInfo
// ino.end
// ino.method.codegen.22965.definition
public void codegen(ClassFile classfile, FileOutputStream f)
public void codegen(ClassFile classfile, OutputStream f)
throws JVMCodeException, IOException
// ino.end
// ino.method.codegen.22965.body

View File

@ -5,7 +5,9 @@ package mycompiler.mybytecode;
// ino.module.SignatureInfo.8550.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import mycompiler.myclass.ParameterList;
import mycompiler.myclass.UsedId;
import mycompiler.myexception.JVMCodeException;
@ -13,6 +15,7 @@ import mycompiler.mytype.BoundedGenericTypeVar;
import mycompiler.mytype.GenericTypeVar;
import mycompiler.mytype.RefType;
import mycompiler.mytype.Type;
import org.apache.log4j.Logger;
// ino.end
@ -175,7 +178,8 @@ public class SignatureInfo extends Attribute
// ino.end
// ino.method.codegen.22987.definition
public void codegen(ClassFile classfile, FileOutputStream f)
@Override
public void codegen(ClassFile classfile, OutputStream f)
throws JVMCodeException, IOException
// ino.end
// ino.method.codegen.22987.body

View File

@ -328,7 +328,9 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface
//}
//geändert von Andreas Stadelmeier: pkgName wird nicht mehr aus dem SourceFile ausgelesen:
classfile.add_class(getName(), pkgName.get_Name_1Element(), superClass, getAccessFlags());
String packageName = "";
if(pkgName != null) packageName = pkgName.get_Name_1Element();
classfile.add_class(getName(), packageName, superClass, getAccessFlags());
// Handling fuer Superinterfaces
classfile.addSuperInterfaces(getSuperInterfaces());

View File

@ -0,0 +1,45 @@
package bytecode;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Vector;
import junit.framework.TestCase;
import mycompiler.MyCompiler;
import mycompiler.MyCompilerAPI;
import mycompiler.mybytecode.ClassFile;
import mycompiler.myexception.JVMCodeException;
public class BytecodeTester{
//Web-Disassembler: http://hakurai.github.io/javap.js/web/
public static final String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
public static Vector<ClassFile> testCodegen(String sourceCode){
MyCompilerAPI compiler = MyCompiler.getAPI();
compiler.parse("class EmptyClass{}");
Vector<ClassFile> 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<ClassFile> 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();
}
}

View File

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

View File

@ -0,0 +1,6 @@
class FieldTest{
String var;
String methode(String para1){
return var;
}
}

View File

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

View File

@ -0,0 +1,12 @@
package bytecode;
import org.junit.Test;
public class MethodTest {
@Test
public void test(){
BytecodeTester.testCodegen("class MethodTest{ public void method(){} }");
}
}

View File

@ -0,0 +1,3 @@
interface TestInterface{
}

View File

@ -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<String,String> variableTypeAssumptions = new HashMap<String,String>();
public void executeTest(){
LambdaTest tester = new LambdaTest(exampleJavFile);
tester.runTest();
}
}

View File

@ -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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Klasse1 var1;
int testMethode()
{
var1 = new Klasse1();
return var1.getVar1();;
}
Klasse2 Klasse2()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Klasse1 var1;
int testMethode()
{
var1 = new Klasse1();
return var1.getVar1();;
}
Klasse2 Klasse2()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Klasse1 var1;
int testMethode()
{
var1 = new Klasse1();
return var1.getVar1();;
}
Klasse2 Klasse2()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Klasse1 var1;
int testMethode()
{
var1 = new Klasse1();
return var1.getVar1();;
}
Klasse2 Klasse2()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
int var1;
int getVar1()
{
return var1;
}
Klasse1 Klasse1()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
int var1;
int getVar1()
{
return var1;
}
Klasse1 Klasse1()
Fun1<Fun1<CJ, FunN>, 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 <CJ, CB>Matrix extends Vector<Vector<Integer>>
{
Fun1<Fun1<CJ, FunN>, CB> op = (CB m) -> {
return (FunN f) -> {
return f.apply(this, m);;
};
};
Matrix Matrix()
{
}
}