if (SwingUtilities.isEventDispatchThread()) {
if (s_log.isDebugEnabled()) {
s_log.debug("breathing: ignoring request to sleep the event dispatch thread");
}
return;
}
synchronized(this) {
try
{
wait(50);
}
catch (InterruptedException e)
{
if (s_log.isInfoEnabled()) {
s_log.info("breathing: Interrupted", e);
}
}
}
if (SwingUtilities.isEventDispatchThread())
{
if (s_log.isDebugEnabled())
{
s_log.debug("breathing: ignoring request to sleep the event dispatch thread");
}
return;
}
synchronized (this)
{
try
{
wait(50);
}
catch (InterruptedException e)
{
if (s_log.isInfoEnabled())
{
s_log.info("breathing: Interrupted", e);
}
}
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfo.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/installer/ArtifactInstallerImpl.java
|
Method name: void breathing()
|
|
Method name: void breathing()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (SwingUtilities.isEventDispatchThread()) {↵ | | 1 | if (SwingUtilities.isEventDispatchThread())↵
|
2 | ↵ | | |
|
| | | 2 | {↵
|
3 | if (s_log.isDebugEnabled()) {↵ | | 3 | if (s_log.isDebugEnabled())↵
|
4 | ↵ | | |
|
| | | 4 | {↵
|
5 | s_log.debug("breathing: ignoring request to sleep the event dispatch thread");↵ | | 5 | s_log.debug("breathing: ignoring request to sleep the event dispatch thread");↵
|
6 | }↵ | | 6 | }↵
|
7 | return;↵ | | 7 | return;↵
|
8 | }↵ | | |
|
9 | ↵ | | 8 | }↵
|
10 | synchronized(this) {↵ | | 9 | synchronized (this)↵
|
11 | try↵ | | |
|
12 | {↵ | | |
|
13 | wait(50);↵ | | |
|
14 | }↵ | | |
|
15 | ↵ | | |
|
| | | 10 | {↵
|
| | | 11 | try↵
|
| | | 12 | {↵
|
| | | 13 | wait(50);↵
|
| | | 14 | }↵
|
16 | catch (InterruptedException e)↵ | | 15 | catch (InterruptedException e)↵
|
17 | {↵ | | 16 | ↵
|
18 | ↵ | | 17 | {↵
|
19 | if (s_log.isInfoEnabled()) {↵ | | 18 | if (s_log.isInfoEnabled())↵
|
20 | ↵ | | |
|
| | | 19 | {↵
|
21 | s_log.info("breathing: Interrupted", e);↵ | | 20 | s_log.info("breathing: Interrupted", e);↵
|
22 | }↵ | | 21 | ↵
|
23 | }↵ | | |
|
24 | ↵ | | 22 | }↵
|
| | | 23 | }↵
|
25 | } | | 24 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | try | | 6 | try |
7 | | | 7 | |
Precondition Violations (0)
Row |
Violation |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (SwingUtilities.isEventDispatchThread()) | | 1 | if (SwingUtilities.isEventDispatchThread()) |
2 | if (s_log.isDebugEnabled()) | | 2 | if (s_log.isDebugEnabled()) |
3 | s_log.debug("breathing: ignoring request to sleep the event dispatch thread"); | | 3 | s_log.debug("breathing: ignoring request to sleep the event dispatch thread"); |
4 | | | 4 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |