FormatInfo info = event.getInfo(); if (info.isHeading1()) { selectMenuItem(HTML.Tag.H1); } else if (info.isHeading2()) { selectMenuItem(HTML.Tag.H2); } else if (info.isHeading3()) { selectMenuItem(HTML.Tag.H3); } else if (info.isPreformattet()) { selectMenuItem(HTML.Tag.PRE); } else if (info.isAddress()) { selectMenuItem(HTML.Tag.ADDRESS); } else { // select the "Normal" entry as default selectMenuItem(HTML.Tag.P); }
FormatInfo info = event.getInfo(); if (info.isHeading1()) { selectInParagraphComboBox(HTML.Tag.H1); } else if (info.isHeading2()) { selectInParagraphComboBox(HTML.Tag.H2); } else if (info.isHeading3()) { selectInParagraphComboBox(HTML.Tag.H3); } else if (info.isPreformattet()) { selectInParagraphComboBox(HTML.Tag.PRE); } else if (info.isAddress()) { selectInParagraphComboBox(HTML.Tag.ADDRESS); } else { // select the "Normal" entry as default selectInParagraphComboBox(HTML.Tag.P); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/html/action/ParagraphMenu.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/html/HtmlToolbar.java
Method name: void formatChanged(FormatChangedEvent) Method name: void formatChanged(FormatChangedEvent)
Number of AST nodes: 12 Number of AST nodes: 12
1
FormatInfo info = event.getInfo();
1
FormatInfo info = event.getInfo();
2
		if (info.isHeading1()) {
2
		if (info.isHeading1()) {
3
			selectMenuItem(HTML.Tag.H1);
3
			selectInParagraphComboBox(HTML.Tag.H1);
4
		} else if (info.isHeading2()) {
4
		} else if (info.isHeading2()) {
5
			selectMenuItem(HTML.Tag.H2);
5
			selectInParagraphComboBox(HTML.Tag.H2);
6
		} else if (info.isHeading3()) {
6
		} else if (info.isHeading3()) {
7
			selectMenuItem(HTML.Tag.H3);
7
			selectInParagraphComboBox(HTML.Tag.H3);
8
		} else if (info.isPreformattet()) {
8
		} else if (info.isPreformattet()) {
9
			selectMenuItem(HTML.Tag.PRE);
9
			selectInParagraphComboBox(HTML.Tag.PRE);
10
		} else if (info.isAddress()) {
10
		} else if (info.isAddress()) {
11
			selectMenuItem(HTML.Tag.ADDRESS);
11
			selectInParagraphComboBox(HTML.Tag.ADDRESS);
12
		} else {
12
		} else {
13
			// select the "Normal" entry as default
13
			// select the "Normal" entry as default
14
			selectMenuItem(HTML.Tag.P);
14
			selectInParagraphComboBox(HTML.Tag.P);
15
		}
15
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)1.1
Clones locationClones are in different classes having the same super class
Number of node comparisons84
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    FormatInfo info = event.getInfo();
    1
    FormatInfo info = event.getInfo();
    2
    if (info.isHeading1())
    2
    if (info.isHeading1())
    3
    selectMenuItem(HTML.Tag.H1);
    3
    selectMenuItem(HTML.Tag.H1);
    3
    selectInParagraphComboBox(HTML.Tag.H1);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    3
    selectInParagraphComboBox(HTML.Tag.H1);
    4
    else if (info.isHeading2())
    4
    else if (info.isHeading2())
    5
    selectMenuItem(HTML.Tag.H2);
    5
    selectMenuItem(HTML.Tag.H2);
    5
    selectInParagraphComboBox(HTML.Tag.H2);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    5
    selectInParagraphComboBox(HTML.Tag.H2);
    6
    else if (info.isHeading3())
    6
    else if (info.isHeading3())
    7
    selectMenuItem(HTML.Tag.H3);
    7
    selectMenuItem(HTML.Tag.H3);
    7
    selectInParagraphComboBox(HTML.Tag.H3);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    7
    selectInParagraphComboBox(HTML.Tag.H3);
    8
    else if (info.isPreformattet())
    8
    else if (info.isPreformattet())
    9
    selectMenuItem(HTML.Tag.PRE);
    9
    selectMenuItem(HTML.Tag.PRE);
    9
    selectInParagraphComboBox(HTML.Tag.PRE);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.PRE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    9
    selectInParagraphComboBox(HTML.Tag.PRE);
    10
    else if (info.isAddress())
    10
    else if (info.isAddress())
    11
    selectMenuItem(HTML.Tag.ADDRESS);
    11
    selectMenuItem(HTML.Tag.ADDRESS);
    11
    selectInParagraphComboBox(HTML.Tag.ADDRESS);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    11
    selectInParagraphComboBox(HTML.Tag.ADDRESS);
    else
    else
    12
    selectMenuItem(HTML.Tag.P);
    12
    selectMenuItem(HTML.Tag.P);
    12
    selectInParagraphComboBox(HTML.Tag.P);
    Differences
    Expression1Expression2Difference
    selectMenuItemselectInParagraphComboBoxMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.P) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method selectInParagraphComboBox
    Expression selectMenuItem(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    Expression selectInParagraphComboBox(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    12
    selectInParagraphComboBox(HTML.Tag.P);
    Precondition Violations (19)
    Row Violation
    1Expression selectInParagraphComboBox(HTML.Tag.H1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression selectMenuItem(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    3Expression selectInParagraphComboBox(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    4Expression selectInParagraphComboBox(HTML.Tag.H2) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression selectMenuItem(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    6Expression selectInParagraphComboBox(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    7Expression selectInParagraphComboBox(HTML.Tag.H3) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression selectMenuItem(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    9Expression selectInParagraphComboBox(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    10Expression selectInParagraphComboBox(HTML.Tag.PRE) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression selectMenuItem(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    12Expression selectInParagraphComboBox(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    13Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression selectMenuItem(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    15Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    16Expression selectInParagraphComboBox(HTML.Tag.P) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression selectMenuItem(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    18Expression selectInParagraphComboBox(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    19The refactoring of the clones is infeasible, because classes org.columba.mail.gui.composer.html.action.ParagraphMenu and org.columba.mail.gui.composer.html.HtmlToolbar do not have a common superclass