if (action.equals("EDIT")) { String inputValue = JOptionPane.showInputDialog( GlobalResourceLoader.getString(RESOURCE_PATH, "profiles", "enter_name"), selection); if (inputValue == null) { return; } // rename profile in profiles.xml ProfileManager.getInstance().renameProfile(selection, inputValue); // modify listmodel model.setElementAt(inputValue, model.indexOf(selection)); selection = inputValue; }
if (p != null) { int n = JOptionPane.showConfirmDialog(this, GlobalResourceLoader.getString(RESOURCE_PATH, "profiles", "confirmDelete.msg"), GlobalResourceLoader.getString(RESOURCE_PATH, "profiles", "confirmDelete.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (n == JOptionPane.NO_OPTION) { return; } ProfileManager.getInstance().removeProfile(selection); model.removeElement(selection); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileChooserDialog.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManagerDialog.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 7 Number of AST nodes: 6
1
if (action.equals("EDIT")) {
1
if (
2
            String inputValue
2
p != null) {
3
 = JOptionPane.showInputDialog(
3
					int n = JOptionPane.show
4
                
4
ConfirmDialog(this,
5
GlobalResourceLoader.getString(RESOURCE_PATH, 
5
							GlobalResourceLoader.getString(RESOURCE_PATH,
6
"profiles",
6
									"profiles",
7
                "enter_name"), selection);
8
            
9
            if (inputValue == null) {
10
                return;
11
            }
12
            
13
            // rename profile in profiles.xml
14
            
7
 "confirmDelete.msg"),
8
							GlobalResourceLoader.getString(RESOURCE_PATH,
9
									"profiles", "confirmDelete.title"),
10
							JOptionPane.YES_NO_OPTION,
11
							JOptionPane.QUESTION_MESSAGE);
12
					if (n == JOptionPane.NO_OPTION) {
13
						return;
14
					}
15
ProfileManager.getInstance().renameProfile(selection, inputValue);
15
					ProfileManager.getInstance().removeProfile(selection
16
            
17
            // modify listmodel
18
            model.setElementAt(inputValue, model.indexOf
16
);
19
(selection));
17
					model.removeElement(selection);
20
            selection = inputValue;
21
        
22
}
18
				}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons1