Class c = (Class)primitiveToWrapper.get( primitiveType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive type: "+ primitiveType );
CommandPathEntry entry = (CommandPathEntry)importedCommands .elementAt(i); InputStream in = entry.clas.getResourceAsStream(entry.path + extName); if(in != null) return in;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/Primitive.java File path: /jEdit-4.2/src/bsh/NameSpace.java
Method name: Class boxType(Class) Method name: InputStream getCommand(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
Class c = (Class)primitiveToWrapper.get( primitiveType 
1
CommandPathEntry entry = (CommandPathEntry)importedCommands
2
					.elementAt(i);
2
);
3
				InputStream in = entry.clas.getResourceAsStream(entry.path + extName);
3
		if ( c != null )
4
				if(in != null)
4
			return c;
5
			
5
		throw new InterpreterError( 
6
			"Not a primitive type: "+ primitiveType );
6
		return in;
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 comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Class c = (Class)primitiveToWrapper.get(primitiveType);
                                                                                                                    
                                                                                                                                                        
    4
    CommandPathEntry entry = (CommandPathEntry)importedCommands.elementAt(i);
                                                                                                                                                  
    5
    InputStream in = entry.clas.getResourceAsStream(entry.path + extName);
    Preondition Violations
    Unmatched statement InputStream in=entry.clas.getResourceAsStream(entry.path + extName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    InputStream in = entry.clas.getResourceAsStream(entry.path + extName);
    2
    if (c != null)
    2
    if (c != null)
    6
    if (in != null)
    Differences
    Expression1Expression2Difference
    cinVARIABLE_NAME_MISMATCH
    java.lang.Classjava.io.InputStreamVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class of variable c does not match with type java.io.InputStream of variable in
    • Make classes java.lang.Class and java.io.InputStream extend a common superclass
    6
    if (in != null)
    3
    return c;
    3
    return c;
    Preondition Violations
    Unmatched return c;
                            
                              
    7
    return in;
    Preondition Violations
    Unmatched return in;
    7
    return in;
    4
    throw new InterpreterError("Not a primitive type: " + primitiveType);
    4
    throw new InterpreterError("Not a primitive type: " + primitiveType);
    Preondition Violations
    Unmatched throw new InterpreterError("Not a primitive type: " + primitiveType);
                                                                                                                                                    
    Precondition Violations (5)
    Row Violation
    1Unmatched statement InputStream in=entry.clas.getResourceAsStream(entry.path + extName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type java.lang.Class of variable c does not match with type java.io.InputStream of variable in
    3Unmatched return c;
    4Unmatched return in;
    5Unmatched throw new InterpreterError("Not a primitive type: " + primitiveType);