String action = e.getActionCommand(); if (action.equals("OK")) { bool = true; setVisible(false); } else if (action.equals("CANCEL")) { bool = false; setVisible(false); } else if (action.equals("NEW")) { /* * EditFolderDialog dialog = treeViewer.getEditFolderDialog( "New * Folder" ); dialog.showDialog(); String name; if ( * dialog.success() == true ) { // ok pressed name = * dialog.getName(); } else { // cancel pressed return; } * treeViewer.getFolderTree().addUserFolder( getSelectedFolder(), * name ); //TreeNodeEvent updateEvent2 = new TreeNodeEvent( * getSelectedFolder(), TreeNodeEvent.STRUCTURE_CHANGED ); * //treeViewer.mainInterface.crossbar.fireTreeNodeChanged(updateEvent2); */ }
String action = ev.getActionCommand(); if (action.equals("OK")) { success = true; setVisible(false); } else if (action.equals("CANCEL")) { success = false; setVisible(false); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/tree/util/SelectAddressbookFolderDialog.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/dialog/DateChooserDialog.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 8 Number of AST nodes: 7
1
String action = e.getActionCommand();
1
String action = ev.getActionCommand();
2
		if (action.equals("OK")) {
2
        if (action.equals("OK")) {
3
			bool = true;
4
			setVisible(false);
5
		} else if (action.equals("CANCEL")) {
6
			bool = false;
7
			setVisible(false);
8
		} else if (action.equals("NEW")) {
9
			/*
10
			 * EditFolderDialog dialog = treeViewer.getEditFolderDialog( "New
11
			 * Folder" ); dialog.showDialog(); String name; if (
12
			 * dialog.
3
            success = true;
4
            setVisible(false);
5
        } else if (action.equals("CANCEL")) {
13
success() == true ) { // ok pressed name =
6
            success
14
			 * dialog.getName(); } else { // cancel pressed return; }
15
			 * treeViewer.getFolderTree().addUserFolder( getSelectedFolder(),
16
			 * name ); //TreeNodeEvent updateEvent2 = new TreeNodeEvent(
17
			 * getSelectedFolder(), TreeNodeEvent.STRUCTURE_CHANGED );
18
			 * //treeViewer.mainInterface.crossbar.fireTreeNodeChanged(updateEvent2);
19
			 */
20
		
7
 = false;
8
            setVisible(false);
21
}
9
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in different classes having the same super class
Number of node comparisons7
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment7
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    String action = e.getActionCommand();
    1
    String action = e.getActionCommand();
    1
    String action = ev.getActionCommand();
    Differences
    Expression1Expression2Difference
    eevVARIABLE_NAME_MISMATCH
    1
    String action = ev.getActionCommand();
                                                        
    2
    if (action.equals("OK"))
    Preondition Violations
    Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    if (action.equals("OK"))
                                    
    3
    success = true;
    Preondition Violations
    Unmatched statement success=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    success = true;
                                              
    4
    setVisible(false);
                                                                
    5
    else if (action.equals("CANCEL"))
    Preondition Violations
    Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    else if (action.equals("CANCEL"))
                                      
    6
    success = false;
    Preondition Violations
    Unmatched statement success=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    success = false;
                                              
    7
    setVisible(false);
    2
    if (action.equals("OK"))
    2
    if (action.equals("OK"))
    Preondition Violations
    Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                        
    3
    bool = true;
    3
    bool = true;
    Preondition Violations
    Unmatched statement bool=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                              
    4
    setVisible(false);
                                              
    5
    else if (action.equals("CANCEL"))
    5
    else if (action.equals("CANCEL"))
    Preondition Violations
    Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
    6
    bool = false;
    6
    bool = false;
    Preondition Violations
    Unmatched statement bool=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                
    7
    setVisible(false);
                                              
    8
    else if (action.equals("NEW"))
    8
    else if (action.equals("NEW"))
    Preondition Violations
    Unmatched statement if(action.equals("NEW")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                          
    Precondition Violations (9)
    Row Violation
    1Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement success=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement success=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement bool=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement bool=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement if(action.equals("NEW")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted