File location = fc.getSelectedFile();
Profile p = new Profile(location.getName(), location);
// add profile to profiles.xml
ProfileManager.getInstance().addProfile(p);
// add to listmodel
model.addElement(p.getName());
// select new item
list.setSelectedValue(p.getName(), true);
File location = fc.getSelectedFile();
Profile p = new Profile(location.getName(), location);
// add profile to profiles.xml
ProfileManager.getInstance().addProfile(p);
// add to listmodel
model.addElement(p.getName());
// select new item
list.setSelectedValue(p.getName(), true);
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: 5
|
|
Number of AST nodes: 5
|
|
1 | File location = fc.getSelectedFile();↵ | | 1 | File location = fc.getSelectedFile();↵
|
2 | Profile p = new Profile(location.getName(), location);↵ | | 2 | Profile p = new Profile(location.getName(), location);↵
|
3 | // add profile to profiles.xml↵ | | 3 | // add profile to profiles.xml↵
|
4 | ProfileManager.getInstance().addProfile(p);↵ | | 4 | ProfileManager.getInstance().addProfile(p);↵
|
5 | ↵ | | |
|
6 | ↵ | | |
|
7 | // add to listmodel↵ | | 5 | // add to listmodel↵
|
8 | model.addElement(p.getName());↵ | | 6 | model.addElement(p.getName());↵
|
9 | // select new item↵ | | 7 | // select new item↵
|
10 | list.setSelectedValue(p.getName(), true); | | 8 | list.setSelectedValue(p.getName(), true);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | File location = fc.getSelectedFile(); | | 12 | File location = fc.getSelectedFile(); |
13 | Profile p = new Profile(location.getName(), location); | | 13 | Profile p = new Profile(location.getName(), location); |
14 | ProfileManager.getInstance().addProfile(p); | | 14 | ProfileManager.getInstance().addProfile(p); |
15 | model.addElement(p.getName()); | | 15 | model.addElement(p.getName()); |
16 | list.setSelectedValue(p.getName(), true); | | 16 | list.setSelectedValue(p.getName(), true); |
Precondition Violations (0)
Row |
Violation |