XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL); @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES); @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures; parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL); @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES); @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures; parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLLoadImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLLoadImpl.java
Method name: void load(XMLResource, InputStream, Map) Method name: void load(XMLResource, InputSource, Map)
Number of AST nodes: 5 Number of AST nodes: 5
1
XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
1
XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
2
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
2
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
3
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
3
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
4
    parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures;
4
    parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures;
5
    parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
5
    parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
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.0
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
    15
    XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
    3
    XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
    Differences
    Expression1Expression2Difference
    VARIABLE_TYPE_MISMATCH
    java.util.Map<,>java.util.Map<,>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type of variable options.get(XMLResource.OPTION_USE_PARSER_POOL) does not match with type of variable options.get(XMLResource.OPTION_USE_PARSER_POOL)
    • Make classes and extend a common superclass
    Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options
    • Make classes java.util.Map<,> and java.util.Map<,> extend a common superclass
    3
    XMLParserPool pool = (XMLParserPool)options.get(XMLResource.OPTION_USE_PARSER_POOL);
    16
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
    16
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
    4
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
    Differences
    Expression1Expression2Difference
    VARIABLE_TYPE_MISMATCH
    java.util.Map<,>java.util.Map<,>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression options.get(XMLResource.OPTION_PARSER_FEATURES) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression options.get(XMLResource.OPTION_PARSER_FEATURES) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type of variable options.get(XMLResource.OPTION_PARSER_FEATURES) does not match with type of variable options.get(XMLResource.OPTION_PARSER_FEATURES)
    • Make classes and extend a common superclass
    Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options
    • Make classes java.util.Map<,> and java.util.Map<,> extend a common superclass
    4
    @SuppressWarnings("unchecked") Map<String, Boolean> parserFeatures = (Map<String, Boolean>)options.get(XMLResource.OPTION_PARSER_FEATURES);
                                                                                                                                                                                                                                                                        
    5
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
    Preondition Violations
    Unmatched statement @SuppressWarnings("unchecked") Map<String,?> parserProperties=(Map<String,?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
    17
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
    17
    @SuppressWarnings("unchecked") Map<String, ?> parserProperties = (Map<String, ?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES);
    Preondition Violations
    Unmatched statement @SuppressWarnings("unchecked") Map<String,?> parserProperties=(Map<String,?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                                          
    18
    parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures;
    6
    parserFeatures = (parserFeatures == null) ? Collections.<String, Boolean>emptyMap() : parserFeatures;
                                                                                                                                                                                                                        
    7
    parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
    19
    parserProperties = (parserProperties == null) ? Collections.<String, Object>emptyMap() : parserProperties;
                                                                                                                                                                                                                          
    Precondition Violations (9)
    Row Violation
    1Type of variable options.get(XMLResource.OPTION_USE_PARSER_POOL) does not match with type of variable options.get(XMLResource.OPTION_USE_PARSER_POOL)
    2Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options
    3Expression options.get(XMLResource.OPTION_PARSER_FEATURES) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression options.get(XMLResource.OPTION_PARSER_FEATURES) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type of variable options.get(XMLResource.OPTION_PARSER_FEATURES) does not match with type of variable options.get(XMLResource.OPTION_PARSER_FEATURES)
    6Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options
    7Unmatched statement @SuppressWarnings("unchecked") Map<String,?> parserProperties=(Map<String,?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement @SuppressWarnings("unchecked") Map<String,?> parserProperties=(Map<String,?>)options.get(XMLResource.OPTION_PARSER_PROPERTIES); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variables pool, parserFeatures , while Clone fragment #2 returns variables pool, parserFeatures