CloneSet515


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
31260.972class_body_declarations[3]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
131138
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java
231144
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java
Clone Instance
1
Line Count
31
Source Line
138
Source File
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java

        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
        public boolean equals(Object object) {
                return object instanceof DirectorySourceLocation &&
                         getDirectory().equals(((DirectorySourceLocation) object).getDirectory());
        }

        /* (non-Javadoc)
         * @see java.lang.Object#hashCode()
         */
        public int hashCode() {
                return getDirectory().hashCode();
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#getMemento()
         */
        public String getMemento() throws CoreException {
                try {
                        Document doc = LaunchingPlugin.getDocument();
                        Element node = doc.createElement("directorySourceLocation"); //$NON-NLS-1$
                        doc.appendChild(node);
                        node.setAttribute("path", getDirectory().getAbsolutePath()); //$NON-NLS-1$
                        return LaunchingPlugin.serializeDocument(doc);
                } catch (IOException e) {
                        abort(MessageFormat.format(LaunchingMessages.DirectorySourceLocation_Unable_to_create_memento_for_directory_source_location__0__1, new String[] {
                                                                                                                                                                         getDirectory().getAbsolutePath()
                                                                                                                                                                        } ),                                 e);
                  }
                  catch (ParserConfigurationException e) {
                        abort(MessageFormat.format(LaunchingMessages.DirectorySourceLocation_Unable_to_create_memento_for_directory_source_location__0__1, new String[] {
                                                                                                                                                                         getDirectory().getAbsolutePath()
                                                                                                                                                                        } ),                                 e);
                  }
                  catch (TransformerException e) {
                        abort(MessageFormat.format(LaunchingMessages.DirectorySourceLocation_Unable_to_create_memento_for_directory_source_location__0__1, new String[] {
                                                                                                                                                                         getDirectory().getAbsolutePath()
                                                                                                                                                                        } ),                                 e);
                  }
                // execution will not reach here
                return null;
        }


Clone Instance
2
Line Count
31
Source Line
144
Source File
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/JavaProjectSourceLocation.java

        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
        public boolean equals(Object object) {
                return object instanceof JavaProjectSourceLocation &&
                         getJavaProject().equals(((JavaProjectSourceLocation) object).getJavaProject());
        }

        /* (non-Javadoc)
         * @see java.lang.Object#hashCode()
         */
        public int hashCode() {
                return getJavaProject().hashCode();
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#getMemento()
         */
        public String getMemento() throws CoreException {
                try {
                        Document doc = LaunchingPlugin.getDocument();
                        Element node = doc.createElement("javaProjectSourceLocation"); //$NON-NLS-1$
                        doc.appendChild(node);
                        node.setAttribute("name", getJavaProject().getElementName()); //$NON-NLS-1$
                        return LaunchingPlugin.serializeDocument(doc);
                } catch (IOException e) {
                        abort(MessageFormat.format(LaunchingMessages.JavaProjectSourceLocation_Unable_to_create_memento_for_Java_project_source_location__0__1, new String[] {
                                                                                                                                                                              getJavaProject().getElementName()
                                                                                                                                                                             } ),                                  e);
                  }
                  catch (ParserConfigurationException e) {
                        abort(MessageFormat.format(LaunchingMessages.JavaProjectSourceLocation_Unable_to_create_memento_for_Java_project_source_location__0__1, new String[] {
                                                                                                                                                                              getJavaProject().getElementName()
                                                                                                                                                                             } ),                                  e);
                  }
                  catch (TransformerException e) {
                        abort(MessageFormat.format(LaunchingMessages.JavaProjectSourceLocation_Unable_to_create_memento_for_Java_project_source_location__0__1, new String[] {
                                                                                                                                                                              getJavaProject().getElementName()
                                                                                                                                                                             } ),                                  e);
                  }
                // execution will not reach here
                return null;
        }


Clone AbstractionParameter Count: 6Parameter Bindings

/* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
public boolean equals(Object object) {
  return object instanceof [[#variablec267a600]]&& [[#variablec267a560]]().equals((( [[#variablec267a600]]) object). [[#variablec267a560]]());
}

/* (non-Javadoc)
         * @see java.lang.Object#hashCode()
         */
public int hashCode() {
  return [[#variablec267a560]]().hashCode();
}

/* (non-Javadoc)
         * @see org.eclipse.jdt.launching.sourcelookup.IJavaSourceLocation#getMemento()
         */
public String getMemento() throws CoreException {
  try {
    Document doc = LaunchingPlugin.getDocument();
    Element node = doc.createElement( [[#variablec267a460]]); //$NON-NLS-1$
    doc.appendChild(node);
    node.setAttribute( [[#variablec267a480]],  [[#variablec267a560]](). [[#variablec267a3e0]]()); //$NON-NLS-1$
    return LaunchingPlugin.serializeDocument(doc);
  }
  catch (IOException e) {
    abort(MessageFormat.format(LaunchingMessages. [[#variablec267a400]], new String[] {
                                                                                         [[#variablec267a560]](). [[#variablec267a3e0]]()
                                                                                      } ), e);
  }
  catch (ParserConfigurationException e) {
    abort(MessageFormat.format(LaunchingMessages. [[#variablec267a400]], new String[] {
                                                                                         [[#variablec267a560]](). [[#variablec267a3e0]]()
                                                                                      } ), e);
  }
  catch (TransformerException e) {
    abort(MessageFormat.format(LaunchingMessages. [[#variablec267a400]], new String[] {
                                                                                         [[#variablec267a560]](). [[#variablec267a3e0]]()
                                                                                      } ), e);
  }
  // execution will not reach here
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#c267a600]]
JavaProjectSourceLocation 
12[[#c267a600]]
DirectorySourceLocation 
21[[#c267a560]]
getJavaProject 
22[[#c267a560]]
getDirectory 
31[[#c267a460]]
"javaProjectSourceLocation" 
32[[#c267a460]]
"directorySourceLocation" 
41[[#c267a480]]
"name" 
42[[#c267a480]]
"path" 
51[[#c267a3e0]]
getElementName 
52[[#c267a3e0]]
getAbsolutePath 
61[[#c267a400]]
JavaProjectSourceLocation_Unable_to_create_memento_for_Java_project_source_location__0__1 
62[[#c267a400]]
DirectorySourceLocation_Unable_to_create_memento_for_directory_source_location__0__1