try {
return
getName( callstack.top() ).toObject(
callstack, interpreter, forceClass );
} catch ( UtilEvalError e ) {
//e.printStackTrace();
throw e.toEvalError( this, callstack );
}
try {
Object ret = globalNameSpace.get( name, this );
return Primitive.unwrap( ret );
} catch ( UtilEvalError e ) {
throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() );
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/BSHAmbiguousName.java
|
|
File path: /jEdit-4.2/src/bsh/Interpreter.java
|
Method name: Object toObject(CallStack, Interpreter, boolean)
|
|
Method name: Object get(String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | return ↵ | | |
|
3 | getName( callstack.top() ).toObject( ↵ | | |
|
4 | callstack, interpreter, forceClass↵ | | 2 | Object ret = globalNameSpace.get( name, this );↵
|
5 | );↵ | | 3 | return Primitive.unwrap( ret );↵
|
6 | } catch ( UtilEvalError e ) {↵ | | 4 | } catch ( UtilEvalError e ) {↵
|
7 | //e.printStackTrace();↵ | | 5 | ↵
|
8 | throw e.toEvalError( this, callstack );↵ | | 6 | throw e.toEvalError( SimpleNode.JAVACODE, new CallStack() ); ↵
|
9 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 1 | try |
| | | 2 | Object ret = globalNameSpace.get(name, this); |
2 | return getName(callstack.top()).toObject(callstack, interpreter, forceClass); | | | |
| | | 3 | return Primitive.unwrap(ret); |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement Object ret=globalNameSpace.get(name,this); 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 |
2 | Unmatched return getName(callstack.top()).toObject(callstack,interpreter,forceClass); |
3 | Unmatched return Primitive.unwrap(ret); |