CloneSet979


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
31230.979executable_statement
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
131602
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsConstraintCreator.java
216671
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsConstraintCreator.java
Clone Instance
1
Line Count
31
Source Line
602
Source File
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: ???
                                        }
                                }
                                                                    }


Clone Instance
2
Line Count
16
Source Line
671
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsConstraintCreator.java

                                                                                  {
                                                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: ???
                                                        }
                                                }
                                                                                  }


Clone AbstractionParameter Count: 3Parameter Bindings

{
  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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b52b7dc0]]
declaredParameterType 
12[[#b52b7dc0]]
typeArgument 
21[[#b52b7da0]]
createSubtypeConstraint 
22[[#b52b7da0]]
createEqualsConstraint 
31[[#b52b7ec0]]
argCv 
32[[#b52b7ec0]]
argElementCv