if (m_host == null) { throw new MalformedURIException( "Port cannot be set when host is null!"); }
if (node == null) { return null; } root.addNode(node);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java
Method name: void setPort(int) Method name: RoseNode parseObject(String)
Number of AST nodes: 2 Number of AST nodes: 3
1
if (m_host == null)
1
if (node == null)
2
 {
2
        {
3
        throw new MalformedURIException(
3
        
4
      
4
  return null;
5
        
5
        }
6
        "Port cannot be set when host is null!");
6
        
7
      }
7
root.addNode(node);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    if (m_host == null)
    2
    if (m_host == null)
    39
    if (node == null)
    Differences
    Expression1Expression2Difference
    m_hostnodeVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.eclipse.emf.importer.rose.parser.RoseNodeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable m_host does not match with type org.eclipse.emf.importer.rose.parser.RoseNode of variable node
    • Make classes java.lang.String and org.eclipse.emf.importer.rose.parser.RoseNode extend a common superclass
    39
    if (node == null)
    3
    throw new MalformedURIException("Port cannot be set when host is null!");
    3
    throw new MalformedURIException("Port cannot be set when host is null!");
    Preondition Violations
    Unmatched throw new MalformedURIException("Port cannot be set when host is null!");
                                                                                                                                                            
                                    
    40
    return null;
    Preondition Violations
    Unmatched return null;
    40
    return null;
                                                  
    41
    root.addNode(node);
    Precondition Violations (3)
    Row Violation
    1Type java.lang.String of variable m_host does not match with type org.eclipse.emf.importer.rose.parser.RoseNode of variable node
    2Unmatched throw new MalformedURIException("Port cannot be set when host is null!");
    3Unmatched return null;