try { in = new BufferedReader(new FileReader(perspective)); parser.parse(null, null, in); } catch(XmlException xe) { int line = xe.getLine(); String message = xe.getMessage(); Log.log(Log.ERROR,PerspectiveManager.class,perspective + ":" + line + ": " + message); } catch(FileNotFoundException fnf) { } catch(Exception e) { Log.log(Log.ERROR,PerspectiveManager.class,e); } finally { try { if(in != null) in.close(); } catch(IOException io) { Log.log(Log.ERROR,PerspectiveManager.class,io); } }
try { in = new BufferedReader(new FileReader(killRing)); parser.parse(null, null, in); } catch(XmlException xe) { int line = xe.getLine(); String message = xe.getMessage(); Log.log(Log.ERROR,KillRing.class,killRing + ":" + line + ": " + message); } catch(FileNotFoundException fnf) { //Log.log(Log.DEBUG,BufferHistory.class,fnf); } catch(Exception e) { Log.log(Log.ERROR,KillRing.class,e); } finally { try { if(in != null) in.close(); } catch(IOException io) { Log.log(Log.ERROR,KillRing.class,io); } }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/PerspectiveManager.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/KillRing.java
Method name: View loadPerspective(boolean) Method name: void load()
Number of AST nodes: 3 Number of AST nodes: 3
1
try
1
try
2
		{
2
		{
3
			in = new BufferedReader(new FileReader(perspective));
3
			in = new BufferedReader(new FileReader(killRing));
4
			parser.parse(null, null, in);
4
			parser.parse(null, null, in);
5
		}
5
		}
6
		catch(XmlException xe)
6
		catch(XmlException xe)
7
		{
7
		{
8
			int line = xe.getLine();
8
			int line = xe.getLine();
9
			String message = xe.getMessage();
9
			String message = xe.getMessage();
10
			Log.log(Log.ERROR,PerspectiveManager.class,perspective
10
			Log.log(Log.ERROR,
11
				+ ":" + line 
11
KillRing.class,killRing + ":" + line
12
+ ": " + message);
12
				+ ": " + message);
13
		}
13
		}
14
		catch(FileNotFoundException fnf)
14
		catch(FileNotFoundException fnf)
15
		{
15
		{
16
		
16
			//Log.log(Log.DEBUG,BufferHistory.class,fnf);
17
}
17
		}
18
		catch(Exception e)
18
		catch(Exception e)
19
		{
19
		{
20
			Log.log(Log.ERROR,PerspectiveManager.class,e);
20
			Log.log(Log.ERROR,KillRing.class,e);
21
		}
21
		}
22
		finally
22
		finally
23
		{
23
		{
24
			try
24
			try
25
			{
25
			{
26
				if(in != null)
26
				if(in != null)
27
					in.close();
27
					in.close();
28
			}
28
			}
29
			catch(IOException io)
29
			catch(IOException io)
30
			{
30
			{
31
				Log.log(Log.ERROR,PerspectiveManager.class,io);
31
				Log.log(Log.ERROR,KillRing.class,io);
32
			}
32
			}
33
		}
33
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.4
Clones locationClones are in different classes
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    try
    13
    try
    13
    in = new BufferedReader(new FileReader(perspective));
    13
    in = new BufferedReader(new FileReader(perspective));
    14
    in = new BufferedReader(new FileReader(killRing));
    Differences
    Expression1Expression2Difference
    perspectivekillRingVARIABLE_NAME_MISMATCH
    14
    in = new BufferedReader(new FileReader(killRing));
    14
    parser.parse(null, null, in);
    15
    parser.parse(null, null, in);
    Precondition Violations (0)
    Row Violation