| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 33 | 3 | 3 | 0.990 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 33 | 5058 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java |
| 2 | 33 | 5094 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java |
| 3 | 33 | 5130 | plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java |
| ||||
protected void setTypeForSingleVariableDeclaration(SingleVariableDeclaration singleVariableDeclaration, Type type, int extraDimension) {
if (extraDimension != 0) {
if (type.isArrayType()) {
ArrayType arrayType = (ArrayType) type;
int remainingDimensions = arrayType.getDimensions() - extraDimension;
if (remainingDimensions == 0) {
// the dimensions are after the name so the type of the fieldDeclaration is a simpleType
Type elementType = arrayType.getElementType();
// cut the child loose from its parent (without creating garbage)
elementType.setParent(null, null);
this.ast.getBindingResolver().updateKey(type, elementType);
singleVariableDeclaration.setType(elementType);
}
else {
int start = type.getStartPosition();
ArrayType subarrayType = arrayType;
int index = extraDimension;
while (index > 0) {
subarrayType = (ArrayType) subarrayType.getComponentType();
index--;
}
int end = retrieveProperRightBracketPosition(remainingDimensions, start);
subarrayType.setSourceRange(start, end - start + 1);
// cut the child loose from its parent (without creating garbage)
subarrayType.setParent(null, null);
updateInnerPositions(subarrayType, remainingDimensions);
singleVariableDeclaration.setType(subarrayType);
this.ast.getBindingResolver().updateKey(type, subarrayType);
}
}
else {
singleVariableDeclaration.setType(type);
}
}
else {
singleVariableDeclaration.setType(type);
}
}
|
| ||||
protected void setTypeForVariableDeclarationExpression(VariableDeclarationExpression variableDeclarationExpression, Type type, int extraDimension) {
if (extraDimension != 0) {
if (type.isArrayType()) {
ArrayType arrayType = (ArrayType) type;
int remainingDimensions = arrayType.getDimensions() - extraDimension;
if (remainingDimensions == 0) {
// the dimensions are after the name so the type of the fieldDeclaration is a simpleType
Type elementType = arrayType.getElementType();
// cut the child loose from its parent (without creating garbage)
elementType.setParent(null, null);
this.ast.getBindingResolver().updateKey(type, elementType);
variableDeclarationExpression.setType(elementType);
}
else {
int start = type.getStartPosition();
ArrayType subarrayType = arrayType;
int index = extraDimension;
while (index > 0) {
subarrayType = (ArrayType) subarrayType.getComponentType();
index--;
}
int end = retrieveProperRightBracketPosition(remainingDimensions, start);
subarrayType.setSourceRange(start, end - start + 1);
// cut the child loose from its parent (without creating garbage)
subarrayType.setParent(null, null);
updateInnerPositions(subarrayType, remainingDimensions);
variableDeclarationExpression.setType(subarrayType);
this.ast.getBindingResolver().updateKey(type, subarrayType);
}
}
else {
variableDeclarationExpression.setType(type);
}
}
else {
variableDeclarationExpression.setType(type);
}
}
|
| ||||
protected void setTypeForVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, Type type, int extraDimension) {
if (extraDimension != 0) {
if (type.isArrayType()) {
ArrayType arrayType = (ArrayType) type;
int remainingDimensions = arrayType.getDimensions() - extraDimension;
if (remainingDimensions == 0) {
// the dimensions are after the name so the type of the fieldDeclaration is a simpleType
Type elementType = arrayType.getElementType();
// cut the child loose from its parent (without creating garbage)
elementType.setParent(null, null);
this.ast.getBindingResolver().updateKey(type, elementType);
variableDeclarationStatement.setType(elementType);
}
else {
int start = type.getStartPosition();
ArrayType subarrayType = arrayType;
int index = extraDimension;
while (index > 0) {
subarrayType = (ArrayType) subarrayType.getComponentType();
index--;
}
int end = retrieveProperRightBracketPosition(remainingDimensions, start);
subarrayType.setSourceRange(start, end - start + 1);
// cut the child loose from its parent (without creating garbage)
subarrayType.setParent(null, null);
updateInnerPositions(subarrayType, remainingDimensions);
variableDeclarationStatement.setType(subarrayType);
this.ast.getBindingResolver().updateKey(type, subarrayType);
}
}
else {
variableDeclarationStatement.setType(type);
}
}
else {
variableDeclarationStatement.setType(type);
}
}
|
| |||
protected void [[#variable52f19a80]]( [[#variableb57ddea0]] [[#variable52f19a20]], Type type, int extraDimension) {
if (extraDimension != 0) {
if (type.isArrayType()) {
ArrayType arrayType = (ArrayType) type;
int remainingDimensions = arrayType.getDimensions() - extraDimension;
if (remainingDimensions == 0) {
// the dimensions are after the name so the type of the fieldDeclaration is a simpleType
Type elementType = arrayType.getElementType();
// cut the child loose from its parent (without creating garbage)
elementType.setParent(null, null);
this.ast.getBindingResolver().updateKey(type, elementType);
[[#variable52f19a20]].setType(elementType);
}
else {
int start = type.getStartPosition();
ArrayType subarrayType = arrayType;
int index = extraDimension;
while (index > 0) {
subarrayType = (ArrayType) subarrayType.getComponentType();
index--;
}
int end = retrieveProperRightBracketPosition(remainingDimensions, start);
subarrayType.setSourceRange(start, end - start + 1);
// cut the child loose from its parent (without creating garbage)
subarrayType.setParent(null, null);
updateInnerPositions(subarrayType, remainingDimensions);
[[#variable52f19a20]].setType(subarrayType);
this.ast.getBindingResolver().updateKey(type, subarrayType);
}
}
else {
[[#variable52f19a20]].setType(type);
}
}
else {
[[#variable52f19a20]].setType(type);
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#52f19a80]] | setTypeForSingleVariableDeclaration |
| 1 | 2 | [[#52f19a80]] | setTypeForVariableDeclarationExpression |
| 1 | 3 | [[#52f19a80]] | setTypeForVariableDeclarationStatement |
| 2 | 1 | [[#b57ddea0]] | SingleVariableDeclaration |
| 2 | 2 | [[#b57ddea0]] | VariableDeclarationExpression |
| 2 | 3 | [[#b57ddea0]] | VariableDeclarationStatement |
| 3 | 1 | [[#52f19a20]] | singleVariableDeclaration |
| 3 | 2 | [[#52f19a20]] | variableDeclarationExpression |
| 3 | 3 | [[#52f19a20]] | variableDeclarationStatement |