Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
38 | 2 | 2 | 0.997 | statement_sequence[6] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 38 | 60 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java |
2 | 38 | 110 | plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java |
| ||||
VariableDeclarationFragment lastFragment = (VariableDeclarationFragment) iter.next(); ASTNode lastStatement = declarationNode; int orginalModifiers = declarationNode.getModifiers(); if (fragmentsToChange.contains(lastFragment)) { ListRewrite modifierRewrite = rewrite.getListRewrite(declarationNode, FieldDeclaration.MODIFIERS2_PROPERTY); for (Iterator iterator = declarationNode.modifiers().iterator(); iterator.hasNext();) { ASTNode node = (ASTNode) iterator.next(); modifierRewrite.remove(node, group); } List newModifiers = ast.newModifiers((orginalModifiers& ~excludedModifiers)| includedModifiers); for (Iterator iterator = newModifiers.iterator(); iterator.hasNext();) { modifierRewrite.insertLast((ASTNode) iterator.next(), group); } } ListRewrite fragmentsRewrite = null; while (iter.hasNext()) { VariableDeclarationFragment currentFragment = (VariableDeclarationFragment) iter.next(); if (fragmentsToChange.contains(lastFragment) != fragmentsToChange.contains(currentFragment)) { FieldDeclaration newStatement = ast.newFieldDeclaration((VariableDeclarationFragment) rewrite.createMoveTarget(currentFragment)); newStatement.setType((Type) rewrite.createCopyTarget(declarationNode.getType())); if (fragmentsToChange.contains(currentFragment)) { newStatement.modifiers().addAll(ast.newModifiers((orginalModifiers& ~excludedModifiers)| includedModifiers)); } else { newStatement.modifiers().addAll(ast.newModifiers(orginalModifiers)); } blockRewrite.insertAfter(newStatement, lastStatement, group); fragmentsRewrite = rewrite.getListRewrite(newStatement, FieldDeclaration.FRAGMENTS_PROPERTY); lastStatement = newStatement; } else if (fragmentsRewrite != null) { ASTNode fragment0 = rewrite.createMoveTarget(currentFragment); fragmentsRewrite.insertLast(fragment0, group); } lastFragment = currentFragment; } |
| ||||
VariableDeclarationFragment lastFragment = (VariableDeclarationFragment) iter.next(); ASTNode lastStatement = declarationNode; int orginalModifiers = declarationNode.getModifiers(); if (fragmentsToChange.contains(lastFragment)) { ListRewrite modifierRewrite = rewrite.getListRewrite(declarationNode, VariableDeclarationStatement.MODIFIERS2_PROPERTY); for (Iterator iterator = declarationNode.modifiers().iterator(); iterator.hasNext();) { ASTNode node = (ASTNode) iterator.next(); modifierRewrite.remove(node, group); } List newModifiers = ast.newModifiers((orginalModifiers& ~excludedModifiers)| includedModifiers); for (Iterator iterator = newModifiers.iterator(); iterator.hasNext();) { modifierRewrite.insertLast((ASTNode) iterator.next(), group); } } ListRewrite fragmentsRewrite = null; while (iter.hasNext()) { VariableDeclarationFragment currentFragment = (VariableDeclarationFragment) iter.next(); if (fragmentsToChange.contains(lastFragment) != fragmentsToChange.contains(currentFragment)) { VariableDeclarationStatement newStatement = ast.newVariableDeclarationStatement((VariableDeclarationFragment) rewrite.createMoveTarget(currentFragment)); newStatement.setType((Type) rewrite.createCopyTarget(declarationNode.getType())); if (fragmentsToChange.contains(currentFragment)) { newStatement.modifiers().addAll(ast.newModifiers((orginalModifiers& ~excludedModifiers)| includedModifiers)); } else { newStatement.modifiers().addAll(ast.newModifiers(orginalModifiers)); } blockRewrite.insertAfter(newStatement, lastStatement, group); fragmentsRewrite = rewrite.getListRewrite(newStatement, VariableDeclarationStatement.FRAGMENTS_PROPERTY); lastStatement = newStatement; } else if (fragmentsRewrite != null) { ASTNode fragment0 = rewrite.createMoveTarget(currentFragment); fragmentsRewrite.insertLast(fragment0, group); } lastFragment = currentFragment; } |
| |||
VariableDeclarationFragment lastFragment = (VariableDeclarationFragment) iter.next(); ASTNode lastStatement = declarationNode; int orginalModifiers = declarationNode.getModifiers(); if (fragmentsToChange.contains(lastFragment)) { ListRewrite modifierRewrite = rewrite.getListRewrite(declarationNode, [[#variable64199a20]].MODIFIERS2_PROPERTY); for (Iterator iterator = declarationNode.modifiers().iterator(); iterator.hasNext();) { ASTNode node = (ASTNode) iterator.next(); modifierRewrite.remove(node, group); } List newModifiers = ast.newModifiers((orginalModifiers& ~excludedModifiers)|includedModifiers); for (Iterator iterator = newModifiers.iterator(); iterator.hasNext();) { modifierRewrite.insertLast((ASTNode) iterator.next(), group); } } ListRewrite fragmentsRewrite = null; while (iter.hasNext()) { VariableDeclarationFragment currentFragment = (VariableDeclarationFragment) iter.next(); if (fragmentsToChange.contains(lastFragment) != fragmentsToChange.contains(currentFragment)) { [[#variable64199a20]] newStatement = ast. [[#variablebd72d660]]((VariableDeclarationFragment) rewrite.createMoveTarget(currentFragment)); newStatement.setType((Type) rewrite.createCopyTarget(declarationNode.getType())); if (fragmentsToChange.contains(currentFragment)) { newStatement.modifiers().addAll(ast.newModifiers((orginalModifiers& ~excludedModifiers)|includedModifiers)); } else { newStatement.modifiers().addAll(ast.newModifiers(orginalModifiers)); } blockRewrite.insertAfter(newStatement, lastStatement, group); fragmentsRewrite = rewrite.getListRewrite(newStatement, [[#variable64199a20]].FRAGMENTS_PROPERTY); lastStatement = newStatement; } else if (fragmentsRewrite != null) { ASTNode fragment0 = rewrite.createMoveTarget(currentFragment); fragmentsRewrite.insertLast(fragment0, group); } lastFragment = currentFragment; } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#64199a20]] | VariableDeclarationStatement |
1 | 2 | [[#64199a20]] | FieldDeclaration |
2 | 1 | [[#bd72d660]] | newVariableDeclarationStatement |
2 | 2 | [[#bd72d660]] | newFieldDeclaration |