CloneSet294


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
41220.957statement_sequence[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
14077
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
241166
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java
Clone Instance
1
Line Count
40
Source Line
77
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java

                do {
                        check:  {
                                needRename = false;
                                // check for collision with known methods
                                long range;
                                MethodBinding[] methods = declaringSourceType.methods();
                                if ((range = ReferenceBinding.binarySearch(this.selector, methods)) >= 0) {
                                        int paramCount = this.parameters.length;
                                        nextMethod: for (int imethod = (int) range,end = (int) (range >> 32); imethod <= end; imethod++) {
                                                MethodBinding method = methods[imethod];
                                                if (method.parameters.length == paramCount) {
                                                        TypeBinding[] toMatch = method.parameters;
                                                        for (int i = 0; i < paramCount; i++) {
                                                                if (toMatch[i] != this.parameters[i]) {
                                                                        continue nextMethod;
                                                                }
                                                        }
                                                        needRename = true;
                                                        break check;
                                                }
                                                    }
                                }
                                // check for collision with synthetic accessors
                                if (knownAccessMethods != null) {
                                        for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
                                                if (knownAccessMethods[i] == null) continue ;
                                                if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && this.areParametersEqual(methods[i])) {
                                                        needRename = true;
                                                        break check;
                                                }
                                        }
                                }
                        }
                        if (needRename) { // retry with a selector postfixed by a growing methodId
                                this.setSelector(CharOperation.concat(TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX, String.valueOf( ++methodId).toCharArray()));
                        }
                }
                while (  needRename);
                // retrieve sourceStart position for the target field for line number attributes
                FieldDeclaration[] fieldDecls = declaringSourceType.scope.referenceContext.fields;


Clone Instance
2
Line Count
41
Source Line
166
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java

                do {
                        check:  {
                                needRename = false;
                                // check for collision with known methods
                                long range;
                                MethodBinding[] methods = declaringSourceType.methods();
                                if ((range = ReferenceBinding.binarySearch(this.selector, methods)) >= 0) {
                                        int paramCount = this.parameters.length;
                                        nextMethod: for (int imethod = (int) range,end = (int) (range >> 32); imethod <= end; imethod++) {
                                                MethodBinding method = methods[imethod];
                                                if (method.parameters.length == paramCount) {
                                                        TypeBinding[] toMatch = method.parameters;
                                                        for (int i = 0; i < paramCount; i++) {
                                                                if (toMatch[i] != this.parameters[i]) {
                                                                        continue nextMethod;
                                                                }
                                                        }
                                                        needRename = true;
                                                        break check;
                                                }
                                                    }
                                }
                                // check for collision with synthetic accessors
                                if (knownAccessMethods != null) {
                                        for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
                                                if (knownAccessMethods[i] == null) continue ;
                                                if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && this.areParametersEqual(methods[i])) {
                                                        needRename = true;
                                                        break check;
                                                }
                                        }
                                }
                        }
                        if (needRename) { // retry with a selector postfixed by a growing methodId
                                this.setSelector(CharOperation.concat(selector, String.valueOf( ++methodId).toCharArray()));
                        }
                }
                while (  needRename);
                // We now at this point - per construction - it is for sure an enclosing instance, we are going to
                // show the target field type declaration location.
                this.sourceStart = declaringSourceType.scope.referenceContext.sourceStart; // use the target declaring class name position instead


Clone AbstractionParameter Count: 2Parameter Bindings

do {
  check: {
    needRename = false;
    // check for collision with known methods
    long range;
    MethodBinding[] methods = declaringSourceType.methods();
    if ((range = ReferenceBinding.binarySearch(this.selector, methods)) >= 0) {
      int paramCount = this.parameters.length;
      nextMethod:
        for (int imethod = (int) range, end = (int) (range >> 32); imethod <= end; imethod++) {
          MethodBinding method = methods[imethod];
          if (method.parameters.length == paramCount) {
            TypeBinding[] toMatch = method.parameters;
            for (int i = 0; i < paramCount; i++) {
              if (toMatch[i] != this.parameters[i]) {
                continue nextMethod;
              }
            }
            needRename = true;
            break check;
          }
        }
    }
    // check for collision with synthetic accessors
    if (knownAccessMethods != null) {
      for (int i = 0, length = knownAccessMethods.length; i < length; i++) {
        if (knownAccessMethods[i] == null)
          continue ;
        if (CharOperation.equals(this.selector, knownAccessMethods[i].selector) && this.areParametersEqual(methods[i])) {
          needRename = true;
          break check;
        }
      }
    }
  }
  if (needRename) { // retry with a selector postfixed by a growing methodId
    this.setSelector(CharOperation.concat( [[#variableb9f695c0]], String.valueOf( ++methodId).toCharArray()));
  }
}
while (needRename);
 [[#variableb9fb5020]]
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b9f695c0]]
selector 
12[[#b9f695c0]]
TypeConstants.SYNTHETIC_ACCESS_METHOD_PREFIX 
21[[#b9fb5020]]
// We now at this point - per construction - it is for sure an enclosing instance, we are going to
// show the target field type declaration location.
this.sourceStart = declaringSourceType.scope.referenceContext.sourceStart; // use the target declaring class name position instead 
22[[#b9fb5020]]
// retrieve sourceStart position for the target field for line number attributes
FieldDeclaration[] fieldDecls = declaringSourceType.scope.referenceContext.fields;