String oneMore = tokenizer.nextToken().trim(); if (!oneMore.equals(File.pathSeparator)) { token += ":" + oneMore; } else { token += ":"; lookahead = oneMore; }
String nextToken = tokenizer.nextToken().trim(); if (nextToken.startsWith("\\") || nextToken.startsWith("/")) { // we know we are on a DOS style platform and the next path // starts with a slash or backslash, so we know this is a // drive spec token += ":" + nextToken; } else { // store the token just read for next time lookahead = nextToken; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PathTokenizer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PathTokenizer.java
Method name: String nextToken() Method name: String nextToken()
Number of AST nodes: 5 Number of AST nodes: 4
1
String oneMore = tokenizer.nextToken().trim();
1
String nextToken = tokenizer.nextToken().trim();
2
                            if (!oneMore.equals(File.pathSeparator)) {
2
                
3
                                token += ":" + oneMore;
4
                            } else {
5
            
3
if (nextToken.startsWith("\\") || nextToken.startsWith("/")) {
4
                    // we know we are on a DOS style platform and the next path
5
                    // starts with a slash or backslash, so we know this is a
6
                    // drive spec
6
                    token += ":";
7
                    token += ":" + nextToken;
7
                  
8
                } else {
8
              lookahead = oneMore;
9
              
9
            
10
      // store the token just read for next time
11
                    lookahead = nextToken;
10
                }
12
                }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons1