String wrap = buffer.getStringProperty("wrap"); if(wrap.equals("none")) this.wrap.setText("-"); else if(wrap.equals("hard")) this.wrap.setText("H"); else if(wrap.equals("soft")) this.wrap.setText("S");
String lineSep = buffer.getStringProperty("lineSeparator"); if("\n".equals(lineSep)) this.lineSep.setText("U"); else if("\r\n".equals(lineSep)) this.lineSep.setText("W"); else if("\r".equals(lineSep)) this.lineSep.setText("M");
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/StatusBar.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/StatusBar.java
Method name: void updateBufferStatus() Method name: void updateBufferStatus()
Number of AST nodes: 7 Number of AST nodes: 7
1
String wrap = buffer.getStringProperty("wrap");
1
String lineSep = buffer.getStringProperty("lineSeparator");
2
			if(wrap.equals("none"))
2
			if("\n".equals(lineSep))
3
				this.wrap.setText("-");
3
				this.lineSep.setText("U");
4
			else if(wrap.equals("hard"))
4
			else if("\r\n".equals(lineSep))
5
				this.wrap.setText("H");
5
				this.lineSep.setText("W");
6
			else if(wrap.equals("soft"))
6
			else if("\r".equals(lineSep))
7
				this.wrap.setText("S");
7
				this.lineSep.setText("M");
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)0.8
Clones locationClones are in the same method
Number of node comparisons29
  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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    String wrap = buffer.getStringProperty("wrap");
    3
    String wrap = buffer.getStringProperty("wrap");
    11
    String lineSep = buffer.getStringProperty("lineSeparator");
    Differences
    Expression1Expression2Difference
    wraplineSepVARIABLE_NAME_MISMATCH
    "wrap""lineSeparator"LITERAL_VALUE_MISMATCH
    11
    String lineSep = buffer.getStringProperty("lineSeparator");
    4
    if (wrap.equals("none"))
    4
    if (wrap.equals("none"))
    12
    if ("\n".equals(lineSep))
    Differences
    Expression1Expression2Difference
    "none"lineSepTYPE_COMPATIBLE_REPLACEMENT
    wrap"\n"TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if ("\n".equals(lineSep))
    5
    this.wrap.setText("-");
    5
    this.wrap.setText("-");
    13
    this.lineSep.setText("U");
    Differences
    Expression1Expression2Difference
    "-""U"LITERAL_VALUE_MISMATCH
    wraplineSepVARIABLE_NAME_MISMATCH
    13
    this.lineSep.setText("U");
    6
    else if (wrap.equals("hard"))
    6
    else if (wrap.equals("hard"))
    14
    else if ("\r\n".equals(lineSep))
    Differences
    Expression1Expression2Difference
    "hard"lineSepTYPE_COMPATIBLE_REPLACEMENT
    wrap"\r\n"TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    else if ("\r\n".equals(lineSep))
    7
    this.wrap.setText("H");
    7
    this.wrap.setText("H");
    15
    this.lineSep.setText("W");
    Differences
    Expression1Expression2Difference
    "H""W"LITERAL_VALUE_MISMATCH
    wraplineSepVARIABLE_NAME_MISMATCH
    15
    this.lineSep.setText("W");
    8
    else if (wrap.equals("soft"))
    8
    else if (wrap.equals("soft"))
    16
    else if ("\r".equals(lineSep))
    Differences
    Expression1Expression2Difference
    "soft"lineSepTYPE_COMPATIBLE_REPLACEMENT
    wrap"\r"TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16
    else if ("\r".equals(lineSep))
    9
    this.wrap.setText("S");
    9
    this.wrap.setText("S");
    17
    this.lineSep.setText("M");
    Differences
    Expression1Expression2Difference
    "S""M"LITERAL_VALUE_MISMATCH
    wraplineSepVARIABLE_NAME_MISMATCH
    17
    this.lineSep.setText("M");
    Precondition Violations (6)
    Row Violation
    1Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression lineSep cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression wrap cannot be parameterized, because it has dependencies to/from statements that will be extracted