File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/EditSignatureAction.java | |||
Method name: String get(String)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Element child = getParentElement().getChild(key);↵ | |||
2 | if (child == null) {↵ | |||
3 | child = new Element(key);↵ | |||
4 | getParentElement().addContent(child↵ | 1 | File signature = identity.getSignature();↵ | |
2 | if( signature == null) {↵ | |||
3 | //Create the file↵ | |||
4 | signature = new File(System.getProperty("user.home"),".signature");↵ | |||
5 | }↵ | |||
6 | ↵ | |||
5 | );↵ | 7 | ColumbaDesktop.getInstance().openAndWait(signature);↵ | |
6 | }↵ | 8 | ↵ | |
7 | return child.getTextNormalize(↵ | 9 | // update signature -> will notify all listeners that signature changed↵ | |
8 | ); | 10 | identity.setSignature(signature); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | File signature = identity.getSignature(); | ||||||||||||||||
1 | Element child = getParentElement().getChild(key); | | ||||||||||||||||
2 | if (child == null) |
| 2 | if (signature == null) | ||||||||||||||
|
| 3 | signature = new File(System.getProperty("user.home"), ".signature"); | |||||||||||||||
3 | child = new Element(key); |
| | |||||||||||||||
4 | getParentElement().addContent(child); |
| | |||||||||||||||
| 4 | ColumbaDesktop.getInstance().openAndWait(signature); | ||||||||||||||||
|
| 5 | identity.setSignature(signature); | |||||||||||||||
5 | return child.getTextNormalize(); |
| |
Row | Violation |
---|---|
1 | Type org.jdom.Element of variable child does not match with type java.io.File of variable signature |
2 | Unmatched statement signature=new File(System.getProperty("user.home"),".signature"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement child=new Element(key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement getParentElement().addContent(child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement identity.setSignature(signature); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return child.getTextNormalize(); |
7 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |