CloneSet1088


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
27240.970executable_statement
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
126312
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java
227448
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java
Clone Instance
1
Line Count
26
Source Line
312
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java

                                                            { // may be equals => then no scan is necessary
                                this.scanner.resetTo(end + 1, previousStart);
                                try {
                                        int token = this.scanner.getNextToken();
                                        if (token != TerminalTokens.TokenNameWHITESPACE || this.scanner.currentPosition != previousStart) {
                                                // stop search on condition 3)
                                                // if first comment fails, then there's no extended position in fact
                                                if (idx == endIdx) {
                                                        return nodeStart;
                                                }
                                                break;
                                        }
                                } catch (InvalidInputException e) {
                                        // Should not happen, but return no extended position...
                                        return nodeStart;
                                  }
                                // verify that there's no more than one line between node/comments
                                char[] gap = this.scanner.getCurrentIdentifierSource();
                                int nbrLine = 0;
                                int pos = -1;
                                while ((pos = CharOperation.indexOf('\n', gap, pos + 1)) >= 0) {
                                        nbrLine++;
                                }
                                if (nbrLine > 1) {
                                        // stop search on condition 4)
                                        break;
                                }
                                                            }


Clone Instance
2
Line Count
27
Source Line
448
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java

                                                               {
                                this.scanner.resetTo(previousEnd, commentStart);
                                try {
                                        int token = this.scanner.getNextToken();
                                        if (token != TerminalTokens.TokenNameWHITESPACE || this.scanner.currentPosition != commentStart) {
                                                // stop search on condition 2)
                                                // if first index fails, then there's no extended position in fact...
                                                if (idx == startIdx) {
                                                        return nodeEnd;
                                                }
                                                // otherwise we get the last index of trailing comment => break
                                                break;
                                        }
                                } catch (InvalidInputException e) {
                                        // Should not happen, but return no extended position...
                                        return nodeEnd;
                                  }
                                // verify that there's no more than one line between node/comments
                                char[] gap = this.scanner.getCurrentIdentifierSource();
                                int nbrLine = 0;
                                int pos = -1;
                                while ((pos = CharOperation.indexOf('\n', gap, pos + 1)) >= 0) {
                                        nbrLine++;
                                }
                                if (nbrLine > 1) {
                                        // stop search on condition 3)
                                        break;
                                }
                                                               }


Clone AbstractionParameter Count: 4Parameter Bindings

{ // may be equals => then no scan is necessary
  this.scanner.resetTo( [[#variable4e1fb460]],  [[#variable4e1fb3e0]]);
  try {
    int token = this.scanner.getNextToken();
    if (token != TerminalTokens.TokenNameWHITESPACE || this.scanner.currentPosition != [[#variable4e1fb3e0]]) {
      // stop search on condition 2)
      // if first index fails, then there's no extended position in fact...
      // stop search on condition 3)
      // if first comment fails, then there's no extended position in fact
      if (idx == [[#variable4e1fb340]]) {
        return [[#variable4e1fb280]];
      }
      // otherwise we get the last index of trailing comment => break
      break;
    }
  }
  catch (InvalidInputException e) {
    // Should not happen, but return no extended position...
    return [[#variable4e1fb280]];
  }
  // verify that there's no more than one line between node/comments
  char[] gap = this.scanner.getCurrentIdentifierSource();
  int nbrLine = 0;
  int pos = -1;
  while ((pos = CharOperation.indexOf('\n', gap, pos + 1)) >= 0) {
    nbrLine++;
  }
  if (nbrLine > 1) {
    // stop search on condition 3)
    // stop search on condition 4)
    break;
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#4e1fb460]]
previousEnd 
12[[#4e1fb460]]
end + 1 
21[[#4e1fb3e0]]
commentStart 
22[[#4e1fb3e0]]
previousStart 
31[[#4e1fb340]]
startIdx 
32[[#4e1fb340]]
endIdx 
41[[#4e1fb280]]
nodeEnd 
42[[#4e1fb280]]
nodeStart