try { setInstanceClassGen(getClassForName(getInstanceClassName())); } catch (ClassNotFoundException e) { // Ignore exceptions. }
try { ((EPackageImpl)ePackage).freeze(); } catch (ClassCastException exception) { // Ignore if we can't freeze. }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EClassifierImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java
Method name: Class getInstanceClass() Method name: void freeze(EPackage)
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
        {
2
    {
3
          setInstanceClassGen(getClassForName(getInstanceClassName()));
3
      
4
   
4
((EPackageImpl)ePackage).freeze();
5
     }
5
    }
6
        catch (ClassNotFoundException e)
6
    catch (ClassCastException exception)
7
        {
7
    
8
    
8
{
9
      // Ignore exceptions.
9
      // Ignore 
10
    
10
if we can't freeze.
11
    }
11
    }
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 statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)21.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.lang.ClassNotFoundExceptionjava.lang.ClassCastExceptionSUBCLASS_TYPE_MISMATCH
    eexceptionVARIABLE_NAME_MISMATCH
    java.lang.ClassNotFoundExceptionjava.lang.ClassCastExceptionSUBCLASS_TYPE_MISMATCH
    1
    try
    6
    setInstanceClassGen(getClassForName(getInstanceClassName()));
    6
    setInstanceClassGen(getClassForName(getInstanceClassName()));
    2
    ((EPackageImpl)ePackage).freeze();
    Differences
    Expression1Expression2Difference
    setInstanceClassGenfreezeMETHOD_INVOCATION_NAME_MISMATCH
    setInstanceClassGen(getClassForName(getInstanceClassName()))((EPackageImpl)ePackage).freeze()ARGUMENT_NUMBER_MISMATCH
    ((EPackageImpl)ePackage)MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a void method call, and thus it cannot be parameterized
    Expression ((EPackageImpl)ePackage).freeze() is a void method call, and thus it cannot be parameterized
    Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a void method call, and thus it cannot be parameterized
    Expression ((EPackageImpl)ePackage).freeze() is a void method call, and thus it cannot be parameterized
    2
    ((EPackageImpl)ePackage).freeze();
    Precondition Violations (6)
    Row Violation
    1Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a void method call, and thus it cannot be parameterized
    3Expression ((EPackageImpl)ePackage).freeze() is a void method call, and thus it cannot be parameterized
    4Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression setInstanceClassGen(getClassForName(getInstanceClassName())) is a void method call, and thus it cannot be parameterized
    6Expression ((EPackageImpl)ePackage).freeze() is a void method call, and thus it cannot be parameterized