CloneSet1756


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
13250.951executable_statement
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
113171
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
213189
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java
Clone Instance
1
Line Count
13
Source Line
171
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java

                                {
                        if ((left.bits&  UnnecessaryCast) == 0 && left.resolvedType.isBaseType()) {
                                // narrowing conversion on base type may change value, thus necessary
                                leftIsCast = false;
                        }
                        else    {
                                TypeBinding alternateLeftType = ((CastExpression) left).expression.resolvedType;
                                if (alternateLeftType == null) return; // cannot do better
                                if ((alternateLeftTypeId = alternateLeftType.id) == leftTypeId) { // obvious identity cast
                                        scope.problemReporter().unnecessaryCast((CastExpression) left);
                                        leftIsCast = false;
                                }
                                else   if (alternateLeftTypeId == T_null) {
                                        alternateLeftTypeId = leftTypeId;  // tolerate null argument cast
                                        leftIsCast = false;
                                       }
                        }
                                }


Clone Instance
2
Line Count
13
Source Line
189
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java

                                 {
                        if ((right.bits&  UnnecessaryCast) == 0 && right.resolvedType.isBaseType()) {
                                // narrowing conversion on base type may change value, thus necessary
                                rightIsCast = false;
                        }
                        else   {
                                TypeBinding alternateRightType = ((CastExpression) right).expression.resolvedType;
                                if (alternateRightType == null) return; // cannot do better
                                if ((alternateRightTypeId = alternateRightType.id) == rightTypeId) { // obvious identity cast
                                        scope.problemReporter().unnecessaryCast((CastExpression) right);
                                        rightIsCast = false;
                                }
                                else   if (alternateRightTypeId == T_null) {
                                        alternateRightTypeId = rightTypeId;  // tolerate null argument cast
                                        rightIsCast = false;
                                       }
                        }
                                 }


Clone AbstractionParameter Count: 5Parameter Bindings

{
  if (( [[#variable565cb460]].bits&UnnecessaryCast) == 0 && [[#variable565cb460]].resolvedType.isBaseType()) {
     [[#variableb1ebf600]]= false;
  }
  else {
    TypeBinding  [[#variable565ca8c0]]= ((CastExpression)  [[#variable565cb460]]).expression.resolvedType;
    if ( [[#variable565ca8c0]]== null)
      return; // cannot do better
    if (( [[#variableb1ebe5a0]]= [[#variable565ca8c0]].id) == [[#variable565cb3c0]]) { // obvious identity cast
      scope.problemReporter().unnecessaryCast((CastExpression)  [[#variable565cb460]]);
       [[#variableb1ebf600]]= false;
    }
    else
      if ( [[#variableb1ebe5a0]]== T_null) {
         [[#variableb1ebe5a0]]= [[#variable565cb3c0]]; // tolerate null argument cast
         [[#variableb1ebf600]]= false;
      }
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#565cb460]]
left 
12[[#565cb460]]
right 
21[[#b1ebf600]]
// narrowing conversion on base type may change value, thus necessary
leftIsCast 
22[[#b1ebf600]]
// narrowing conversion on base type may change value, thus necessary
rightIsCast 
31[[#565ca8c0]]
alternateLeftType 
32[[#565ca8c0]]
alternateRightType 
41[[#b1ebe5a0]]
alternateLeftTypeId 
42[[#b1ebe5a0]]
alternateRightTypeId 
51[[#565cb3c0]]
leftTypeId 
52[[#565cb3c0]]
rightTypeId