CloneSet148


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
62220.994statement_sequence[9]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
162127
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
262266
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java
Clone Instance
1
Line Count
62
Source Line
127
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java

                org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = typeDeclaration.fields;
                org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = typeDeclaration.methods;

                int fieldsLength = fields == null ? 0: fields.length;
                int methodsLength = methods == null ? 0: methods.length;
                int membersLength = members == null ? 0:  members.length;
                int fieldsIndex = 0;
                int methodsIndex = 0;
                int membersIndex = 0;

                while ((fieldsIndex < fieldsLength) ||
                           (membersIndex < membersLength) ||
                           (methodsIndex < methodsLength)) {
                        org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;
                        org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;
                        org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;

                        int position = Integer.MAX_VALUE;
                        int nextDeclarationType = -1;
                        if (fieldsIndex < fieldsLength) {
                                nextFieldDeclaration = fields[fieldsIndex];
                                if (nextFieldDeclaration.declarationSourceStart < position) {
                                        position = nextFieldDeclaration.declarationSourceStart;
                                        nextDeclarationType = 0; // FIELD
                                }
                        }
                        if (methodsIndex < methodsLength) {
                                nextMethodDeclaration = methods[methodsIndex];
                                if (nextMethodDeclaration.declarationSourceStart < position) {
                                        position = nextMethodDeclaration.declarationSourceStart;
                                        nextDeclarationType = 1; // METHOD
                                }
                        }
                        if (membersIndex < membersLength) {
                                nextMemberDeclaration = members[membersIndex];
                                if (nextMemberDeclaration.declarationSourceStart < position) {
                                        position = nextMemberDeclaration.declarationSourceStart;
                                        nextDeclarationType = 2; // MEMBER
                                }
                        }
                        switch (nextDeclarationType) {
                                case 0:
                                        if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
                                                typeDecl.bodyDeclarations().add(convert(nextFieldDeclaration));
                                        }
                                        else   {
                                                checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, typeDecl.bodyDeclarations());
                                        }
                                        fieldsIndex++;
                                        break;
                                case 1:
                                        methodsIndex++;
                                        if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {
                                                typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration));
                                        }
                                        break;
                                case 2:
                                        membersIndex++;
                                        ASTNode node = convert(nextMemberDeclaration);
                                        if (node == null) {
                                                typeDecl.setFlags(typeDecl.getFlags()|  ASTNode.MALFORMED);
                                        }
                                        else   {
                                                typeDecl.bodyDeclarations().add(node);
                                        }
                              }
                }


Clone Instance
2
Line Count
62
Source Line
266
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java

                org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = expression.fields;
                org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = expression.methods;

                int fieldsLength = fields == null ? 0: fields.length;
                int methodsLength = methods == null ? 0: methods.length;
                int membersLength = members == null ? 0:  members.length;
                int fieldsIndex = 0;
                int methodsIndex = 0;
                int membersIndex = 0;

                while ((fieldsIndex < fieldsLength) ||
                           (membersIndex < membersLength) ||
                           (methodsIndex < methodsLength)) {
                        org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;
                        org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;
                        org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;

                        int position = Integer.MAX_VALUE;
                        int nextDeclarationType = -1;
                        if (fieldsIndex < fieldsLength) {
                                nextFieldDeclaration = fields[fieldsIndex];
                                if (nextFieldDeclaration.declarationSourceStart < position) {
                                        position = nextFieldDeclaration.declarationSourceStart;
                                        nextDeclarationType = 0; // FIELD
                                }
                        }
                        if (methodsIndex < methodsLength) {
                                nextMethodDeclaration = methods[methodsIndex];
                                if (nextMethodDeclaration.declarationSourceStart < position) {
                                        position = nextMethodDeclaration.declarationSourceStart;
                                        nextDeclarationType = 1; // METHOD
                                }
                        }
                        if (membersIndex < membersLength) {
                                nextMemberDeclaration = members[membersIndex];
                                if (nextMemberDeclaration.declarationSourceStart < position) {
                                        position = nextMemberDeclaration.declarationSourceStart;
                                        nextDeclarationType = 2; // MEMBER
                                }
                        }
                        switch (nextDeclarationType) {
                                case 0:
                                        if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
                                                anonymousClassDeclaration.bodyDeclarations().add(convert(nextFieldDeclaration));
                                        }
                                        else   {
                                                checkAndAddMultipleFieldDeclaration(fields, fieldsIndex, anonymousClassDeclaration.bodyDeclarations());
                                        }
                                        fieldsIndex++;
                                        break;
                                case 1:
                                        methodsIndex++;
                                        if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {
                                                anonymousClassDeclaration.bodyDeclarations().add(convert(nextMethodDeclaration));
                                        }
                                        break;
                                case 2:
                                        membersIndex++;
                                        ASTNode node = convert(nextMemberDeclaration);
                                        if (node == null) {
                                                anonymousClassDeclaration.setFlags(anonymousClassDeclaration.getFlags()|  ASTNode.MALFORMED);
                                        }
                                        else   {
                                                anonymousClassDeclaration.bodyDeclarations().add(node);
                                        }
                              }
                }


Clone AbstractionParameter Count: 2Parameter Bindings

org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = [[#variable54d712c0]].fields;
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = [[#variable54d712c0]].methods;
int fieldsLength = fields == null ? 0: fields.length;
int methodsLength = methods == null ? 0: methods.length;
int membersLength = members == null ? 0: members.length;
int fieldsIndex = 0;
int methodsIndex = 0;
int membersIndex = 0;
while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) {
  org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null;
  org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null;
  org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null;
  int position = Integer.MAX_VALUE;
  int nextDeclarationType = -1;
  if (fieldsIndex < fieldsLength) {
    nextFieldDeclaration = fields[fieldsIndex];
    if (nextFieldDeclaration.declarationSourceStart < position) {
      position = nextFieldDeclaration.declarationSourceStart;
      nextDeclarationType = 0; // FIELD
    }
  }
  if (methodsIndex < methodsLength) {
    nextMethodDeclaration = methods[methodsIndex];
    if (nextMethodDeclaration.declarationSourceStart < position) {
      position = nextMethodDeclaration.declarationSourceStart;
      nextDeclarationType = 1; // METHOD
    }
  }
  if (membersIndex < membersLength) {
    nextMemberDeclaration = members[membersIndex];
    if (nextMemberDeclaration.declarationSourceStart < position) {
      position = nextMemberDeclaration.declarationSourceStart;
      nextDeclarationType = 2; // MEMBER
    }
  }
  switch (nextDeclarationType) {
    case 0:
      if (nextFieldDeclaration.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
         [[#variable54d71220]].bodyDeclarations().add(convert(nextFieldDeclaration));
      }
      else {
        checkAndAddMultipleFieldDeclaration(fields, fieldsIndex,  [[#variable54d71220]].bodyDeclarations());
      }
      fieldsIndex++;
      break;
    case 1:
      methodsIndex++;
      if ( !nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {
         [[#variable54d71220]].bodyDeclarations().add(convert(nextMethodDeclaration));
      }
      break;
    case 2:
      membersIndex++;
      ASTNode node = convert(nextMemberDeclaration);
      if (node == null) {
         [[#variable54d71220]].setFlags( [[#variable54d71220]].getFlags()|ASTNode.MALFORMED);
      }
      else {
         [[#variable54d71220]].bodyDeclarations().add(node);
      }
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#54d712c0]]
typeDeclaration 
12[[#54d712c0]]
expression 
21[[#54d71220]]
typeDecl 
22[[#54d71220]]
anonymousClassDeclaration