String str11, str12; if(sortByName) { str11 = buffer.getName(); str12 = buffer.getDirectory(); } else { str11 = buffer.getDirectory(); str12 = buffer.getName(); }
String str21, str22; if(sortByName) { str21 = _buffer.getName(); str22 = _buffer.getDirectory(); } else { str21 = _buffer.getDirectory(); str22 = _buffer.getName(); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/jEdit.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/jEdit.java
Method name: void addBufferToList(Buffer) Method name: void addBufferToList(Buffer)
Number of AST nodes: 6 Number of AST nodes: 6
1
String str11, str12;
1
String str21, str22;
2
				if(sortByName)
2
					if(sortByName)
3
				{
3
					{
4
					str11 = buffer.getName();
4
						str21 = _buffer.getName();
5
					str12 = buffer.getDirectory();
5
						str22 = _buffer.getDirectory();
6
				}
6
					}
7
				else
7
					else
8
				{
8
					{
9
					str11 = buffer.getDirectory();
9
						str21 = _buffer.getDirectory();
10
					str12 = buffer.getName();
10
						str22 = _buffer.getName();
11
				}
11
					}
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.2
Clones locationClones are in the same method
Number of node comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    String str11, str12;
    19
    String str11, str12;
    27
    String str21, str22;
    Differences
    Expression1Expression2Difference
    str11str21VARIABLE_NAME_MISMATCH
    str12str22VARIABLE_NAME_MISMATCH
    27
    String str21, str22;
    20
    if (sortByName)
    28
    if (sortByName)
    21
    str11 = buffer.getName();
    21
    str11 = buffer.getName();
    29
    str21 = _buffer.getName();
    Differences
    Expression1Expression2Difference
    str11str21VARIABLE_NAME_MISMATCH
    buffer_bufferVARIABLE_NAME_MISMATCH
    29
    str21 = _buffer.getName();
    22
    str12 = buffer.getDirectory();
    22
    str12 = buffer.getDirectory();
    30
    str22 = _buffer.getDirectory();
    Differences
    Expression1Expression2Difference
    str12str22VARIABLE_NAME_MISMATCH
    buffer_bufferVARIABLE_NAME_MISMATCH
    30
    str22 = _buffer.getDirectory();
    else
    else
    23
    str11 = buffer.getDirectory();
    23
    str11 = buffer.getDirectory();
    31
    str21 = _buffer.getDirectory();
    Differences
    Expression1Expression2Difference
    str11str21VARIABLE_NAME_MISMATCH
    buffer_bufferVARIABLE_NAME_MISMATCH
    31
    str21 = _buffer.getDirectory();
    24
    str12 = buffer.getName();
    24
    str12 = buffer.getName();
    32
    str22 = _buffer.getName();
    Differences
    Expression1Expression2Difference
    str12str22VARIABLE_NAME_MISMATCH
    buffer_bufferVARIABLE_NAME_MISMATCH
    32
    str22 = _buffer.getName();
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables str11, str12 , while Clone fragment #2 returns variables str21, str22