try
{
in = new BufferedReader(new FileReader(recent));
parser.parse(null, null, in);
}
catch(XmlException xe)
{
int line = xe.getLine();
String message = xe.getMessage();
Log.log(Log.ERROR,BufferHistory.class,recent + ":" + line
+ ": " + message);
}
catch(FileNotFoundException fnf)
{
//Log.log(Log.DEBUG,BufferHistory.class,fnf);
}
catch(Exception e)
{
Log.log(Log.ERROR,BufferHistory.class,e);
}
finally
{
try
{
if(in != null)
in.close();
}
catch(IOException io)
{
Log.log(Log.ERROR,BufferHistory.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/BufferHistory.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/buffer/KillRing.java
|
Method name: void load()
|
|
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(recent));↵ | | 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,BufferHistory.class,recent + ":" + line↵ | | 10 | Log.log(Log.ERROR,KillRing.class,killRing + ":" + line↵
|
11 | + ": " + message);↵ | | 11 | + ": " + message);↵
|
12 | }↵ | | 12 | }↵
|
13 | catch(FileNotFoundException fnf)↵ | | 13 | catch(FileNotFoundException fnf)↵
|
14 | {↵ | | 14 | {↵
|
15 | //Log.log(Log.DEBUG,BufferHistory.class,fnf);↵ | | 15 | //Log.log(Log.DEBUG,BufferHistory.class,fnf);↵
|
16 | }↵ | | 16 | }↵
|
17 | catch(Exception e)↵ | | 17 | catch(Exception e)↵
|
18 | {↵ | | 18 | {↵
|
19 | Log.log(Log.ERROR,BufferHistory.class,e);↵ | | 19 | Log.log(Log.ERROR,KillRing.class,e);↵
|
20 | }↵ | | 20 | }↵
|
21 | finally↵ | | 21 | finally↵
|
22 | {↵ | | 22 | {↵
|
23 | try↵ | | 23 | try↵
|
24 | {↵ | | 24 | {↵
|
25 | if(in != null)↵ | | 25 | if(in != null)↵
|
26 | in.close();↵ | | 26 | in.close();↵
|
27 | }↵ | | 27 | }↵
|
28 | catch(IOException io)↵ | | 28 | catch(IOException io)↵
|
29 | {↵ | | 29 | {↵
|
30 | Log.log(Log.ERROR,BufferHistory.class,io);↵ | | 30 | Log.log(Log.ERROR,KillRing.class,io);↵
|
31 | }↵ | | 31 | }↵
|
32 | } | | 32 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
13 | try | | 13 | try |
14 | in = new BufferedReader(new FileReader(recent)); | | 14 | in = new BufferedReader(new FileReader(killRing)); |
15 | parser.parse(null, null, in); | | 15 | parser.parse(null, null, in); |
Precondition Violations (0)
Row |
Violation |