CloneSet349


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
39220.960statement_sequence[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
139395
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
239440
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java
Clone Instance
1
Line Count
39
Source Line
395
Source File
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java

        if (typeBinding instanceof ProblemReferenceBinding) {
                ProblemReferenceBinding pbBinding = (ProblemReferenceBinding) typeBinding;
                typeBinding = pbBinding.closestMatch;
                lastIndex = pbBinding.compoundName.length - 1;
        }

        // Create search match to report
        if (this.match == null) {
                this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, qNameRef);
        }

        // try to match all enclosing types for which the token matches as well.
        if (typeBinding instanceof ReferenceBinding) {
                ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
                while (refBinding != null && lastIndex >= 0) {
                        if (resolveLevelForType(refBinding) == ACCURATE_MATCH) {
                                if (locator.encloses(element)) {
                                        long[] positions = qNameRef.sourcePositions;
                                        // index now depends on pattern type signature
                                        int index = lastIndex;
                                        if (this.pattern.qualification != null) {
                                                index = lastIndex - this.pattern.segmentsSize;
                                        }
                                        if (index < 0) index = 0;
                                        int start = (int) ((positions[index]) >>> 32);
                                        int end = (int) positions[lastIndex];
                                        match.setOffset(start);
                                        match.setLength(end - start + 1);

                                        //  Look if there's a need to special report for parameterized type
                                        matchReportReference(qNameRef, lastIndex, refBinding, locator);
                                }
                                return;
                        }
                        lastIndex--;
                        refBinding = refBinding.enclosingType();
                }
        }
        locator.reportAccurateTypeReference(match, qNameRef, this.pattern.simpleName);


Clone Instance
2
Line Count
39
Source Line
440
Source File
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java

        if (typeBinding instanceof ProblemReferenceBinding) {
                ProblemReferenceBinding pbBinding = (ProblemReferenceBinding) typeBinding;
                typeBinding = pbBinding.closestMatch;
                lastIndex = pbBinding.compoundName.length - 1;
        }

        // Create search match to report
        if (this.match == null) {
                this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, qTypeRef);
        }

        // try to match all enclosing types for which the token matches as well
        if (typeBinding instanceof ReferenceBinding) {
                ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
                while (refBinding != null && lastIndex >= 0) {
                        if (resolveLevelForType(refBinding) != IMPOSSIBLE_MATCH) {
                                if (locator.encloses(element)) {
                                        long[] positions = qTypeRef.sourcePositions;
                                        // index now depends on pattern type signature
                                        int index = lastIndex;
                                        if (this.pattern.qualification != null) {
                                                index = lastIndex - this.pattern.segmentsSize;
                                        }
                                        if (index < 0) index = 0;
                                        int start = (int) ((positions[index]) >>> 32);
                                        int end = (int) positions[lastIndex];
                                        match.setOffset(start);
                                        match.setLength(end - start + 1);

                                        //  Look if there's a need to special report for parameterized type
                                        matchReportReference(qTypeRef, lastIndex, refBinding, locator);
                                }
                                return;
                        }
                        lastIndex--;
                        refBinding = refBinding.enclosingType();
                }
        }
        locator.reportAccurateTypeReference(match, qTypeRef, this.pattern.simpleName);


Clone AbstractionParameter Count: 2Parameter Bindings

if (typeBinding instanceof ProblemReferenceBinding) {
  ProblemReferenceBinding pbBinding = (ProblemReferenceBinding) typeBinding;
  typeBinding = pbBinding.closestMatch;
  lastIndex = pbBinding.compoundName.length - 1;
}
// Create search match to report
if (this.match == null) {
  this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy,  [[#variableb37c46a0]]);
}
// try to match all enclosing types for which the token matches as well
// try to match all enclosing types for which the token matches as well.
if (typeBinding instanceof ReferenceBinding) {
  ReferenceBinding refBinding = (ReferenceBinding) typeBinding;
  while (refBinding != null && lastIndex >= 0) {
    if ( [[#variableb112a4c0]]) {
      if (locator.encloses(element)) {
        long[] positions = [[#variableb37c46a0]].sourcePositions;
        // index now depends on pattern type signature
        int index = lastIndex;
        if (this.pattern.qualification != null) {
          index = lastIndex - this.pattern.segmentsSize;
        }
        if (index < 0)
          index = 0;
        int start = (int) ((positions[index]) >>> 32);
        int end = (int) positions[lastIndex];
        match.setOffset(start);
        match.setLength(end - start + 1);
        //  Look if there's a need to special report for parameterized type
        matchReportReference( [[#variableb37c46a0]], lastIndex, refBinding, locator);
      }
      return;
    }
    lastIndex--;
    refBinding = refBinding.enclosingType();
  }
}
locator.reportAccurateTypeReference(match,  [[#variableb37c46a0]], this.pattern.simpleName);
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b37c46a0]]
qTypeRef 
12[[#b37c46a0]]
qNameRef 
21[[#b112a4c0]]
resolveLevelForType(refBinding) != IMPOSSIBLE_MATCH 
22[[#b112a4c0]]
resolveLevelForType(refBinding) == ACCURATE_MATCH