if (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) { return null; } tempFile = fileChooser.getSelectedFile(); lastDir = tempFile.getParentFile(); 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 (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) { return null; } tempFile = fileChooser.getSelectedFile(); lastDir = tempFile.getParentFile(); 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: 8 Number of AST nodes: 8
1
if (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) {
1
if (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION) {
2
				return null;
3
			}
4
			
2
                return null;
3
            }
5
tempFile = fileChooser.getSelectedFile();
4
            tempFile = fileChooser.getSelectedFile();
6
			lastDir = tempFile.getParentFile();
5
            lastDir = tempFile.getParentFile();
7
			if (tempFile.exists()) {
6
            if (tempFile.exists()) {
8
				if (JOptionPane.showConfirmDialog(FrameManager.getInstance()
7
                if (JOptionPane.showConfirmDialog(FrameManager.getInstance()
9
						.getActiveFrame(), "Overwrite File?",
8
    					.getActiveFrame(), "Overwrite File?",
10
						"Warning", JOptionPane.YES_NO_OPTION,
9
                            "Warning", JOptionPane.YES_NO_OPTION,
11
						JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
10
                            JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
12
					break;
13
				}
14
			} else {
15
				break;
16
			
11
                    break;
12
                }
13
            } else {
14
                break;
17
}
15
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are in different classes having the same super class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.3
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    14
    if (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION)
    14
    if (fileChooser.showSaveDialog(null) != JFileChooser.APPROVE_OPTION)
    15
    return null;
    15
    return null;
    16
    tempFile = fileChooser.getSelectedFile();
    16
    tempFile = fileChooser.getSelectedFile();
    17
    lastDir = tempFile.getParentFile();
    17
    lastDir = tempFile.getParentFile();
    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
    break;
    20
    break;
    20
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    20
    break;
    else
    else
    21
    break;
    21
    break;
    21
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    21
    break;
    Precondition Violations (5)
    Row Violation
    1Statement break; without innermost loop
    2Statement break; without innermost loop
    3Statement break; without innermost loop
    4Statement break; without innermost loop
    5Not all possible execution flows end in a return statement