CloneSet261


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
24220.972statement_sequence_member
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
124238
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java
224110
plugins/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java
Clone Instance
1
Line Count
24
Source Line
238
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java

                // optimizing assignment like: i = i + 1 or i = 1 + i
                if (assignment.expression.isCompactableOperation()) {
                        BinaryExpression operation = (BinaryExpression) assignment.expression;
                        int operator = (operation.bits&  OperatorMASK) >> OperatorSHIFT;
                        SingleNameReference variableReference;
                        if ((operation.left instanceof SingleNameReference) && ((variableReference = (SingleNameReference) operation.left).binding == binding)) {
                                // i = i + value, then use the variable on the right hand side, since it has the correct implicit conversion
                                variableReference.generateCompoundAssignment(currentScope, codeStream, syntheticAccessors == null ? null:  syntheticAccessors[WRITE], operation.right, operator, operation.implicitConversion, valueRequired);
                                if (valueRequired) {
                                        codeStream.generateImplicitConversion(assignment.implicitConversion);
                                }
                                return;
                        }
                        if ((operation.right instanceof SingleNameReference) &&
                                           ((operator == PLUS) || (operator == MULTIPLY)) // only commutative operations
                            &&             ((variableReference = (SingleNameReference) operation.right).binding == binding) &&
                                           (operation.left.constant != Constant.NotAConstant) // exclude non constant expressions, since could have side-effect
                            &&             (((operation.left.implicitConversion&  IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString) // exclude string concatenation which would occur backwards
                            &&             (((operation.right.implicitConversion&  IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString)) { // exclude string concatenation which would occur backwards
                                // i = value + i, then use the variable on the right hand side, since it has the correct implicit conversion
                                variableReference.generateCompoundAssignment(currentScope, codeStream, syntheticAccessors == null ? null:  syntheticAccessors[WRITE], operation.left, operator, operation.implicitConversion, valueRequired);
                                if (valueRequired) {
                                        codeStream.generateImplicitConversion(assignment.implicitConversion);
                                }
                                return;
                        }
                }


Clone Instance
2
Line Count
24
Source Line
110
Source File
plugins/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetSingleNameReference.java

        // optimizing assignment like: i = i + 1 or i = 1 + i
        if (assignment.expression.isCompactableOperation()) {
                BinaryExpression operation = (BinaryExpression) assignment.expression;
                int operator = (operation.bits&  OperatorMASK) >> OperatorSHIFT;
                SingleNameReference variableReference;
                if ((operation.left instanceof SingleNameReference) && ((variableReference = (SingleNameReference) operation.left).binding == this.binding)) {
                        // i = i + value, then use the variable on the right hand side, since it has the correct implicit conversion
                        variableReference.generateCompoundAssignment(currentScope, codeStream, this.syntheticAccessors == null ? null:  this.syntheticAccessors[WRITE], operation.right, operator, operation.implicitConversion, valueRequired);
                        if (valueRequired) {
                                codeStream.generateImplicitConversion(assignment.implicitConversion);
                        }
                        return;
                }
                if ((operation.right instanceof SingleNameReference) &&
                           ((operator == PLUS) || (operator == MULTIPLY)) // only commutative operations
                    &&     ((variableReference = (SingleNameReference) operation.right).binding == this.binding) &&
                           (operation.left.constant != Constant.NotAConstant) // exclude non constant expressions, since could have side-effect
                    &&     (((operation.left.implicitConversion&  IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString) // exclude string concatenation which would occur backwards
                    &&     (((operation.right.implicitConversion&  IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString)) { // exclude string concatenation which would occur backwards
                        // i = value + i, then use the variable on the right hand side, since it has the correct implicit conversion
                        variableReference.generateCompoundAssignment(currentScope, codeStream, this.syntheticAccessors == null ? null:  this.syntheticAccessors[WRITE], operation.left, operator, operation.implicitConversion, valueRequired);
                        if (valueRequired) {
                                codeStream.generateImplicitConversion(assignment.implicitConversion);
                        }
                        return;
                }
        }


Clone AbstractionParameter Count: 2Parameter Bindings

// optimizing assignment like: i = i + 1 or i = 1 + i
if (assignment.expression.isCompactableOperation()) {
  BinaryExpression operation = (BinaryExpression) assignment.expression;
  int operator = (operation.bits&OperatorMASK) >> OperatorSHIFT;
  SingleNameReference variableReference;
  if ((operation.left instanceof SingleNameReference) && ((variableReference = (SingleNameReference) operation.left).binding == [[#variableb4116300]])) {
    // i = i + value, then use the variable on the right hand side, since it has the correct implicit conversion
    variableReference.generateCompoundAssignment(currentScope, codeStream,  [[#variableb4116280]]== null ? null: [[#variableb4116280]][WRITE], operation.right, operator, operation.implicitConversion, valueRequired);
    if (valueRequired) {
      codeStream.generateImplicitConversion(assignment.implicitConversion);
    }
    return;
  }
  if ((operation.right instanceof SingleNameReference) && ((operator == PLUS) || (operator == MULTIPLY)) // only commutative operations
      && ((variableReference = (SingleNameReference) operation.right).binding == [[#variableb4116300]]) && (operation.left.constant != Constant.NotAConstant) // exclude non constant expressions, since could have side-effect
      && (((operation.left.implicitConversion&IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString) // exclude string concatenation which would occur backwards
      && (((operation.right.implicitConversion&IMPLICIT_CONVERSION_MASK) >> 4) != T_JavaLangString)) { // exclude string concatenation which would occur backwards
    // i = value + i, then use the variable on the right hand side, since it has the correct implicit conversion
    variableReference.generateCompoundAssignment(currentScope, codeStream,  [[#variableb4116280]]== null ? null: [[#variableb4116280]][WRITE], operation.left, operator, operation.implicitConversion, valueRequired);
    if (valueRequired) {
      codeStream.generateImplicitConversion(assignment.implicitConversion);
    }
    return;
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b4116300]]
binding 
12[[#b4116300]]
this.binding 
21[[#b4116280]]
syntheticAccessors 
22[[#b4116280]]
this.syntheticAccessors