public int matches(CharacterIterator iterator, int start, int limit) { if (this.ignoreCase) return this.matchesIgnoreCase(iterator, start, limit); int plength = this.pattern.length; if (plength == 0) return start; int index = start + plength; while (index <= limit) { int pindex = plength; int nindex = index + 1; char ch; do { if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex]) break; if (pindex == 0) return index; } while (pindex > 0); index += this.shiftTable[ch % this.shiftTable.length] + 1; if (index < nindex) index = nindex; } return -1;
public int matches(char[] chars, int start, int limit) { if (this.ignoreCase) return this.matchesIgnoreCase(chars, start, limit); int plength = this.pattern.length; if (plength == 0) return start; int index = start + plength; while (index <= limit) { //System.err.println("Starts at "+index); int pindex = plength; int nindex = index + 1; char ch; do { if ((ch = chars[--index]) != this.pattern[--pindex]) break; if (pindex == 0) return index; } while (pindex > 0); index += this.shiftTable[ch % this.shiftTable.length] + 1; if (index < nindex) index = nindex; } return -1;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public int matches(CharacterIterator iterator, int start, int limit)
1
public int matches(char[] chars, int start, int limit)
2
    {
2
    {
3
      if (this.ignoreCase)
3
      if (this.ignoreCase)
4
        return this.matchesIgnoreCase(iterator, start, limit);
4
        return this.matchesIgnoreCase(chars, start, limit);
5
      int plength = this.pattern.length;
5
      int plength = this.pattern.length;
6
      if (plength == 0)
6
      if (plength == 0)
7
        return start;
7
        return start;
8
      int index = start + plength;
8
      int index = start + plength;
9
      while (index <= limit)
9
      while (index <= limit)
10
      {
10
      {
11
        //System.err.println("Starts at "+index);
11
        int pindex = plength;
12
        int pindex = plength;
12
        int nindex = index + 1;
13
        int nindex = index + 1;
13
        char ch;
14
        char ch;
14
        do
15
        do
15
        {
16
        {
16
          if ((ch = iterator.setIndex(--index)) != this.pattern[--pindex])
17
          if ((ch = chars[--index]) != this.pattern[--pindex])
17
            break;
18
            break;
18
          if (pindex == 0)
19
          if (pindex == 0)
19
            return index;
20
            return index;
20
        }
21
        }
21
        while (pindex > 0);
22
        while (pindex > 0);
22
        index += this.shiftTable[ch % this.shiftTable.length] + 1;
23
        index += this.shiftTable[ch % this.shiftTable.length] + 1;
23
        if (index < nindex)
24
        if (index < nindex)
24
          index = nindex;
25
          index = nindex;
25
      }
26
      }
26
      return -1;
27
      return -1;
27
    
28
    
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.0
Clones location
Number of node comparisons0