CloneSet405


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
50260.987compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15011
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/ClasspathContainerSourceContainerTypeDelegate.java
25011
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/ClasspathVariableSourceContainerTypeDelegate.java
Clone Instance
1
Line Count
50
Source Line
11
Source File
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/ClasspathContainerSourceContainerTypeDelegate.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);
        }
}




Clone Instance
2
Line Count
50
Source Line
11
Source File
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.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);
        }
}




Clone AbstractionParameter Count: 6Parameter Bindings

/*******************************************************************************
 * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b4c00060]]
ClasspathContainerSourceContainer 
12[[#b4c00060]]
ClasspathVariableSourceContainer 
21[[#bef49fe0]]
ClasspathContainerSourceContainerTypeDelegate 
22[[#bef49fe0]]
ClasspathVariableSourceContainerTypeDelegate 
31[[#bef49f40]]
"classpathContainer" 
32[[#bef49f40]]
"classpathVariable" 
41[[#bef49ee0]]
ClasspathContainerSourceContainerTypeDelegate_5 
42[[#bef49ee0]]
ClasspathVariableSourceContainerTypeDelegate_5 
51[[#bef49e60]]
ClasspathContainerSourceContainerTypeDelegate_6 
52[[#bef49e60]]
ClasspathVariableSourceContainerTypeDelegate_6 
61[[#bef49e00]]
ClasspathContainerSourceContainerTypeDelegate_7 
62[[#bef49e00]]
ClasspathVariableSourceContainerTypeDelegate_7