try { resource.load(resourceSet.getLoadOptions()); } catch (IOException exception) { // Continue with a different approach. }
try { temporaryFileName = File.createTempFile("XMLSave", null).getPath(); } catch (IOException exception) { // If we can't create a temp file then we have to ignore the option. }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHandler.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: EPackage getPackageForURI(String) Method name: void init(XMLResource, Map)
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
            {
2
        {
3
              resource.load(resourceSet.getLoadOptions());
3
          temporaryFileName = File.createTempFile("XMLSave", null).getPath();
4
            }
4
        
5
    
5
}
6
        catch (IOException exception)
6
        catch (IOException exception)
7
            {
7
        {
8
              // Continue with a different approach.
8
          
9
    
9
// If we can't create a temp file then we have to ignore the option.
10
        }
10
        }
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.2
Clones locationClones are in different classes
Number of node comparisons5
  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 fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    31
    try
    32
    try
    32
    resource.load(resourceSet.getLoadOptions());
    32
    resource.load(resourceSet.getLoadOptions());
    Preondition Violations
    Unmatched statement resource.load(resourceSet.getLoadOptions()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                    
                                                                                                                                            
    33
    temporaryFileName = File.createTempFile("XMLSave", null).getPath();
    Preondition Violations
    Unmatched statement temporaryFileName=File.createTempFile("XMLSave",null).getPath(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    33
    temporaryFileName = File.createTempFile("XMLSave", null).getPath();
    Precondition Violations (2)
    Row Violation
    1Unmatched statement resource.load(resourceSet.getLoadOptions()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement temporaryFileName=File.createTempFile("XMLSave",null).getPath(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted