CloneSet252


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
38260.988class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13835
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java
23980
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java
Clone Instance
1
Line Count
38
Source Line
35
Source File
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java

public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) {
    IPackageFragmentRoot root = (IPackageFragmentRoot) this.localVariable.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
        String documentPath;
        String relativePath;
    if (root.isArchive()) {
        IType type = (IType) this.localVariable.getAncestor(IJavaElement.TYPE);
        relativePath = (type.getFullyQualifiedName('/')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class;
        documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
    }
    else   {
                IPath path = this.localVariable.getPath();
        documentPath = path.toString();
                relativePath = Util.relativePath(path, 1
                                                        /*remove project segment*/
                                                        );
    }   if (scope instanceof JavaSearchScope) {
                JavaSearchScope javaSearchScope = (JavaSearchScope) scope;
                // Get document path access restriction from java search scope
                // Note that requestor has to verify if needed whether the document violates the access restriction or not
                AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath);
                if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path
                        if ( !requestor.acceptIndexMatch(documentPath, this, participant, access))
                                throw new OperationCanceledException();
                }
        }
        else   if (scope.encloses(documentPath)) {
                if ( !requestor.acceptIndexMatch(documentPath, this, participant, null))
                        throw new OperationCanceledException();
               }
}

protected StringBuffer print(StringBuffer output) {
        if (this.findDeclarations) {
                output.append(this.findReferences ?
                          "LocalVarCombinedPattern: " //$NON-NLS-1$
                              : "LocalVarDeclarationPattern: "); //$NON-NLS-1$
        }
        else   {
                output.append("LocalVarReferencePattern: "); //$NON-NLS-1$
        }
        output.append(this.localVariable.toStringWithAncestors());
        return super.print(output);
}


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

        /*
         * Same than LocalVariablePattern.
         */
        public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) {
            IPackageFragmentRoot root = (IPackageFragmentRoot) this.typeParameter.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
                String documentPath;
                String relativePath;
            if (root.isArchive()) {
                IType type = (IType) this.typeParameter.getAncestor(IJavaElement.TYPE);
            relativePath = (type.getFullyQualifiedName('/')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class;
                documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
            }
            else   {
                        IPath path = this.typeParameter.getPath();
                documentPath = path.toString();
                        relativePath = Util.relativePath(path, 1
                                                                /*remove project segment*/
                                                                );
            }   if (scope instanceof JavaSearchScope) {
                        JavaSearchScope javaSearchScope = (JavaSearchScope) scope;
                        // Get document path access restriction from java search scope
                        // Note that requestor has to verify if needed whether the document violates the access restriction or not
                        AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath);
                        if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path
                                if ( !requestor.acceptIndexMatch(documentPath, this, participant, access))
                                        throw new OperationCanceledException();
                        }
                }
                else   if (scope.encloses(documentPath)) {
                        if ( !requestor.acceptIndexMatch(documentPath, this, participant, null))
                                throw new OperationCanceledException();
                       }
        }

        protected StringBuffer print(StringBuffer output) {
                if (this.findDeclarations) {
                        output.append(this.findReferences ?
                                  "TypeParamCombinedPattern: " //$NON-NLS-1$
                                      : "TypeParamDeclarationPattern: "); //$NON-NLS-1$
                }
                else   {
                        output.append("TypeParamReferencePattern: "); //$NON-NLS-1$
                }
                output.append(typeParameter.toString());
                return super.print(output);
        }


Clone AbstractionParameter Count: 6Parameter Bindings

/*
         * Same than LocalVariablePattern.
         */
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) {
  IPackageFragmentRoot root = (IPackageFragmentRoot) this. [[#variableb4f21820]].getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
  String documentPath;
  String relativePath;
  if (root.isArchive()) {
    IType type = (IType) this. [[#variableb4f21820]].getAncestor(IJavaElement.TYPE);
    relativePath = (type.getFullyQualifiedName('/')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class;
    documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath;
  }
  else {
    IPath path = this. [[#variableb4f21820]].getPath();
    documentPath = path.toString();
    relativePath = Util.relativePath(path, 1
                                            /*remove project segment*/
                                            );
  }
  if (scope instanceof JavaSearchScope) {
    JavaSearchScope javaSearchScope = (JavaSearchScope) scope;
    // Get document path access restriction from java search scope
    // Note that requestor has to verify if needed whether the document violates the access restriction or not
    AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath);
    if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path
      if ( !requestor.acceptIndexMatch(documentPath, this, participant, access))
        throw new OperationCanceledException();
    }
  }
  else
    if (scope.encloses(documentPath)) {
      if ( !requestor.acceptIndexMatch(documentPath, this, participant, null))
        throw new OperationCanceledException();
    }
}

protected StringBuffer print(StringBuffer output) {
  if (this.findDeclarations) {
    output.append(this.findReferences ? [[#variableb4f21740]]: [[#variableb4f21700]]); //$NON-NLS-1$
  }
  else {
    output.append( [[#variableb42528c0]]); //$NON-NLS-1$
  }
  output.append( [[#variableb4252900]]. [[#variableb4f216c0]]());
  return super.print(output);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b4f21820]]
localVariable 
12[[#b4f21820]]
typeParameter 
21[[#b4f21740]]
"LocalVarCombinedPattern: " //$NON-NLS-1$ 
22[[#b4f21740]]
"TypeParamCombinedPattern: " //$NON-NLS-1$ 
31[[#b4f21700]]
"LocalVarDeclarationPattern: " 
32[[#b4f21700]]
"TypeParamDeclarationPattern: " 
41[[#b42528c0]]
"LocalVarReferencePattern: " 
42[[#b42528c0]]
"TypeParamReferencePattern: " 
51[[#b4252900]]
this.localVariable 
52[[#b4252900]]
typeParameter 
61[[#b4f216c0]]
toStringWithAncestors 
62[[#b4f216c0]]
toString