Class OverloadMethodSet
- java.lang.Object
-
- org.benf.cfr.reader.entities.classfilehelpers.OverloadMethodSet
-
public class OverloadMethodSet extends java.lang.Object
These are the possibilities we could be hitting when we call an overloaded method. We must be sure that parameter casting rewrites don't move a call from using one method to using another. These are "vaguely" compatible - i.e. we shouldn't be comparing (int, int) with (Integer, String) as an explicit cast could never call the wrong one. HOWEVER - we should be comparing a vararg method, as a,b (int int) could be confused with a,[]{b,c}
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OverloadMethodSet.MethodData
-
Field Summary
Fields Modifier and Type Field Description private OverloadMethodSet.MethodData
actualPrototype
private java.util.List<OverloadMethodSet.MethodData>
allPrototypes
private ClassFile
classFile
-
Constructor Summary
Constructors Modifier Constructor Description OverloadMethodSet(ClassFile classFile, MethodPrototype actualPrototype, java.util.List<MethodPrototype> allPrototypes)
private
OverloadMethodSet(ClassFile classFile, OverloadMethodSet.MethodData actualPrototype, java.util.List<OverloadMethodSet.MethodData> allPrototypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
callsCorrectApproxObjMethod(Expression newArg, JavaTypeInstance actual, int idx, GenericTypeBinder gtb)
private boolean
callsCorrectApproxRawMethod(JavaTypeInstance actual, int idx, GenericTypeBinder gtb)
boolean
callsCorrectEntireMethod(java.util.List<Expression> args, GenericTypeBinder gtb)
boolean
callsCorrectMethod(Expression newArg, int idx, GenericTypeBinder gtb)
JavaTypeInstance
getArgType(int idx, JavaTypeInstance used)
java.util.List<JavaTypeInstance>
getPossibleArgTypes(int idx, JavaTypeInstance used)
int
size()
OverloadMethodSet
specialiseTo(JavaGenericRefTypeInstance type)
private JavaTypeInstance
unbox(JavaTypeInstance actual)
-
-
-
Field Detail
-
classFile
private final ClassFile classFile
-
actualPrototype
private final OverloadMethodSet.MethodData actualPrototype
-
allPrototypes
private final java.util.List<OverloadMethodSet.MethodData> allPrototypes
-
-
Constructor Detail
-
OverloadMethodSet
public OverloadMethodSet(ClassFile classFile, MethodPrototype actualPrototype, java.util.List<MethodPrototype> allPrototypes)
-
OverloadMethodSet
private OverloadMethodSet(ClassFile classFile, OverloadMethodSet.MethodData actualPrototype, java.util.List<OverloadMethodSet.MethodData> allPrototypes)
-
-
Method Detail
-
specialiseTo
public OverloadMethodSet specialiseTo(JavaGenericRefTypeInstance type)
-
getArgType
public JavaTypeInstance getArgType(int idx, JavaTypeInstance used)
-
getPossibleArgTypes
public java.util.List<JavaTypeInstance> getPossibleArgTypes(int idx, JavaTypeInstance used)
-
callsCorrectEntireMethod
public boolean callsCorrectEntireMethod(java.util.List<Expression> args, GenericTypeBinder gtb)
-
size
public int size()
-
unbox
private JavaTypeInstance unbox(JavaTypeInstance actual)
-
callsCorrectMethod
public boolean callsCorrectMethod(Expression newArg, int idx, GenericTypeBinder gtb)
-
callsCorrectApproxRawMethod
private boolean callsCorrectApproxRawMethod(JavaTypeInstance actual, int idx, GenericTypeBinder gtb)
-
callsCorrectApproxObjMethod
private boolean callsCorrectApproxObjMethod(Expression newArg, JavaTypeInstance actual, int idx, GenericTypeBinder gtb)
-
-