if(p.beginsAt + p.spec.getLengthRightSpaced() < in.length()) { ret.add( in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced() ).trim() ); } else { ret.add( in.substring(begin).trim() ); }
if(p.beginsAt + p.spec.getLengthRightSpaced() < in.length()) { ret.add( in.substring(p.beginsAt, p.beginsAt + p.spec.getLengthRightSpaced() ).trim() ); } else { ret.add( in.substring(p.beginsAt).trim() ); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformatorKernel.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformatorKernel.java
Method name: String[] toPieces(String) Method name: String[] toPieces(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if(p.beginsAt + p.spec.getLengthRightSpaced() < in.length())
1
if(p.beginsAt + p.spec.getLengthRightSpaced() < in.length())
2
						{
2
						{
3
							ret.add( in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced() ).trim() );
3
							ret.add( in.substring(p.beginsAt, p.beginsAt + p.spec.getLengthRightSpaced() ).trim() );
4
						}
4
						}
5
						else
5
						else
6
						{
6
						{
7
							ret.add( in.substring(begin).trim() );
7
							ret.add( in.substring(p.beginsAt).trim() );
8
						}
8
						}
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    30
    if (p.beginsAt + p.spec.getLengthRightSpaced() < in.length())
    38
    if (p.beginsAt + p.spec.getLengthRightSpaced() < in.length())
    31
    ret.add(in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced()).trim());
    31
    ret.add(in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced()).trim());
    39
    ret.add(in.substring(p.beginsAt, p.beginsAt + p.spec.getLengthRightSpaced()).trim());
    Differences
    Expression1Expression2Difference
    beginp.beginsAtTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression p.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted
    39
    ret.add(in.substring(p.beginsAt, p.beginsAt + p.spec.getLengthRightSpaced()).trim());
    else
    else
    32
    ret.add(in.substring(begin).trim());
    32
    ret.add(in.substring(begin).trim());
    40
    ret.add(in.substring(p.beginsAt).trim());
    Differences
    Expression1Expression2Difference
    beginp.beginsAtTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression p.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted
    40
    ret.add(in.substring(p.beginsAt).trim());
    Precondition Violations (2)
    Row Violation
    1Expression p.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression p.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted