tok = lexer.getNext(); if (tok.getType() != RoseToken.STRING) { System.out.println(" Parsing error in parseList - expecting string"); return null; }
tok = lexer.getNext(); if (tok.getType() != RoseToken.RIGHT_PAREN) { System.out.println(" Parsing error in parseList - expecting right parenthesis"); return null; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseParser.java
Method name: RoseNode parseList(String) Method name: RoseNode parseList(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
tok = lexer.getNext();
1
tok = lexer.getNext();
2
    if (tok.getType() != RoseToken.STRING)
2
        if (tok.getType() != RoseToken.
3
RIGHT_PAREN)
3
    {
4
        {
4
      System.out.println("  Parsing error in parseList - expecting string");
5
          System.out.println("  Parsing error in parseList - expecting 
6
right parenthesis");
5
      return null;
7
          return null;
6
    }
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.2
Clones locationClones are in the same method
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    tok = lexer.getNext();
    37
    tok = lexer.getNext();
    16
    if (tok.getType() != RoseToken.STRING)
    16
    if (tok.getType() != RoseToken.STRING)
    38
    if (tok.getType() != RoseToken.RIGHT_PAREN)
    Differences
    Expression1Expression2Difference
    STRINGRIGHT_PARENVARIABLE_NAME_MISMATCH
    38
    if (tok.getType() != RoseToken.RIGHT_PAREN)
    17
    System.out.println("  Parsing error in parseList - expecting string");
    17
    System.out.println(" Parsing error in parseList - expecting string");
    39
    System.out.println(" Parsing error in parseList - expecting right parenthesis");
    Differences
    Expression1Expression2Difference
    " Parsing error in parseList - expecting string"" Parsing error in parseList - expecting right parenthesis"LITERAL_VALUE_MISMATCH
    39
    System.out.println("  Parsing error in parseList - expecting right parenthesis");
    18
    return null;
    40
    return null;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables tok , while Clone fragment #2 returns variables