CloneSet335


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
52210.999class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
152341
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java
252776
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java
Clone Instance
1
Line Count
52
Source Line
341
Source File
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/DetailFormatterDialog.java

        /**
         * Use the Java search engine to find the type which corresponds
         * to the given name.
         */
        private void findCorrespondingType() {
                if (fTypeSearched) {
                        return;
                }
                fType = null;
                fTypeSearched = true;
                final String pattern = fTypeNameText.getText().trim().replace('$', '.');
                if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
                        return;
                }
                final IProgressMonitor monitor = new NullProgressMonitor();
                final SearchRequestor collector = new SearchRequestor() {
                        private boolean fFirst = true;

                        public void endReporting() {
                                checkValues();
                        }

                        public void acceptSearchMatch(SearchMatch match) throws CoreException {
                                Object enclosingElement = match.getElement();
                                if ( !fFirst) {
                                        return;
                                }
                                fFirst = false;
                                if (enclosingElement instanceof IType) {
                                        fType = (IType) enclosingElement;
                                }
                                // cancel once we have one match
                                monitor.setCanceled(true);
                        }
                                                  };

                SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
                SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH|  SearchPattern.R_CASE_SENSITIVE);
                IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
                SearchParticipant[] participants = new SearchParticipant[] {
                                                                            SearchEngine.getDefaultSearchParticipant()
                                                                           };
                try {
                        engine.search(searchPattern, participants, scope, collector, monitor);
                } catch (CoreException e) {
                        JDIDebugUIPlugin.log(e);
                  }
                  catch (OperationCanceledException e) {
                  }
        }

        /**
         * Return the type object which corresponds to the given name.
         */
        public IType getType() {
                if ( !fTypeSearched) {
                        findCorrespondingType();
                }
                return fType;
        }


Clone Instance
2
Line Count
52
Source Line
776
Source File
plugins/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/EditLogicalStructureDialog.java

        /**
         * Use the Java search engine to find the type which corresponds
         * to the given name.
         */
        private void findCorrespondingType() {
                if (fTypeSearched) {
                        return;
                }
                fType = null;
                fTypeSearched = true;
                final String pattern = fQualifiedTypeNameText.getText().trim().replace('$', '.');
                if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
                        return;
                }
                final IProgressMonitor monitor = new NullProgressMonitor();
                final SearchRequestor collector = new SearchRequestor() {
                        private boolean fFirst = true;

                        public void endReporting() {
                                checkValues();
                        }

                        public void acceptSearchMatch(SearchMatch match) throws CoreException {
                                Object enclosingElement = match.getElement();
                                if ( !fFirst) {
                                        return;
                                }
                                fFirst = false;
                                if (enclosingElement instanceof IType) {
                                        fType = (IType) enclosingElement;
                                }
                                // stop after we find one
                                monitor.setCanceled(true);
                        }
                                                  };

                SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
                SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH|  SearchPattern.R_CASE_SENSITIVE);
                IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
                SearchParticipant[] participants = new SearchParticipant[] {
                                                                            SearchEngine.getDefaultSearchParticipant()
                                                                           };
                try {
                        engine.search(searchPattern, participants, scope, collector, monitor);
                } catch (CoreException e) {
                        JDIDebugUIPlugin.log(e);
                  }
                  catch (OperationCanceledException e) {
                  }
        }

        /**
         * Return the type object which corresponds to the given name.
         */
        public IType getType() {
                if ( !fTypeSearched) {
                        findCorrespondingType();
                }
                return fType;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Use the Java search engine to find the type which corresponds
         * to the given name.
         */
private void findCorrespondingType() {
  if (fTypeSearched) {
    return;
  }
  fType = null;
  fTypeSearched = true;
  final String pattern = [[#variablea53b87c0]].getText().trim().replace('$', '.');
  if (pattern == null || "".equals(pattern)) { //$NON-NLS-1$
    return;
  }
  final IProgressMonitor monitor = new NullProgressMonitor();
  final SearchRequestor collector = new SearchRequestor() {
                                      private boolean fFirst = true;

                                      public void endReporting() {
                                        checkValues();
                                      }

                                      public void acceptSearchMatch(SearchMatch match) throws CoreException {
                                        Object enclosingElement = match.getElement();
                                        if ( !fFirst) {
                                          return;
                                        }
                                        fFirst = false;
                                        if (enclosingElement instanceof IType) {
                                          fType = (IType) enclosingElement;
                                        }
                                        // cancel once we have one match
                                        // stop after we find one
                                        monitor.setCanceled(true);
                                      }
                                    };
  SearchEngine engine = new SearchEngine(JavaCore.getWorkingCopies(null));
  SearchPattern searchPattern = SearchPattern.createPattern(pattern, IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH|SearchPattern.R_CASE_SENSITIVE);
  IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
  SearchParticipant[] participants = new SearchParticipant[] {
                                                               SearchEngine.getDefaultSearchParticipant()
                                                             };
  try {
    engine.search(searchPattern, participants, scope, collector, monitor);
  }
  catch (CoreException e) {
    JDIDebugUIPlugin.log(e);
  }
  catch (OperationCanceledException e) {
  }
}

/**
         * Return the type object which corresponds to the given name.
         */
public IType getType() {
  if ( !fTypeSearched) {
    findCorrespondingType();
  }
  return fType;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#a53b87c0]]
fTypeNameText 
12[[#a53b87c0]]
fQualifiedTypeNameText