From 5c5b1ea2b17c777d22db0cb265300f7c57ea6d32 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Fri, 5 Apr 2019 12:05:07 +0200 Subject: [PATCH] IdTest funktioniert --- .../dhbwstuttgart/bytecode/BytecodeGenMethod.java | 4 ++-- .../bytecode/signature/Signature.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index b1ea614f..4cda7f55 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -772,7 +772,7 @@ public class BytecodeGenMethod implements StatementVisitor { System.out.println("Methods of " + receiverName + " "); java.lang.reflect.Method methodRefl = null; String clazz = receiverName.replace("/", "."); -// if(!receiverName.equals(className)) { + if(!receiverName.equals(className)) { ClassLoader cLoader = ClassLoader.getSystemClassLoader(); // This will be used if the class is not standard class (not in API) ClassLoader cLoader2; @@ -852,7 +852,7 @@ public class BytecodeGenMethod implements StatementVisitor { //do nothing } } -// } + } methodCall.receiver.accept(this); diff --git a/src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java index 8493e9bb..ca191b7d 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -302,8 +302,9 @@ public class Signature { // das braucht man nicht es reicht: sv.visitTypeVariable(r.acceptTV(new TypeToSignature()) // String sig2 = r.acceptTV(new TypeToSignature()); - String eqTPH = getEqualTPH(methodConstraints, sig2.substring(1, sig2.length()-1))+"$"; - if(!(r instanceof TypePlaceholder)) { + if(r instanceof GenericRefType) { + sv.visitTypeVariable(sig2); + }else if(!(r instanceof TypePlaceholder)) { if(sig2.contains("$$")) { System.out.println(" Signature FUN$$: "+r); sv.visitInterface().visitClassType(sig2.substring(1, sig2.length())); @@ -311,16 +312,17 @@ public class Signature { // Kann zwischen GenericRefType und RefType nicht unterscheiden // Deswegen wird immer geprüft, ob der Name in Generic Maps liegt String n = sig2.substring(1, sig2.length()-1); - if(genericsAndBoundsMethod.containsKey(n) || genericsAndBounds.containsKey(n)) { - sv.visitTypeVariable(n); - } else { +// if(genericsAndBoundsMethod.containsKey(n) || genericsAndBounds.containsKey(n)) { +// sv.visitTypeVariable(n); +// } else { sv.visitClassType(n); sv.visitEnd(); - } +// } // sv.visitClassType(n); } } else { + String eqTPH = getEqualTPH(methodConstraints, sig2.substring(1, sig2.length()-1))+"$"; System.out.println(r.getClass()+" Signature TPH: "+r.acceptTV(new TypeToSignature())); sv.visitTypeVariable(eqTPH); }