for (int i = start; i < limit; i++) { if (!isNameCharacter(id.charAt(i))) { return false; } }
for (int i = 0; i < length; i++) { if (!Character.isDigit(s.charAt(i))) { return false; } }
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/IdUtil.java File path: /jruby-1.4.0/src/org/jruby/RubySymbol.java
Method name: boolean isNameString(String, int, int) Method name: boolean isSpecialGlobalName(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
for (int i = start; i < limit; i++) {
1
for (int i = 0; i < length; i++) {
2
            if (!isNameCharacter(id.charAt(i))) {
2
                if (!Character.isDigit(s.charAt(i))) {
3
                return false;
3
                    return false;
4
            }
4
            
5
    }
5
        }
6
            }
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.3
Clones locationClones are in different classes
Number of node comparisons5
  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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = start; i < limit; i++)
    1
    for (int i = start; i < limit; i++)
    30
    for (int i = 0; i < length; i++)
    Differences
    Expression1Expression2Difference
    start0TYPE_COMPATIBLE_REPLACEMENT
    limitlengthVARIABLE_NAME_MISMATCH
    30
    for (int i = 0; i < length; i++)
    2
    if (!isNameCharacter(id.charAt(i)))
    2
    if (!isNameCharacter(id.charAt(i)))
    31
    if (!Character.isDigit(s.charAt(i)))
    Differences
    Expression1Expression2Difference
    isNameCharacterisDigitMETHOD_INVOCATION_NAME_MISMATCH
    idsVARIABLE_NAME_MISMATCH
    CharacterMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression isNameCharacter(id.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Character.isDigit(s.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression isNameCharacter(id.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Character.isDigit(s.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31
    if (!Character.isDigit(s.charAt(i)))
    3
    return false;
    32
    return false;
    Precondition Violations (4)
    Row Violation
    1Expression isNameCharacter(id.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Character.isDigit(s.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression isNameCharacter(id.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression Character.isDigit(s.charAt(i)) cannot be parameterized, because it has dependencies to/from statements that will be extracted