if (url == null) { url = HelpSet.findHelpSet(loader, helpsetName, ".hs", Locale .getDefault()); if (url == null) { // could not find it! JOptionPane.showMessageDialog(FrameManager.getInstance() .getActiveFrame(), "HelpSet not found", "Error", JOptionPane.ERROR_MESSAGE); return; } }
configPath = configPath.getParentFile(); if (configPath == null) { JOptionPane .showMessageDialog(dialog, MailResourceLoader .getString("dialog", IncomingItem.PASSWORD, "warn_save_msg"), MailResourceLoader.getString("dialog", IncomingItem.PASSWORD, "warn_save_title"), JOptionPane.WARNING_MESSAGE); return; }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/help/HelpManager.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/IncomingServerPanel.java
Method name: void HelpManager() Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 5 Number of AST nodes: 4
1
if (url == null) {
2
			url = HelpSet.findHelpSet(loader, helpsetName, ".hs", Locale
3
					.getDefault());
1
configPath = configPath.getParentFile();
4
			if (url == null) {
2
					if (configPath == null) {
5
				// could not find it!
3
				
6
				JOptionPane
4
		JOptionPane
7
.showMessageDialog(FrameManager.getInstance()
5
								.showMessageDialog(
8
						.getActiveFrame(), "HelpSet not found"
6
dialog, MailResourceLoader
7
										.getString("dialog",
8
												IncomingItem.PASSWORD,
9
												"warn_save_msg"),
10
										MailResourceLoader.getString("dialog",
9
,
11
												IncomingItem.PASSWORD,
10
						"Error", 
12
												"warn_save_title"),
11
JOptionPane.ERROR_MESSAGE);
13
										JOptionPane.WARNING_MESSAGE);
12
				return;
14
						return;
13
			}
15
			
14
		}
16
		}
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.1
Clones locationClones are in different classes
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    url = HelpSet.findHelpSet(loader, helpsetName, ".hs", Locale.getDefault());
                                                                                                                                                      
                                                                                        
    47
    configPath = configPath.getParentFile();
    Preondition Violations
    Unmatched statement configPath=configPath.getParentFile(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    47
    configPath = configPath.getParentFile();
    5
    if (url == null)
    5
    if (url == null)
    48
    if (configPath == null)
    Differences
    Expression1Expression2Difference
    urlconfigPathVARIABLE_NAME_MISMATCH
    java.net.URLjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.net.URL of variable url does not match with type java.io.File of variable configPath
    • Make classes java.net.URL and java.io.File extend a common superclass
    48
    if (configPath == null)
    6
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "HelpSet not found", "Error", JOptionPane.ERROR_MESSAGE);
    6
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "HelpSet not found", "Error", JOptionPane.ERROR_MESSAGE);
    49
    JOptionPane.showMessageDialog(dialog, MailResourceLoader.getString("dialog", IncomingItem.PASSWORD, "warn_save_msg"), MailResourceLoader.getString("dialog", IncomingItem.PASSWORD, "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    Differences
    Expression1Expression2Difference
    FrameManager.getInstance().getActiveFrame()dialogTYPE_COMPATIBLE_REPLACEMENT
    "HelpSet not found"MailResourceLoader.getString("dialog",IncomingItem.PASSWORD,"warn_save_msg")TYPE_COMPATIBLE_REPLACEMENT
    "Error"MailResourceLoader.getString("dialog",IncomingItem.PASSWORD,"warn_save_title")TYPE_COMPATIBLE_REPLACEMENT
    ERROR_MESSAGEWARNING_MESSAGEVARIABLE_NAME_MISMATCH
    49
    JOptionPane.showMessageDialog(dialog, MailResourceLoader.getString("dialog", IncomingItem.PASSWORD, "warn_save_msg"), MailResourceLoader.getString("dialog", IncomingItem.PASSWORD, "warn_save_title"), JOptionPane.WARNING_MESSAGE);
    7
    return;
    7
    return;
    50
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    50
    return;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement configPath=configPath.getParentFile(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type java.net.URL of variable url does not match with type java.io.File of variable configPath
    3Conditional return;
    4Conditional return;