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); }
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); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/html/HtmlToolbar.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/html/action/ParagraphMenu.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
			selectInParagraphComboBox(HTML.Tag.H1);
3
			selectMenuItem(HTML.Tag.H1);
4
		} else if (info.isHeading2()) {
4
		} else if (info.isHeading2()) {
5
			selectInParagraphComboBox(HTML.Tag.H2);
5
			selectMenuItem(HTML.Tag.H2);
6
		} else if (info.isHeading3()) {
6
		} else if (info.isHeading3()) {
7
			selectInParagraphComboBox(HTML.Tag.H3);
7
			selectMenuItem(HTML.Tag.H3);
8
		} else if (info.isPreformattet()) {
8
		} else if (info.isPreformattet()) {
9
			selectInParagraphComboBox(HTML.Tag.PRE);
9
			selectMenuItem(HTML.Tag.PRE);
10
		} else if (info.isAddress()) {
10
		} else if (info.isAddress()) {
11
			selectInParagraphComboBox(HTML.Tag.ADDRESS);
11
			selectMenuItem(HTML.Tag.ADDRESS);
12
		} else {
12
		} else {
13
			// select the "Normal" entry as default
13
			// select the "Normal" entry as default
14
			selectInParagraphComboBox(HTML.Tag.P);
14
			selectMenuItem(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.3
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)3.9
    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
    selectInParagraphComboBox(HTML.Tag.H1);
    3
    selectInParagraphComboBox(HTML.Tag.H1);
    3
    selectMenuItem(HTML.Tag.H1);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    3
    selectMenuItem(HTML.Tag.H1);
    4
    else if (info.isHeading2())
    4
    else if (info.isHeading2())
    5
    selectInParagraphComboBox(HTML.Tag.H2);
    5
    selectInParagraphComboBox(HTML.Tag.H2);
    5
    selectMenuItem(HTML.Tag.H2);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    5
    selectMenuItem(HTML.Tag.H2);
    6
    else if (info.isHeading3())
    6
    else if (info.isHeading3())
    7
    selectInParagraphComboBox(HTML.Tag.H3);
    7
    selectInParagraphComboBox(HTML.Tag.H3);
    7
    selectMenuItem(HTML.Tag.H3);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    7
    selectMenuItem(HTML.Tag.H3);
    8
    else if (info.isPreformattet())
    8
    else if (info.isPreformattet())
    9
    selectInParagraphComboBox(HTML.Tag.PRE);
    9
    selectInParagraphComboBox(HTML.Tag.PRE);
    9
    selectMenuItem(HTML.Tag.PRE);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    9
    selectMenuItem(HTML.Tag.PRE);
    10
    else if (info.isAddress())
    10
    else if (info.isAddress())
    11
    selectInParagraphComboBox(HTML.Tag.ADDRESS);
    11
    selectInParagraphComboBox(HTML.Tag.ADDRESS);
    11
    selectMenuItem(HTML.Tag.ADDRESS);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    11
    selectMenuItem(HTML.Tag.ADDRESS);
    else
    else
    12
    selectInParagraphComboBox(HTML.Tag.P);
    12
    selectInParagraphComboBox(HTML.Tag.P);
    12
    selectMenuItem(HTML.Tag.P);
    Differences
    Expression1Expression2Difference
    selectInParagraphComboBoxselectMenuItemMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression selectInParagraphComboBox(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    Expression selectMenuItem(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    12
    selectMenuItem(HTML.Tag.P);
    Precondition Violations (12)
    Row Violation
    1Expression selectInParagraphComboBox(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    2Expression selectMenuItem(HTML.Tag.H1) is a void method call, and thus it cannot be parameterized
    3Expression selectInParagraphComboBox(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    4Expression selectMenuItem(HTML.Tag.H2) is a void method call, and thus it cannot be parameterized
    5Expression selectInParagraphComboBox(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    6Expression selectMenuItem(HTML.Tag.H3) is a void method call, and thus it cannot be parameterized
    7Expression selectInParagraphComboBox(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    8Expression selectMenuItem(HTML.Tag.PRE) is a void method call, and thus it cannot be parameterized
    9Expression selectInParagraphComboBox(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    10Expression selectMenuItem(HTML.Tag.ADDRESS) is a void method call, and thus it cannot be parameterized
    11Expression selectInParagraphComboBox(HTML.Tag.P) is a void method call, and thus it cannot be parameterized
    12Expression selectMenuItem(HTML.Tag.P) is a void method call, and thus it cannot be parameterized