Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
24 | 2 | 2 | 0.972 | statement_sequence_member |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 24 | 238 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java |
2 | 24 | 110 | 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 == 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; } } |
| ||||
// 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; } } |
| |||
// 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b4116300]] | binding |
1 | 2 | [[#b4116300]] | this.binding |
2 | 1 | [[#b4116280]] | syntheticAccessors |
2 | 2 | [[#b4116280]] | this.syntheticAccessors |