diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index f04711e8..402f578d 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -435,11 +435,10 @@ public class BytecodeGenMethod implements StatementVisitor{ @Override public void visit(Literal literal) { - System.out.println(resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor())); Object value = literal.value; switch (resultSet.resolveType(literal.getType()).resolvedType.acceptTV(new TypeToDescriptor())) { case "java/lang/String": - mv.visitLdcInsn((String) value); + mv.visitLdcInsn(value); break; case "java/lang/Boolean": visitBooleanLiteral((Boolean) value); diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index cc4a6a13..f9bcb369 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -132,7 +132,8 @@ public class Signature { break; case "TPH": RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType; - sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature())); + if(!r.acceptTV(new TypeToSignature()).substring(0, 4).equals("TPH ")) + sv.visitInterface().visitClassType(r.acceptTV(new TypeToSignature())); // sv.visitClassType(r.acceptTV(new TypeToSignature())); System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature())); break; diff --git a/test/bytecode/AssignToLit.jav b/test/bytecode/AssignToLit.jav index 4691a5da..46ec2b91 100644 --- a/test/bytecode/AssignToLit.jav +++ b/test/bytecode/AssignToLit.jav @@ -10,7 +10,7 @@ import java.lang.Character; class AssignToLit { void m(){ - String s = "String"; + String s = "Test"; Boolean b = false; Byte byte1 = 5; Byte byte2 = 55; diff --git a/test/bytecode/Methods.jav b/test/bytecode/Methods.jav new file mode 100644 index 00000000..3c46739d --- /dev/null +++ b/test/bytecode/Methods.jav @@ -0,0 +1,14 @@ +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/test/bytecode/MethodsTest.java b/test/bytecode/MethodsTest.java new file mode 100644 index 00000000..11195b71 --- /dev/null +++ b/test/bytecode/MethodsTest.java @@ -0,0 +1,7 @@ +package bytecode; + +public class MethodsTest extends JavaTXCompilerTest { + public MethodsTest() { + this.fileName = "Methods"; + } +}