From f325b04ee28da57409c5dede90b303d997ebeb75 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Thu, 11 Oct 2018 14:17:54 +0200 Subject: [PATCH 1/2] Bugs 111 und 114 gefixt. Unboxing wird aufgerufen wenn es noetig ist --- src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index c421ddc9..e35127ed 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -282,7 +282,6 @@ public class BytecodeGenMethod implements StatementVisitor { default: break; } - } private String getLargerType(String lexpType, String rexpType) { @@ -782,7 +781,7 @@ public class BytecodeGenMethod implements StatementVisitor { doUnboxing(getResolvedType(methodCall.getType())); } - if(methodRefl == null && !isReturnStmt) { + if(methodRefl == null/* && !isReturnStmt*/) { if(isBinaryExp) doUnboxing(getResolvedType(methodCall.getType())); } @@ -1081,7 +1080,11 @@ public class BytecodeGenMethod implements StatementVisitor { break; case "java/lang/Integer": // zweite Argument isLong - visitIntegerLiteral(((Double) value).intValue(), false); +// visitIntegerLiteral(((Double) value).intValue(), false); + if(value instanceof Double) + visitIntegerLiteral(((Double) value).intValue(), false); + if(value instanceof Integer) + visitIntegerLiteral(((Integer) value).intValue(), false); break; case "java/lang/Long": visitLongLiteral(((Double) value).longValue(), true); From 0d83ee8505ac6bd1414b0a53157c8b5ab4c264bc Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Thu, 11 Oct 2018 16:01:26 +0200 Subject: [PATCH 2/2] modified: src/de/dhbwstuttgart/bytecode/signature/Signature.java Zyklen werden abgefangen. --- src/de/dhbwstuttgart/bytecode/signature/Signature.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index 6f387f17..39668648 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -432,6 +432,9 @@ public class Signature { while(subAndSuperTph.containsKey(superTph)) { superTph = subAndSuperTph.get(superTph); + if(tphsInRel.containsValue(superTph)) { + break; + } tphsInRel.put(tphsInRel.size(), superTph); numOfVisitedPairs++; }