| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 31 | 2 | 6 | 0.972 | class_body_declarations[3] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 31 | 138 | plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/sourcelookup/DirectorySourceLocation.java |
| 2 | 31 | 144 | 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 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;
}
|
| ||||
/* (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;
}
|
| |||
/* (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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#c267a600]] | JavaProjectSourceLocation |
| 1 | 2 | [[#c267a600]] | DirectorySourceLocation |
| 2 | 1 | [[#c267a560]] | getJavaProject |
| 2 | 2 | [[#c267a560]] | getDirectory |
| 3 | 1 | [[#c267a460]] | "javaProjectSourceLocation" |
| 3 | 2 | [[#c267a460]] | "directorySourceLocation" |
| 4 | 1 | [[#c267a480]] | "name" |
| 4 | 2 | [[#c267a480]] | "path" |
| 5 | 1 | [[#c267a3e0]] | getElementName |
| 5 | 2 | [[#c267a3e0]] | getAbsolutePath |
| 6 | 1 | [[#c267a400]] | JavaProjectSourceLocation_Unable_to_create_memento_for_Java_project_source_location__0__1 |
| 6 | 2 | [[#c267a400]] | DirectorySourceLocation_Unable_to_create_memento_for_directory_source_location__0__1 |