if (action.equals("SAVE")) { if (!storePasswordCheckBox.isSelected()) { return; } else { File configPath = DefaultConfigDirectory.getInstance().getCurrentPath(); File defaultConfigPath = DefaultConfigDirectory.getDefaultPath(); while (!configPath.equals(defaultConfigPath)) { configPath = configPath.getParentFile(); if (configPath == null) { JOptionPane.showMessageDialog(dialog, MailResourceLoader.getString("dialog", "password", "warn_save_msg"), MailResourceLoader.getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE); return; } } } }
if (action.equals("SAVE")) { if (!checkbox.isSelected()) { return; } else { File configPath = DefaultConfigDirectory.getInstance().getCurrentPath(); File defaultConfigPath = DefaultConfigDirectory.getDefaultPath(); while (!configPath.equals(defaultConfigPath)) { configPath = configPath.getParentFile(); if (configPath == null) { JOptionPane.showMessageDialog(this, MailResourceLoader .getString("dialog", "password", "warn_save_msg"), MailResourceLoader .getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE); return; } } } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/OutgoingServerPanel.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/util/PasswordDialog.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (action.equals("SAVE")) {
1
if (action.equals("SAVE")) {
2
			if (!storePasswordCheckBox.isSelected()) {
2
			if (!checkbox.isSelected()) {
3
				return;
3
				return;
4
			} else {
4
			} else {
5
				File configPath = DefaultConfigDirectory.getInstance().getCurrentPath();
5
				File configPath = DefaultConfigDirectory.getInstance().getCurrentPath();
6
				File defaultConfigPath = DefaultConfigDirectory.getDefaultPath();
6
				File defaultConfigPath = DefaultConfigDirectory.getDefaultPath();
7
				while (!configPath.equals(defaultConfigPath)) {
7
				while (!configPath.equals(defaultConfigPath)) {
8
					configPath = configPath.getParentFile();
8
					configPath = configPath.getParentFile();
9
					if (configPath == null) {
9
					if (configPath == null) {
10
						JOptionPane.showMessageDialog(dialog,
10
						JOptionPane.showMessageDialog(
11
								MailResourceLoader
11
this, MailResourceLoader
12
.getString("dialog",
12
								.getString("dialog",
13
										"password", 
13
 "password",
14
"warn_save_msg"),
14
										"warn_save_msg"),
15
								MailResourceLoader
15
 MailResourceLoader
16
.getString("dialog",
16
								.getString("dialog",
17
										"password", 
17
 "password",
18
"warn_save_title"),
18
										"warn_save_title"),
19
								JOptionPane.WARNING_MESSAGE);
19
								JOptionPane.WARNING_MESSAGE);
20
						return;
20
						return;
21
					}
21
					}
22
				}
22
				}
23
			}
23
			}
24
		}
24
		}
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    else if (action.equals("SAVE"))
    9
    else if (action.equals("SAVE"))
    23
    if (!storePasswordCheckBox.isSelected())
    23
    if (!storePasswordCheckBox.isSelected())
    10
    if (!checkbox.isSelected())
    Differences
    Expression1Expression2Difference
    storePasswordCheckBoxcheckboxVARIABLE_NAME_MISMATCH
    10
    if (!checkbox.isSelected())
    24
    return;
    24
    return;
    11
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    11
    return;
    else
    else
    25
    File configPath = DefaultConfigDirectory.getInstance().getCurrentPath();
    12
    File configPath = DefaultConfigDirectory.getInstance().getCurrentPath();
    26
    File defaultConfigPath = DefaultConfigDirectory.getDefaultPath();
    13
    File defaultConfigPath = DefaultConfigDirectory.getDefaultPath();
    27
    while (!configPath.equals(defaultConfigPath))
    14
    while (!configPath.equals(defaultConfigPath))
    28
    configPath = configPath.getParentFile();
    15
    configPath = configPath.getParentFile();
    29
    if (configPath == null)
    16
    if (configPath == null)
    30
    JOptionPane.showMessageDialog(dialog, MailResourceLoader.getString("dialog", "password", "warn_save_msg"), MailResourceLoader.getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    30
    JOptionPane.showMessageDialog(dialog, MailResourceLoader.getString("dialog", "password", "warn_save_msg"), MailResourceLoader.getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    17
    JOptionPane.showMessageDialog(this, MailResourceLoader.getString("dialog", "password", "warn_save_msg"), MailResourceLoader.getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    Differences
    Expression1Expression2Difference
    dialogthisTYPE_COMPATIBLE_REPLACEMENT
    17
    JOptionPane.showMessageDialog(this, MailResourceLoader.getString("dialog", "password", "warn_save_msg"), MailResourceLoader.getString("dialog", "password", "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    31
    return;
    31
    return;
    18
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    18
    return;
    Precondition Violations (4)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Conditional return;
    4Conditional return;