CloneSet129


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
27360.974class_body_declarations[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12747
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java
22778
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java
327109
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java
Clone Instance
1
Line Count
27
Source Line
47
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java

        //----- referenced types -
        public static IType[] getTypesReferencedIn(IJavaElement[] elements, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getTypeReferencesIn(elements, null, pm);
                Set referencedTypes = extractElements(results, IJavaElement.TYPE);
                return (IType[]) referencedTypes.toArray(new IType[referencedTypes.size()]);
        }

        public static IType[] getTypesReferencedIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getTypeReferencesIn(elements, owner, pm);
                Set referencedTypes = extractElements(results, IJavaElement.TYPE);
                return (IType[]) referencedTypes.toArray(new IType[referencedTypes.size()]);
        }

        private static SearchMatch[] getTypeReferencesIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                List referencedTypes = new ArrayList();
                pm.beginTask("", elements.length); //$NON-NLS-1$
                for (int i = 0; i < elements.length; i++) {
                        referencedTypes.addAll(getTypeReferencesIn(elements[i], owner, new SubProgressMonitor(pm, 1)));
                }
                pm.done();
                return (SearchMatch[]) referencedTypes.toArray(new SearchMatch[referencedTypes.size()]);
        }

        private static List getTypeReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                CollectingSearchRequestor requestor = new CollectingSearchRequestor();
                SearchEngine engine = owner != null ? new SearchEngine(owner):  new SearchEngine();
                engine.searchDeclarationsOfReferencedTypes(element, requestor, pm);
                return requestor.getResults();
        }


Clone Instance
2
Line Count
27
Source Line
78
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java

        //----- referenced fields ----
        public static IField[] getFieldsReferencedIn(IJavaElement[] elements, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getFieldReferencesIn(elements, null, pm);
                Set referencedFields = extractElements(results, IJavaElement.FIELD);
                return (IField[]) referencedFields.toArray(new IField[referencedFields.size()]);
        }

        public static IField[] getFieldsReferencedIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getFieldReferencesIn(elements, owner, pm);
                Set referencedFields = extractElements(results, IJavaElement.FIELD);
                return (IField[]) referencedFields.toArray(new IField[referencedFields.size()]);
        }

        private static SearchMatch[] getFieldReferencesIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                List referencedFields = new ArrayList();
                pm.beginTask("", elements.length); //$NON-NLS-1$
                for (int i = 0; i < elements.length; i++) {
                        referencedFields.addAll(getFieldReferencesIn(elements[i], owner, new SubProgressMonitor(pm, 1)));
                }
                pm.done();
                return (SearchMatch[]) referencedFields.toArray(new SearchMatch[referencedFields.size()]);
        }

        private static List getFieldReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                CollectingSearchRequestor requestor = new CollectingSearchRequestor();
                SearchEngine engine = owner != null ? new SearchEngine(owner):  new SearchEngine();
                engine.searchDeclarationsOfAccessedFields(element, requestor, pm);
                return requestor.getResults();
        }


Clone Instance
3
Line Count
27
Source Line
109
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ReferenceFinderUtil.java

        //----- referenced methods ----
        public static IMethod[] getMethodsReferencedIn(IJavaElement[] elements, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getMethodReferencesIn(elements, null, pm);
                Set referencedMethods = extractElements(results, IJavaElement.METHOD);
                return (IMethod[]) referencedMethods.toArray(new IMethod[referencedMethods.size()]);
        }

        public static IMethod[] getMethodsReferencedIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                SearchMatch[] results = getMethodReferencesIn(elements, owner, pm);
                Set referencedMethods = extractElements(results, IJavaElement.METHOD);
                return (IMethod[]) referencedMethods.toArray(new IMethod[referencedMethods.size()]);
        }

        private static SearchMatch[] getMethodReferencesIn(IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                List referencedMethods = new ArrayList();
                pm.beginTask("", elements.length); //$NON-NLS-1$
                for (int i = 0; i < elements.length; i++) {
                        referencedMethods.addAll(getMethodReferencesIn(elements[i], owner, new SubProgressMonitor(pm, 1)));
                }
                pm.done();
                return (SearchMatch[]) referencedMethods.toArray(new SearchMatch[referencedMethods.size()]);
        }

        private static List getMethodReferencesIn(IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
                CollectingSearchRequestor requestor = new CollectingSearchRequestor();
                SearchEngine engine = owner != null ? new SearchEngine(owner):  new SearchEngine();
                engine.searchDeclarationsOfSentMessages(element, requestor, pm);
                return requestor.getResults();
        }


Clone AbstractionParameter Count: 6Parameter Bindings

//----- referenced methods ----
//----- referenced fields ----
//----- referenced types -
public static [[#variableb688cea0]][]  [[#variableb688ce20]](IJavaElement[] elements, IProgressMonitor pm) throws JavaModelException {
  SearchMatch[] results = [[#variableb688cd40]](elements, null, pm);
  Set  [[#variableb688cbc0]]= extractElements(results, IJavaElement. [[#variableb688ccc0]]);
  return ( [[#variableb688cea0]][])  [[#variableb688cbc0]].toArray(new [[#variableb688cea0]][ [[#variableb688cbc0]].size()]);
}

public static [[#variableb688cea0]][]  [[#variableb688ce20]](IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
  SearchMatch[] results = [[#variableb688cd40]](elements, owner, pm);
  Set  [[#variableb688cbc0]]= extractElements(results, IJavaElement. [[#variableb688ccc0]]);
  return ( [[#variableb688cea0]][])  [[#variableb688cbc0]].toArray(new [[#variableb688cea0]][ [[#variableb688cbc0]].size()]);
}

private static SearchMatch[]  [[#variableb688cd40]](IJavaElement[] elements, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
  List  [[#variableb688cbc0]]= new ArrayList();
  pm.beginTask("", elements.length); //$NON-NLS-1$
  for (int i = 0; i < elements.length; i++) {
     [[#variableb688cbc0]].addAll( [[#variableb688cd40]](elements[i], owner, new SubProgressMonitor(pm, 1)));
  }
  pm.done();
  return (SearchMatch[])  [[#variableb688cbc0]].toArray(new SearchMatch[ [[#variableb688cbc0]].size()]);
}

private static List  [[#variableb688cd40]](IJavaElement element, WorkingCopyOwner owner, IProgressMonitor pm) throws JavaModelException {
  CollectingSearchRequestor requestor = new CollectingSearchRequestor();
  SearchEngine engine = owner != null ? new SearchEngine(owner): new SearchEngine();
  engine. [[#variableb688cba0]](element, requestor, pm);
  return requestor.getResults();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b688cea0]]
IMethod 
12[[#b688cea0]]
IField 
13[[#b688cea0]]
IType 
21[[#b688ce20]]
getMethodsReferencedIn 
22[[#b688ce20]]
getFieldsReferencedIn 
23[[#b688ce20]]
getTypesReferencedIn 
31[[#b688cd40]]
getMethodReferencesIn 
32[[#b688cd40]]
getFieldReferencesIn 
33[[#b688cd40]]
getTypeReferencesIn 
41[[#b688cbc0]]
referencedMethods 
42[[#b688cbc0]]
referencedFields 
43[[#b688cbc0]]
referencedTypes 
51[[#b688ccc0]]
METHOD 
52[[#b688ccc0]]
FIELD 
53[[#b688ccc0]]
TYPE 
61[[#b688cba0]]
searchDeclarationsOfSentMessages 
62[[#b688cba0]]
searchDeclarationsOfAccessedFields 
63[[#b688cba0]]
searchDeclarationsOfReferencedTypes