logicalLength += tabSize - (logicalLength % tabSize); if(!lastWasSpace && logicalLength <= maxLineLen) { lastInLine = i; lastWordOffset = i; lastWasSpace = true; }
logicalLength++; if(!lastWasSpace && logicalLength <= maxLineLen) { lastInLine = i; lastWordOffset = i; lastWasSpace = true; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
Method name: boolean doWordWrap(boolean) Method name: boolean doWordWrap(boolean)
Number of AST nodes: 5 Number of AST nodes: 5
1
logicalLength += tabSize - (logicalLength % tabSize);
1
logicalLength++;
2
				if(!lastWasSpace && logicalLength <= maxLineLen)
2
				if(!lastWasSpace && logicalLength <= maxLineLen)
3
				{
3
				{
4
					lastInLine = i;
4
					lastInLine = i;
5
					lastWordOffset = i;
5
					lastWordOffset = i;
6
					lastWasSpace = true;
6
					lastWasSpace = true;
7
				}
7
				}
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.4
Clones locationClones are in the same method
Number of node comparisons19
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    logicalLength += tabSize - (logicalLength % tabSize);
    21
    logicalLength += tabSize - (logicalLength % tabSize);
    Preondition Violations
    Unmatched statement logicalLength+=tabSize - (logicalLength % tabSize); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                  
                                            
    33
    logicalLength++;
    Preondition Violations
    Unmatched statement logicalLength++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    33
    logicalLength++;
    22
    if (!lastWasSpace && logicalLength <= maxLineLen)
    34
    if (!lastWasSpace && logicalLength <= maxLineLen)
    23
    lastInLine = i;
    35
    lastInLine = i;
    24
    lastWordOffset = i;
    36
    lastWordOffset = i;
    25
    lastWasSpace = true;
    37
    lastWasSpace = true;
    Precondition Violations (3)
    Row Violation
    1Unmatched statement logicalLength+=tabSize - (logicalLength % tabSize); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement logicalLength++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Clone fragment #1 returns variables lastWasSpace, lastInLine, lastWordOffset , while Clone fragment #2 returns variables lastWasSpace, lastInLine, lastWordOffset