modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Methode unbenannt in unbox
This commit is contained in:
parent
e581050a61
commit
8d72b58fcc
@ -942,7 +942,7 @@ public class BytecodeGenMethod implements StatementVisitor {
|
||||
}
|
||||
|
||||
|
||||
boolean basetypeComp(String demanded, String given) {
|
||||
boolean unbox(String demanded, String given) {
|
||||
if (demanded.equals("java/lang/Boolean") && given.equals("boolean")) return true;
|
||||
if (demanded.equals("java/lang/Integer") && given.equals("int")) return true;
|
||||
if (demanded.equals("java/lang/Short") && given.equals("short")) return true;
|
||||
@ -970,13 +970,13 @@ public class BytecodeGenMethod implements StatementVisitor {
|
||||
if(name.equals(m.getName()) && i == m.getParameterCount() &&
|
||||
(methCallType.equals(m.getReturnType().getName().replace(".", "/")) ||
|
||||
m.getReturnType().getName().replace(".", "/").equals(Type.getInternalName(Object.class)) ||
|
||||
basetypeComp(methCallType, m.getReturnType().getName().replace(".", "/"))
|
||||
unbox(methCallType, m.getReturnType().getName().replace(".", "/"))
|
||||
) ) {
|
||||
boolean typesEqual = true;
|
||||
Class<?>[] pTypes = m.getParameterTypes();
|
||||
for(int j = 0; j<typesOfParams.length; ++j) {
|
||||
if(!typesOfParams[j].replaceAll("/", ".").equals(pTypes[j].getName())
|
||||
&& !basetypeComp(typesOfParams[j], pTypes[j].getName())
|
||||
&& !unbox(typesOfParams[j], pTypes[j].getName())
|
||||
&& !pTypes[j].getName().replace(".", "/").equals(Type.getInternalName(Object.class))) {
|
||||
typesEqual = false;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user