CloneSet188


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
38220.997statement_sequence[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13860
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java
238110
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/VariableDeclarationRewrite.java
Clone Instance
1
Line Count
38
Source Line
60
Source File
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;
                }


Clone Instance
2
Line Count
38
Source Line
110
Source File
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, 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;
                }


Clone AbstractionParameter Count: 2Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#64199a20]]
VariableDeclarationStatement 
12[[#64199a20]]
FieldDeclaration 
21[[#bd72d660]]
newVariableDeclarationStatement 
22[[#bd72d660]]
newFieldDeclaration