Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
50 | 2 | 6 | 0.987 | compilation_unit |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 50 | 11 | plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/ClasspathContainerSourceContainerTypeDelegate.java |
2 | 50 | 11 | plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/ClasspathVariableSourceContainerTypeDelegate.java |
| ||||
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.launching; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; import org.eclipse.jdt.launching.sourcelookup.containers.ClasspathContainerSourceContainer; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; /** * Classpath container source container type. * * @since 3.0 */ public class ClasspathContainerSourceContainerTypeDelegate extends AbstractSourceContainerTypeDelegate { /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) */ public ISourceContainer createSourceContainer(String memento) throws CoreException { Node node = parseDocument(memento); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if ("classpathContainer".equals(element.getNodeName())) { //$NON-NLS-1$ String string = element.getAttribute("path"); //$NON-NLS-1$ if (string == null || string.length() == 0) { abort(LaunchingMessages.ClasspathContainerSourceContainerTypeDelegate_5, null); } return new ClasspathContainerSourceContainer(new Path(string)); } abort(LaunchingMessages.ClasspathContainerSourceContainerTypeDelegate_6, null); } abort(LaunchingMessages.ClasspathContainerSourceContainerTypeDelegate_7, null); return null; } /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) */ public String getMemento(ISourceContainer container) throws CoreException { ClasspathContainerSourceContainer var = (ClasspathContainerSourceContainer) container; Document document = newDocument(); Element element = document.createElement("classpathContainer"); //$NON-NLS-1$ element.setAttribute("path", var.getPath().toString()); //$NON-NLS-1$ document.appendChild(element); return serializeDocument(document); } } |
| ||||
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.launching; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; import org.eclipse.jdt.launching.sourcelookup.containers.ClasspathVariableSourceContainer; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; /** * Classpath variable source container type. * * @since 3.0 */ public class ClasspathVariableSourceContainerTypeDelegate extends AbstractSourceContainerTypeDelegate { /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) */ public ISourceContainer createSourceContainer(String memento) throws CoreException { Node node = parseDocument(memento); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if ("classpathVariable".equals(element.getNodeName())) { //$NON-NLS-1$ String string = element.getAttribute("path"); //$NON-NLS-1$ if (string == null || string.length() == 0) { abort(LaunchingMessages.ClasspathVariableSourceContainerTypeDelegate_5, null); } return new ClasspathVariableSourceContainer(new Path(string)); } abort(LaunchingMessages.ClasspathVariableSourceContainerTypeDelegate_6, null); } abort(LaunchingMessages.ClasspathVariableSourceContainerTypeDelegate_7, null); return null; } /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) */ public String getMemento(ISourceContainer container) throws CoreException { ClasspathVariableSourceContainer var = (ClasspathVariableSourceContainer) container; Document document = newDocument(); Element element = document.createElement("classpathVariable"); //$NON-NLS-1$ element.setAttribute("path", var.getPath().toString()); //$NON-NLS-1$ document.appendChild(element); return serializeDocument(document); } } |
| |||
/******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.launching; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; import org.eclipse.jdt.launching.sourcelookup.containers. [[#variableb4c00060]]; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; /** * Classpath container source container type. * * @since 3.0 */ /** * Classpath variable source container type. * * @since 3.0 */ public class [[#variablebef49fe0]]extends AbstractSourceContainerTypeDelegate { /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) */ public ISourceContainer createSourceContainer(String memento) throws CoreException { Node node = parseDocument(memento); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; if ( [[#variablebef49f40]].equals(element.getNodeName())) { //$NON-NLS-1$ String string = element.getAttribute("path"); //$NON-NLS-1$ if (string == null || string.length() == 0) { abort(LaunchingMessages. [[#variablebef49ee0]], null); } return new [[#variableb4c00060]](new Path(string)); } abort(LaunchingMessages. [[#variablebef49e60]], null); } abort(LaunchingMessages. [[#variablebef49e00]], null); return null; } /* (non-Javadoc) * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) */ public String getMemento(ISourceContainer container) throws CoreException { [[#variableb4c00060]] var = ( [[#variableb4c00060]]) container; Document document = newDocument(); Element element = document.createElement( [[#variablebef49f40]]); //$NON-NLS-1$ element.setAttribute("path", var.getPath().toString()); //$NON-NLS-1$ document.appendChild(element); return serializeDocument(document); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#b4c00060]] | ClasspathContainerSourceContainer |
1 | 2 | [[#b4c00060]] | ClasspathVariableSourceContainer |
2 | 1 | [[#bef49fe0]] | ClasspathContainerSourceContainerTypeDelegate |
2 | 2 | [[#bef49fe0]] | ClasspathVariableSourceContainerTypeDelegate |
3 | 1 | [[#bef49f40]] | "classpathContainer" |
3 | 2 | [[#bef49f40]] | "classpathVariable" |
4 | 1 | [[#bef49ee0]] | ClasspathContainerSourceContainerTypeDelegate_5 |
4 | 2 | [[#bef49ee0]] | ClasspathVariableSourceContainerTypeDelegate_5 |
5 | 1 | [[#bef49e60]] | ClasspathContainerSourceContainerTypeDelegate_6 |
5 | 2 | [[#bef49e60]] | ClasspathVariableSourceContainerTypeDelegate_6 |
6 | 1 | [[#bef49e00]] | ClasspathContainerSourceContainerTypeDelegate_7 |
6 | 2 | [[#bef49e00]] | ClasspathVariableSourceContainerTypeDelegate_7 |