CloneSet598


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
42230.988class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
142125
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
226171
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java
Clone Instance
1
Line Count
42
Source Line
125
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java

/*
 * Record a local declaration - regular method should have been created a block body
 */
public RecoveredElement add(LocalDeclaration localDeclaration, int bracketBalanceValue) {

        /* local variables inside method can only be final and non void */
/*      
        char[][] localTypeName; 
        if ((localDeclaration.modifiers & ~AccFinal) != 0 // local var can only be final 
                || (localDeclaration.type == null) // initializer
                || ((localTypeName = localDeclaration.type.getTypeName()).length == 1 // non void
                        && CharOperation.equals(localTypeName[0], VoidBinding.sourceName()))){ 

                if (this.parent == null){
                        return this; // ignore
                } else {
                        this.updateSourceEndIfNecessary(this.previousAvailableLineEnd(localDeclaration.declarationSourceStart - 1));
                        return this.parent.add(localDeclaration, bracketBalance);
                }
        }
*/
        /* do not consider a type starting passed the type end (if set)
                it must be belonging to an enclosing type */
        if (methodDeclaration.declarationSourceEnd != 0 &&
                   localDeclaration.declarationSourceStart > methodDeclaration.declarationSourceEnd) {

                if (this.parent == null) {
                        return this ; // ignore
                }
                else   {
                        return this.parent.add(localDeclaration, bracketBalanceValue);
                }
        }
        if (methodBody == null) {
                Block block = new Block(0);
                block.sourceStart = methodDeclaration.bodyStart;
                RecoveredElement currentBlock = this.add(block, 1);
                if (this.bracketBalance > 0) {
                        for (int i = 0; i < this.bracketBalance - 1; i++) {
                                currentBlock = currentBlock.add(new Block(0), 1);
                        }
                        this.bracketBalance = 1;
                }
                return currentBlock.add(localDeclaration, bracketBalanceValue);
        }
        return methodBody.add(localDeclaration, bracketBalanceValue, true);
}


Clone Instance
2
Line Count
26
Source Line
171
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java

/*
 * Record a statement - regular method should have been created a block body
 */
public RecoveredElement add(Statement statement, int bracketBalanceValue) {

        /* do not consider a type starting passed the type end (if set)
                it must be belonging to an enclosing type */
        if (methodDeclaration.declarationSourceEnd != 0 &&
                   statement.sourceStart > methodDeclaration.declarationSourceEnd) {

                if (this.parent == null) {
                        return this ; // ignore
                }
                else   {
                        return this.parent.add(statement, bracketBalanceValue);
                }
        }
        if (methodBody == null) {
                Block block = new Block(0);
                block.sourceStart = methodDeclaration.bodyStart;
                RecoveredElement currentBlock = this.add(block, 1);
                if (this.bracketBalance > 0) {
                        for (int i = 0; i < this.bracketBalance - 1; i++) {
                                currentBlock = currentBlock.add(new Block(0), 1);
                        }
                        this.bracketBalance = 1;
                }
                return currentBlock.add(statement, bracketBalanceValue);
        }
        return methodBody.add(statement, bracketBalanceValue, true);
}


Clone AbstractionParameter Count: 3Parameter Bindings

/*
 * Record a local declaration - regular method should have been created a block body
 */
/*
 * Record a statement - regular method should have been created a block body
 */
public RecoveredElement add( [[#variableb82a81c0]]  [[#variableb728a160]], int bracketBalanceValue) {
  /* local variables inside method can only be final and non void */
  /*      
          char[][] localTypeName; 
          if ((localDeclaration.modifiers & ~AccFinal) != 0 // local var can only be final 
                  || (localDeclaration.type == null) // initializer
                  || ((localTypeName = localDeclaration.type.getTypeName()).length == 1 // non void
                          && CharOperation.equals(localTypeName[0], VoidBinding.sourceName()))){ 

                  if (this.parent == null){
                          return this; // ignore
                  } else {
                          this.updateSourceEndIfNecessary(this.previousAvailableLineEnd(localDeclaration.declarationSourceStart - 1));
                          return this.parent.add(localDeclaration, bracketBalance);
                  }
          }
  */
  /* do not consider a type starting passed the type end (if set)
                  it must be belonging to an enclosing type */
  if (methodDeclaration.declarationSourceEnd != 0 && [[#variableb728a160]]. [[#variableb82a8280]] > methodDeclaration.declarationSourceEnd) {
    if (this.parent == null) {
      return this ; // ignore
    }
    else {
      return this.parent.add( [[#variableb728a160]], bracketBalanceValue);
    }
  }
  if (methodBody == null) {
    Block block = new Block(0);
    block.sourceStart = methodDeclaration.bodyStart;
    RecoveredElement currentBlock = this.add(block, 1);
    if (this.bracketBalance > 0) {
      for (int i = 0; i < this.bracketBalance - 1; i++) {
        currentBlock = currentBlock.add(new Block(0), 1);
      }
      this.bracketBalance = 1;
    }
    return currentBlock.add( [[#variableb728a160]], bracketBalanceValue);
  }
  return methodBody.add( [[#variableb728a160]], bracketBalanceValue, true);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b82a81c0]]
LocalDeclaration 
12[[#b82a81c0]]
Statement 
21[[#b728a160]]
localDeclaration 
22[[#b728a160]]
statement 
31[[#b82a8280]]
declarationSourceStart 
32[[#b82a8280]]
sourceStart