Class OverloadMethodSet
- java.lang.Object
-
- org.benf.cfr.reader.entities.classfilehelpers.OverloadMethodSet
-
public class OverloadMethodSet extends java.lang.ObjectThese 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 classOverloadMethodSet.MethodData
-
Field Summary
Fields Modifier and Type Field Description private OverloadMethodSet.MethodDataactualPrototypeprivate java.util.List<OverloadMethodSet.MethodData>allPrototypesprivate ClassFileclassFile
-
Constructor Summary
Constructors Modifier Constructor Description OverloadMethodSet(ClassFile classFile, MethodPrototype actualPrototype, java.util.List<MethodPrototype> allPrototypes)privateOverloadMethodSet(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 booleancallsCorrectApproxObjMethod(Expression newArg, JavaTypeInstance actual, int idx, GenericTypeBinder gtb)private booleancallsCorrectApproxRawMethod(JavaTypeInstance actual, int idx, GenericTypeBinder gtb)booleancallsCorrectEntireMethod(java.util.List<Expression> args, GenericTypeBinder gtb)booleancallsCorrectMethod(Expression newArg, int idx, GenericTypeBinder gtb)JavaTypeInstancegetArgType(int idx, JavaTypeInstance used)java.util.List<JavaTypeInstance>getPossibleArgTypes(int idx, JavaTypeInstance used)intsize()OverloadMethodSetspecialiseTo(JavaGenericRefTypeInstance type)private JavaTypeInstanceunbox(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)
-
-