Throwable t = ((InvocationTargetException)e).getTargetException(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t;
Throwable t = ((TargetError)e).getTarget(); if(t instanceof Exception) throw (Exception)t; else if(t instanceof Error) throw (Error)t;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/BeanShell.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/BeanShell.java
Method name: void unwrapException(Exception) Method name: void unwrapException(Exception)
Number of AST nodes: 5 Number of AST nodes: 5
1
Throwable t = ((InvocationTargetException)e).getTargetException();
1
Throwable t = ((TargetError)e).getTarget();
2
			if(t instanceof Exception)
2
			if(t instanceof Exception)
3
				throw (Exception)t;
3
				throw (Exception)t;
4
			else if(t instanceof Error)
4
			else if(t instanceof Error)
5
				throw (Error)t;
5
				throw (Error)t;
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.4
Clones locationClones are in the same method
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    Throwable t = ((InvocationTargetException)e).getTargetException();
    8
    Throwable t = ((InvocationTargetException)e).getTargetException();
    2
    Throwable t = ((TargetError)e).getTarget();
    Differences
    Expression1Expression2Difference
    getTargetExceptiongetTargetMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.reflect.InvocationTargetExceptionbsh.TargetErrorSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (InvocationTargetException)e cannot be unified with expression (TargetError)e , because common superclass java.lang.Exception does not declare member(s) public java.lang.Throwable getTargetException() , public java.lang.Throwable getTarget()
    2
    Throwable t = ((TargetError)e).getTarget();
    9
    if (t instanceof Exception)
    3
    if (t instanceof Exception)
    10
    throw (Exception)t;
    4
    throw (Exception)t;
    11
    else if (t instanceof Error)
    5
    else if (t instanceof Error)
    12
    throw (Error)t;
    6
    throw (Error)t;
    Precondition Violations (1)
    Row Violation
    1Expression (InvocationTargetException)e cannot be unified with expression (TargetError)e , because common superclass java.lang.Exception does not declare member(s) public java.lang.Throwable getTargetException() , public java.lang.Throwable getTarget()