File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/Save.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/SaveGraphics.java | |||
Method name: void doAction(ActionEvent)
|
Method name: void saveImage(JComponent)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | File f = new File(updateFile);↵ | 1 | File f = new File(filename);↵ | |
2 | if(f.exists()) {↵ | 2 | if(f.exists()) {↵ | |
3 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), ↵ | 3 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), ↵ | |
4 | JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$↵ | 4 | JMeterUtils.getResString("save_overwrite_existing_file"), // $NON-NLS-1$↵ | |
5 | JMeterUtils.getResString("save?"), // $NON-NLS-1$↵ | 5 | JMeterUtils.getResString("save?"), // $NON-NLS-1$↵ | |
6 | JOptionPane.YES_NO_OPTION,↵ | 6 | JOptionPane.YES_NO_OPTION,↵ | |
7 | JOptionPane.QUESTION_MESSAGE);↵ | 7 | JOptionPane.QUESTION_MESSAGE);↵ | |
8 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {↵ | 8 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) {↵ | |
9 | return ; // Do not save, user does not want to overwrite↵ | 9 | return ; // Do not save, user does not want to overwrite↵ | |
10 | }↵ | 10 | }↵ | |
11 | } | 11 | } | |
See real code fragment | See real code fragment |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 5 |
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 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20 | File f = new File(updateFile); |
| 7 | File f = new File(filename); | ||||||||||
21 | if (f.exists()) | 8 | if (f.exists()) | |||||||||||
22 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("save_overwrite_existing_file"), JMeterUtils.getResString("save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | 9 | int response = JOptionPane.showConfirmDialog(GuiPackage.getInstance().getMainFrame(), JMeterUtils.getResString("save_overwrite_existing_file"), JMeterUtils.getResString("save?"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); | |||||||||||
23 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) | 10 | if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.NO_OPTION) | |||||||||||
24 | return; |
| 11 | return; |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |