XmlElement options = Config.getInstance().get("options").getElement(
"/options");
XmlElement gui = options.getElement("gui");
XmlElement fonts = gui.getElement("fonts");
if (fonts == null) {
fonts = gui.addSubElement("fonts");
}
// register interest on configuratin changes
fonts.addObserver(this);
XmlElement options = Config.getInstance().get("options").getElement(
"/options");
XmlElement gui = options.getElement("gui");
XmlElement fonts = gui.getElement("fonts");
if (fonts == null) {
fonts = gui.addSubElement("fonts");
}
// register interest on configuration changes
fonts.addObserver(this);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/text/TextEditorView.java
|
|
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/SignatureView.java
|
Method name: void TextEditorView(TextEditorController, HighlighterDocument)
|
|
Method name: void SignatureView(ComposerController)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | XmlElement options = Config.getInstance().get("options").getElement(↵ | | 1 | XmlElement options = Config.getInstance().get("options").getElement(↵
|
2 | "/options");↵ | | 2 | "/options");↵
|
3 | XmlElement gui = options.getElement("gui");↵ | | 3 | XmlElement gui = options.getElement("gui");↵
|
4 | XmlElement fonts = gui.getElement("fonts");↵ | | 4 | XmlElement fonts = gui.getElement("fonts");↵
|
|
5 | if (fonts == null) {↵ | | 5 | if (fonts == null) {↵
|
6 | fonts = gui.addSubElement("fonts");↵ | | 6 | fonts = gui.addSubElement("fonts");↵
|
7 | }↵ | | 7 | }↵
|
|
8 | // register interest on configuratin changes↵ | | 8 | // register interest on configuration changes↵
|
9 | fonts.addObserver(this); | | 9 | fonts.addObserver(this);
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 2.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | XmlElement options = Config.getInstance().get("options").getElement("/options"); | | 26 | XmlElement options = Config.getInstance().get("options").getElement("/options"); |
9 | XmlElement gui = options.getElement("gui"); | | 27 | XmlElement gui = options.getElement("gui"); |
10 | XmlElement fonts = gui.getElement("fonts"); | | 28 | XmlElement fonts = gui.getElement("fonts"); |
11 | if (fonts == null) | | 29 | if (fonts == null) |
12 | fonts = gui.addSubElement("fonts"); | | 30 | fonts = gui.addSubElement("fonts"); |
13 | fonts.addObserver(this); | | 31 | fonts.addObserver(this); |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.columba.mail.gui.composer.text.TextEditorView and org.columba.mail.gui.composer.SignatureView do not have a common superclass |