| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 31 | 2 | 3 | 0.979 | executable_statement |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 31 | 602 | plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsConstraintCreator.java |
| 2 | 16 | 671 | plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsConstraintCreator.java |
| ||||
{
ConstraintVariable2 methodTypeVariableCv = (ConstraintVariable2) methodTypeVariables.get(declaredParameterType.getBindingKey());
if (methodTypeVariableCv != null) {
// e.g. t in "<T> void take(T t, List<T> ts)"
fTCModel.createSubtypeConstraint(argCv, methodTypeVariableCv);
}
else {
if (createdType != null) {
//e.g. Tuple<T1, T2>: constructor Tuple(T1 t1, T2 t2)
ConstraintVariable2 createdTypeCv = getConstraintVariable(createdType);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(createdTypeCv, (TypeVariable) declaredParameterType);
// [arg] <= Elem[createdType]:
fTCModel.createSubtypeConstraint(argCv, elementCv);
}
if (receiver != null) {
//e.g. "Collection<E>: boolean add(E o)"
ConstraintVariable2 expressionCv = getConstraintVariable(receiver);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(expressionCv, (TypeVariable) declaredParameterType);
// //TypeVariableConstraintVariable2 typeVariableCv= fTCModel.makeTypeVariableVariable(declaredParameterType);
// ConstraintVariable2 elementCv= fTCModel.makeElementVariable(expressionCv, typeVariableCv);
//TODO: Somebody must connect typeVariableCv to corresponding typeVariableCVs of supertypes.
//- Do only once for binaries.
//- Do when passing for sources.
//- Keep a flag in CV whether done?
//- Do in one pass over all TypeVarCvs at the end?
// [arg] <= Elem[receiver]:
fTCModel.createSubtypeConstraint(argCv, elementCv);
}
else {
//TODO: ???
}
}
}
|
| ||||
{
ConstraintVariable2 methodTypeVariableCv = (ConstraintVariable2) methodTypeVariables.get(typeArgument.getBindingKey());
if (methodTypeVariableCv != null) {
//e.g. in Collections: <T> List<T> synchronizedList(List<T> list)
fTCModel.createEqualsConstraint(argElementCv, methodTypeVariableCv);
}
else {
if (createdType != null) {
ConstraintVariable2 createdTypeCv = getConstraintVariable(createdType);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(createdTypeCv, (TypeVariable) typeArgument);
fTCModel.createEqualsConstraint(argElementCv, elementCv);
}
if (receiver != null) {
ConstraintVariable2 expressionCv = getConstraintVariable(receiver);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(expressionCv, (TypeVariable) typeArgument);
fTCModel.createEqualsConstraint(argElementCv, elementCv);
}
else {
//TODO: ???
}
}
}
|
| |||
{
ConstraintVariable2 methodTypeVariableCv = (ConstraintVariable2) methodTypeVariables.get( [[#variableb52b7dc0]].getBindingKey());
if (methodTypeVariableCv != null) {
// e.g. t in "<T> void take(T t, List<T> ts)"
//e.g. in Collections: <T> List<T> synchronizedList(List<T> list)
fTCModel. [[#variableb52b7da0]]( [[#variableb52b7ec0]], methodTypeVariableCv);
}
else {
if (createdType != null) {
//e.g. Tuple<T1, T2>: constructor Tuple(T1 t1, T2 t2)
ConstraintVariable2 createdTypeCv = getConstraintVariable(createdType);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(createdTypeCv, (TypeVariable) [[#variableb52b7dc0]]);
// [arg] <= Elem[createdType]:
fTCModel. [[#variableb52b7da0]]( [[#variableb52b7ec0]], elementCv);
}
if (receiver != null) {
//e.g. "Collection<E>: boolean add(E o)"
ConstraintVariable2 expressionCv = getConstraintVariable(receiver);
ConstraintVariable2 elementCv = fTCModel.getElementVariable(expressionCv, (TypeVariable) [[#variableb52b7dc0]]);
// //TypeVariableConstraintVariable2 typeVariableCv= fTCModel.makeTypeVariableVariable(declaredParameterType);
// ConstraintVariable2 elementCv= fTCModel.makeElementVariable(expressionCv, typeVariableCv);
//TODO: Somebody must connect typeVariableCv to corresponding typeVariableCVs of supertypes.
//- Do only once for binaries.
//- Do when passing for sources.
//- Keep a flag in CV whether done?
//- Do in one pass over all TypeVarCvs at the end?
// [arg] <= Elem[receiver]:
fTCModel. [[#variableb52b7da0]]( [[#variableb52b7ec0]], elementCv);
}
else {
//TODO: ???
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b52b7dc0]] | declaredParameterType |
| 1 | 2 | [[#b52b7dc0]] | typeArgument |
| 2 | 1 | [[#b52b7da0]] | createSubtypeConstraint |
| 2 | 2 | [[#b52b7da0]] | createEqualsConstraint |
| 3 | 1 | [[#b52b7ec0]] | argCv |
| 3 | 2 | [[#b52b7ec0]] | argElementCv |