if(f.exists()) {
int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(),
JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$
JMeterUtils.getResString("save?"), // $NON-NLS-1$
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {
return ; // Do not save, user does not want to overwrite
}
}
if(f.exists()) {
int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(),
JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$
JMeterUtils.getResString("save?"), // $NON-NLS-1$
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {
return ; // Do not save, user does not want to overwrite
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/SaveGraphics.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/Save.java
|
Method name: void saveImage(JComponent)
|
|
Method name: void doAction(ActionEvent)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if(f.exists()) {↵ | | 1 | if(f.exists()) {↵
|
2 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), ↵ | | 2 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), ↵
|
3 | JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$↵ | | 3 | JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$↵
|
4 | JMeterUtils.getResString("save?"), // $NON-NLS-1$↵ | | 4 | JMeterUtils.getResString("save?"), // $NON-NLS-1$↵
|
5 | JOptionPane.YES_NO_OPTION,↵ | | 5 | JOptionPane.YES_NO_OPTION,↵
|
6 | JOptionPane.QUESTION_MESSAGE);↵ | | 6 | JOptionPane.QUESTION_MESSAGE);↵
|
7 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {↵ | | 7 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {↵
|
8 | return ; // Do not save, user does not want to overwrite↵ | | 8 | return ; // Do not save, user does not want to overwrite↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 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.3 |
Clones location | Clones are in different classes |
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) | 1.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (f.exists()) | | 21 | if (f.exists()) |
9 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("save_overwrite_existing_file"), JMeterUtils.getResString("save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | | 22 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("save_overwrite_existing_file"), JMeterUtils.getResString("save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); |
10 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) | | 23 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) |
11 | | | 24 | |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |