Class OverloadMethodSet
java.lang.Object
org.benf.cfr.reader.entities.classfilehelpers.OverloadMethodSet
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OverloadMethodSet.MethodData
private final List<OverloadMethodSet.MethodData>
private final ClassFile
-
Constructor Summary
ConstructorsModifierConstructorDescriptionOverloadMethodSet
(ClassFile classFile, MethodPrototype actualPrototype, List<MethodPrototype> allPrototypes) private
OverloadMethodSet
(ClassFile classFile, OverloadMethodSet.MethodData actualPrototype, List<OverloadMethodSet.MethodData> allPrototypes) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
callsCorrectApproxObjMethod
(Expression newArg, JavaTypeInstance actual, int idx, GenericTypeBinder gtb) private boolean
callsCorrectApproxRawMethod
(JavaTypeInstance actual, int idx, GenericTypeBinder gtb) boolean
callsCorrectEntireMethod
(List<Expression> args, GenericTypeBinder gtb) boolean
callsCorrectMethod
(Expression newArg, int idx, GenericTypeBinder gtb) getArgType
(int idx, JavaTypeInstance used) getPossibleArgTypes
(int idx, JavaTypeInstance used) int
size()
private JavaTypeInstance
unbox
(JavaTypeInstance actual)
-
Field Details
-
classFile
-
actualPrototype
-
allPrototypes
-
-
Constructor Details
-
OverloadMethodSet
public OverloadMethodSet(ClassFile classFile, MethodPrototype actualPrototype, List<MethodPrototype> allPrototypes) -
OverloadMethodSet
private OverloadMethodSet(ClassFile classFile, OverloadMethodSet.MethodData actualPrototype, List<OverloadMethodSet.MethodData> allPrototypes)
-
-
Method Details
-
specialiseTo
-
getArgType
-
getPossibleArgTypes
-
callsCorrectEntireMethod
-
size
public int size() -
unbox
-
callsCorrectMethod
-
callsCorrectApproxRawMethod
private boolean callsCorrectApproxRawMethod(JavaTypeInstance actual, int idx, GenericTypeBinder gtb) -
callsCorrectApproxObjMethod
private boolean callsCorrectApproxObjMethod(Expression newArg, JavaTypeInstance actual, int idx, GenericTypeBinder gtb)
-