Mode mode = getMode(modeName); if(mode == null) return null; else return mode.getTokenMarker();
String value = getProperty(name); if(value == null) return null; else return MessageFormat.format(value,args);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/jEdit.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/jEdit.java
Method name: TokenMarker getTokenMarker(String) Method name: String getProperty(String, Object[])
Number of AST nodes: 4 Number of AST nodes: 4
1
Mode mode = getMode(modeName);
1
String value = getProperty(name);
2
				if(mode == null)
2
			if(value == null)
3
					return null;
3
				return null;
4
				else
4
			else
5
					return mode.getTokenMarker();
5
				return MessageFormat.format(value,args);
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 the same java file
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Mode mode = getMode(modeName);
                                                                  
                                                                        
    5
    String value = getProperty(name);
    2
    if (mode == null)
    2
    if (mode == null)
    6
    if (value == null)
    Differences
    Expression1Expression2Difference
    modevalueVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.Modejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.Mode of variable mode does not match with type java.lang.String of variable value
    • Make classes org.gjt.sp.jedit.Mode and java.lang.String extend a common superclass
    6
    if (value == null)
    3
    return null;
    7
    return null;
    else
            
    4
    return mode.getTokenMarker();
    4
    return mode.getTokenMarker();
    Preondition Violations
    Unmatched statement return mode.getTokenMarker(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement return mode.getTokenMarker(); 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
    Unmatched return mode.getTokenMarker();
                                                                    
                                                                                          
    8
    return MessageFormat.format(value, args);
    Preondition Violations
    Unmatched statement return MessageFormat.format(value,args); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return MessageFormat.format(value,args);
    8
    return MessageFormat.format(value, args);
    Precondition Violations (8)
    Row Violation
    1Type org.gjt.sp.jedit.Mode of variable mode does not match with type java.lang.String of variable value
    2Unmatched statement return mode.getTokenMarker(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement return mode.getTokenMarker(); 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
    4Unmatched return mode.getTokenMarker();
    5Unmatched statement return MessageFormat.format(value,args); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched return MessageFormat.format(value,args);
    7Not all possible execution flows end in a return statement
    8The refactoring of the clones is infeasible, because classes and org.gjt.sp.jedit.jEdit do not have a common superclass