if(System.currentTimeMillis() - start < 1000)
{
Rectangle r = win.getBounds();
if(!windowOpened && r.equals(required))
return;
if(!r.equals(desired))
{
Log.log(Log.DEBUG,GUIUtilities.class,
"Window resize blocked: " + win.getBounds());
win.setBounds(desired);
}
}
win.removeComponentListener(this);
if(System.currentTimeMillis() - start < 1000)
{
Rectangle r = win.getBounds();
if(!windowOpened && r.equals(required))
return;
if(!r.equals(desired))
{
Log.log(Log.DEBUG,GUIUtilities.class,
"Window resize blocked: " + win.getBounds());
win.setBounds(desired);
}
}
win.removeComponentListener(this);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/GUIUtilities.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/GUIUtilities.java
|
Method name: void componentMoved(ComponentEvent)
|
|
Method name: void componentResized(ComponentEvent)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if(System.currentTimeMillis() - start < 1000)↵ | | 1 | if(System.currentTimeMillis() - start < 1000)↵
|
2 | {↵ | | 2 | {↵
|
3 | Rectangle r = win.getBounds();↵ | | 3 | Rectangle r = win.getBounds();↵
|
4 | if(!windowOpened && r.equals(required))↵ | | 4 | if(!windowOpened && r.equals(required))↵
|
5 | return;↵ | | 5 | return;↵
|
|
6 | if(!r.equals(desired))↵ | | 6 | if(!r.equals(desired))↵
|
7 | {↵ | | 7 | {↵
|
8 | Log.log(Log.DEBUG,GUIUtilities.class,↵ | | 8 | Log.log(Log.DEBUG,GUIUtilities.class,↵
|
9 | "Window resize blocked: " + win.getBounds());↵ | | 9 | "Window resize blocked: " + win.getBounds());↵
|
10 | win.setBounds(desired);↵ | | 10 | win.setBounds(desired);↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
|
13 | win.removeComponentListener(this); | | 13 | win.removeComponentListener(this);
|
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) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (System.currentTimeMillis() - start < 1000) | | 1 | if (System.currentTimeMillis() - start < 1000) |
2 | Rectangle r = win.getBounds(); | | 2 | Rectangle r = win.getBounds(); |
3 | if (!windowOpened && r.equals(required)) | | 3 | if (!windowOpened && r.equals(required)) |
4 | | | 4 | |
5 | | | 5 | |
6 | Log.log(Log.DEBUG, GUIUtilities.class, "Window resize blocked: " + win.getBounds()); | | 6 | Log.log(Log.DEBUG, GUIUtilities.class, "Window resize blocked: " + win.getBounds()); |
7 | | | 7 | |
8 | win.removeComponentListener(this); | | 8 | win.removeComponentListener(this); |
Precondition Violations (0)
Row |
Violation |