if("\n".equals(lineSep)) lineSeparator.setSelectedIndex(0); else if("\r\n".equals(lineSep)) lineSeparator.setSelectedIndex(1); else if("\r".equals(lineSep)) lineSeparator.setSelectedIndex(2); panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"), lineSeparator);
if("\n".equals(lineSep)) lineSeparator.setSelectedIndex(0); else if("\r\n".equals(lineSep)) lineSeparator.setSelectedIndex(1); else if("\r".equals(lineSep)) lineSeparator.setSelectedIndex(2); addComponent(jEdit.getProperty("options.general.lineSeparator"), lineSeparator);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/BufferOptions.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/GeneralOptionPane.java
Method name: void BufferOptions(View, Buffer) Method name: void _init()
Number of AST nodes: 7 Number of AST nodes: 7
1
if("\n".equals(lineSep))
1
if("\n".equals(lineSep))
2
			lineSeparator.setSelectedIndex(0);
2
			lineSeparator.setSelectedIndex(0);
3
		else if("\r\n".equals(lineSep))
3
		else if("\r\n".equals(lineSep))
4
			lineSeparator.setSelectedIndex(1);
4
			lineSeparator.setSelectedIndex(1);
5
		else if("\r".equals(lineSep))
5
		else if("\r".equals(lineSep))
6
			lineSeparator.setSelectedIndex(2);
6
			lineSeparator.setSelectedIndex(2);
7
		panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"),
7
		addComponent(jEdit.getProperty("options.general.lineSeparator"),
8
			lineSeparator);
8
			lineSeparator);
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    if ("\n".equals(lineSep))
    4
    if ("\n".equals(lineSep))
    17
    lineSeparator.setSelectedIndex(0);
    5
    lineSeparator.setSelectedIndex(0);
    18
    else if ("\r\n".equals(lineSep))
    6
    else if ("\r\n".equals(lineSep))
    19
    lineSeparator.setSelectedIndex(1);
    7
    lineSeparator.setSelectedIndex(1);
    20
    else if ("\r".equals(lineSep))
    8
    else if ("\r".equals(lineSep))
    21
    lineSeparator.setSelectedIndex(2);
    9
    lineSeparator.setSelectedIndex(2);
    22
    panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"), lineSeparator);
    22
    panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"), lineSeparator);
    10
    addComponent(jEdit.getProperty("options.general.lineSeparator"), lineSeparator);
    Differences
    Expression1Expression2Difference
    "buffer-options.lineSeparator""options.general.lineSeparator"LITERAL_VALUE_MISMATCH
    panelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"),lineSeparator) is a void method call, and thus it cannot be parameterized
    Expression addComponent(jEdit.getProperty("options.general.lineSeparator"),lineSeparator) is a void method call, and thus it cannot be parameterized
    10
    addComponent(jEdit.getProperty("options.general.lineSeparator"), lineSeparator);
    Precondition Violations (2)
    Row Violation
    1Expression panel.addComponent(jEdit.getProperty("buffer-options.lineSeparator"),lineSeparator) is a void method call, and thus it cannot be parameterized
    2Expression addComponent(jEdit.getProperty("options.general.lineSeparator"),lineSeparator) is a void method call, and thus it cannot be parameterized