| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 38 | 2 | 6 | 0.988 | class_body_declarations[2] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 38 | 35 | plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java |
| 2 | 39 | 80 | plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.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);
}
|
| ||||
/*
* 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);
}
|
| |||
/*
* 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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b4f21820]] | localVariable |
| 1 | 2 | [[#b4f21820]] | typeParameter |
| 2 | 1 | [[#b4f21740]] | "LocalVarCombinedPattern: " //$NON-NLS-1$ |
| 2 | 2 | [[#b4f21740]] | "TypeParamCombinedPattern: " //$NON-NLS-1$ |
| 3 | 1 | [[#b4f21700]] | "LocalVarDeclarationPattern: " |
| 3 | 2 | [[#b4f21700]] | "TypeParamDeclarationPattern: " |
| 4 | 1 | [[#b42528c0]] | "LocalVarReferencePattern: " |
| 4 | 2 | [[#b42528c0]] | "TypeParamReferencePattern: " |
| 5 | 1 | [[#b4252900]] | this.localVariable |
| 5 | 2 | [[#b4252900]] | typeParameter |
| 6 | 1 | [[#b4f216c0]] | toStringWithAncestors |
| 6 | 2 | [[#b4f216c0]] | toString |