if (tempFile.exists()) {
if (JOptionPane.showConfirmDialog(FrameManager.getInstance()
.getActiveFrame(), "Overwrite File?",
"Warning", JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
break;
}
} else {
break;
}
if (tempFile.exists()) {
if (JOptionPane.showConfirmDialog(FrameManager.getInstance()
.getActiveFrame(), "Overwrite File?",
"Warning", JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
break;
}
} else {
break;
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/OpenAttachmentCommand.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/SaveAttachmentAsCommand.java
|
Method name: File getDestinationFile(MimeHeader)
|
|
Method name: File getDestinationFile(MimeHeader)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (tempFile.exists()) {↵ | | 1 | if (tempFile.exists()) {↵
|
2 | if (JOptionPane.showConfirmDialog(FrameManager.getInstance()↵ | | 2 | if (JOptionPane.showConfirmDialog(FrameManager.getInstance()↵
|
3 | .getActiveFrame(), "Overwrite File?",↵ | | 3 | .getActiveFrame(), "Overwrite File?",↵
|
4 | "Warning", JOptionPane.YES_NO_OPTION,↵ | | 4 | "Warning", JOptionPane.YES_NO_OPTION,↵
|
5 | JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {↵ | | 5 | JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {↵
|
6 | break;↵ | | |
|
7 | }↵ | | |
|
8 | } else {↵ | | |
|
9 | break;↵ | | |
|
10 | ↵ | | 6 | break;↵
|
| | | 7 | }↵
|
| | | 8 | } else {↵
|
| | | 9 | break;↵
|
11 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{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) | 0.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
18 | if (tempFile.exists()) | | 18 | if (tempFile.exists()) |
19 | if (JOptionPane.showConfirmDialog(FrameManager.getInstance().getActiveFrame(), "Overwrite File?", "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) | | 19 | if (JOptionPane.showConfirmDialog(FrameManager.getInstance().getActiveFrame(), "Overwrite File?", "Warning", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) |
20 | | | 20 | |
| | | | |
21 | | | 21 | |
Precondition Violations (4)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |
3 | Statement break; without innermost loop |
4 | Statement break; without innermost loop |