CloneSet6


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
117330.950statement_sequence[7]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11171528
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
21172243
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
31172890
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java
Next
Last
Clone Instance
1
Line Count
117
Source Line
1528
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java

/*
 * The pattern has only fixed string.
 * The engine uses Boyer-Moore.
 */
if (this.fixedStringOnly) {
  //System.err.println("DEBUG: fixed-only: "+this.fixedString);
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o >= 0) {
    if (con.match != null) {
      con.match.setBeginning(0, o);
      con.match.setEnd(0, o + this.fixedString.length());
    }
    con.inuse = false;
    return true;
  }
  con.inuse = false;
  return false;
}
/*
 * The pattern contains a fixed string.
 * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
 * If not, it return with false.
 */
if (this.fixedString != null) {
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o < 0) {
    //System.err.println("Non-match in fixed-string search.");
    con.inuse = false;
    return false;
  }
}
int limit = con.limit - this.minlength;
int matchStart;
int matchEnd = -1;
/*
 * Checks whether the expression starts with ".*".
 */
if (this.operations != null && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
  if (isSet(this.options, SINGLE_LINE)) {
    matchStart = con.start;
    matchEnd = this.matchCharArray(con, this.operations, con.start, 1, this.options);
  }
  else {
    boolean previousIsEOL = true;
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      int ch = target[matchStart];
      if (isEOLChar(ch)) {
        previousIsEOL = true;
      }
      else {
        if (previousIsEOL) {
          if (0 <= (matchEnd = this.matchCharArray(con, this.operations, matchStart, 1, this.options)))
            break;
        }
        previousIsEOL = false;
      }
    }
  }
}
/*
 * Optimization against the first character.
 */
else
  if (this.firstChar != null) {
    //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
    RangeToken range = this.firstChar;
    if (RegularExpression.isSet(this.options, IGNORE_CASE)) {
      range = this.firstChar.getCaseInsensitiveToken();
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target[matchStart];
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) {
          ch = REUtil.composeFromSurrogates(ch, target[matchStart + 1]);
          if ( !range.match(ch))
            continue ;
        }
        else {
          if ( !range.match(ch)) {
            char ch1 = Character.toUpperCase((char) ch);
            if ( !range.match(ch1))
              if ( !range.match(Character.toLowerCase(ch1)))
                continue ;
          }
        }
        if (0 <= (matchEnd = this.matchCharArray(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
    else {
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target[matchStart];
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
          ch = REUtil.composeFromSurrogates(ch, target[matchStart + 1]);
        if ( !range.match(ch))
          continue ;
        if (0 <= (matchEnd = this.matchCharArray(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
  }
  /*
   * Straightforward matching.
   */
  else {
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      if (0 <= (matchEnd = this.matchCharArray(con, this.operations, matchStart, 1, this.options)))
        break;
    }
  }
if (matchEnd >= 0) {
  if (con.match != null) {
    con.match.setBeginning(0, matchStart);
    con.match.setEnd(0, matchEnd);
  }
  con.inuse = false;
  return true;
}
else {
  con.inuse = false;
  return false;
}


Next
Previous
Clone Instance
2
Line Count
117
Source Line
2243
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java

/*
 * The pattern has only fixed string.
 * The engine uses Boyer-Moore.
 */
if (this.fixedStringOnly) {
  //System.err.println("DEBUG: fixed-only: "+this.fixedString);
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o >= 0) {
    if (con.match != null) {
      con.match.setBeginning(0, o);
      con.match.setEnd(0, o + this.fixedString.length());
    }
    con.inuse = false;
    return true;
  }
  con.inuse = false;
  return false;
}
/*
 * The pattern contains a fixed string.
 * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
 * If not, it return with false.
 */
if (this.fixedString != null) {
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o < 0) {
    //System.err.println("Non-match in fixed-string search.");
    con.inuse = false;
    return false;
  }
}
int limit = con.limit - this.minlength;
int matchStart;
int matchEnd = -1;
/*
 * Checks whether the expression starts with ".*".
 */
if (this.operations != null && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
  if (isSet(this.options, SINGLE_LINE)) {
    matchStart = con.start;
    matchEnd = this.matchString(con, this.operations, con.start, 1, this.options);
  }
  else {
    boolean previousIsEOL = true;
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      int ch = target.charAt(matchStart);
      if (isEOLChar(ch)) {
        previousIsEOL = true;
      }
      else {
        if (previousIsEOL) {
          if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
            break;
        }
        previousIsEOL = false;
      }
    }
  }
}
/*
 * Optimization against the first character.
 */
else
  if (this.firstChar != null) {
    //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
    RangeToken range = this.firstChar;
    if (RegularExpression.isSet(this.options, IGNORE_CASE)) {
      range = this.firstChar.getCaseInsensitiveToken();
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target.charAt(matchStart);
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) {
          ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1));
          if ( !range.match(ch))
            continue ;
        }
        else {
          if ( !range.match(ch)) {
            char ch1 = Character.toUpperCase((char) ch);
            if ( !range.match(ch1))
              if ( !range.match(Character.toLowerCase(ch1)))
                continue ;
          }
        }
        if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
    else {
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target.charAt(matchStart);
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
          ch = REUtil.composeFromSurrogates(ch, target.charAt(matchStart + 1));
        if ( !range.match(ch))
          continue ;
        if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
  }
  /*
   * Straightforward matching.
   */
  else {
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      if (0 <= (matchEnd = this.matchString(con, this.operations, matchStart, 1, this.options)))
        break;
    }
  }
if (matchEnd >= 0) {
  if (con.match != null) {
    con.match.setBeginning(0, matchStart);
    con.match.setEnd(0, matchEnd);
  }
  con.inuse = false;
  return true;
}
else {
  con.inuse = false;
  return false;
}


First
Previous
Clone Instance
3
Line Count
117
Source Line
2890
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java

/*
 * The pattern has only fixed string.
 * The engine uses Boyer-Moore.
 */
if (this.fixedStringOnly) {
  //System.err.println("DEBUG: fixed-only: "+this.fixedString);
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o >= 0) {
    if (con.match != null) {
      con.match.setBeginning(0, o);
      con.match.setEnd(0, o + this.fixedString.length());
    }
    con.inuse = false;
    return true;
  }
  con.inuse = false;
  return false;
}
/*
 * The pattern contains a fixed string.
 * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
 * If not, it return with false.
 */
if (this.fixedString != null) {
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o < 0) {
    //System.err.println("Non-match in fixed-string search.");
    con.inuse = false;
    return false;
  }
}
int limit = con.limit - this.minlength;
int matchStart;
int matchEnd = -1;
/*
 * Checks whether the expression starts with ".*".
 */
if (this.operations != null && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
  if (isSet(this.options, SINGLE_LINE)) {
    matchStart = con.start;
    matchEnd = this.matchCharacterIterator(con, this.operations, con.start, 1, this.options);
  }
  else {
    boolean previousIsEOL = true;
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      int ch = target.setIndex(matchStart);
      if (isEOLChar(ch)) {
        previousIsEOL = true;
      }
      else {
        if (previousIsEOL) {
          if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
            break;
        }
        previousIsEOL = false;
      }
    }
  }
}
/*
 * Optimization against the first character.
 */
else
  if (this.firstChar != null) {
    //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
    RangeToken range = this.firstChar;
    if (RegularExpression.isSet(this.options, IGNORE_CASE)) {
      range = this.firstChar.getCaseInsensitiveToken();
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target.setIndex(matchStart);
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) {
          ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1));
          if ( !range.match(ch))
            continue ;
        }
        else {
          if ( !range.match(ch)) {
            char ch1 = Character.toUpperCase((char) ch);
            if ( !range.match(ch1))
              if ( !range.match(Character.toLowerCase(ch1)))
                continue ;
          }
        }
        if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
    else {
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = target.setIndex(matchStart);
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
          ch = REUtil.composeFromSurrogates(ch, target.setIndex(matchStart + 1));
        if ( !range.match(ch))
          continue ;
        if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
  }
  /*
   * Straightforward matching.
   */
  else {
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      if (0 <= (matchEnd = this.matchCharacterIterator(con, this.operations, matchStart, 1, this.options)))
        break;
    }
  }
if (matchEnd >= 0) {
  if (con.match != null) {
    con.match.setBeginning(0, matchStart);
    con.match.setEnd(0, matchEnd);
  }
  con.inuse = false;
  return true;
}
else {
  con.inuse = false;
  return false;
}


Clone AbstractionParameter Count: 3Parameter Bindings

/*
           * The pattern has only fixed string.
           * The engine uses Boyer-Moore.
           */
if (this.fixedStringOnly) {
  //System.err.println("DEBUG: fixed-only: "+this.fixedString);
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o >= 0) {
    if (con.match != null) {
      con.match.setBeginning(0, o);
      con.match.setEnd(0, o + this.fixedString.length());
    }
    con.inuse = false;
    return true;
  }
  con.inuse = false;
  return false;
}
/*
           * The pattern contains a fixed string.
           * The engine checks with Boyer-Moore whether the text contains the fixed string or not.
           * If not, it return with false.
           */
if (this.fixedString != null) {
  int o = this.fixedStringTable.matches(target, con.start, con.limit);
  if (o < 0) {
    //System.err.println("Non-match in fixed-string search.");
    con.inuse = false;
    return false;
  }
}
int limit = con.limit - this.minlength;
int matchStart;
int matchEnd = -1;
/*
           * Checks whether the expression starts with ".*".
           */
if (this.operations != null && this.operations.type == Op.CLOSURE && this.operations.getChild().type == Op.DOT) {
  if (isSet(this.options, SINGLE_LINE)) {
    matchStart = con.start;
    matchEnd = this. [[#variable19084680]](con, this.operations, con.start, 1, this.options);
  }
  else {
    boolean previousIsEOL = true;
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      int ch = [[#variable19091a20]];
      if (isEOLChar(ch)) {
        previousIsEOL = true;
      }
      else {
        if (previousIsEOL) {
          if (0 <= (matchEnd = this. [[#variable19084680]](con, this.operations, matchStart, 1, this.options)))
            break;
        }
        previousIsEOL = false;
      }
    }
  }
}
/*
           * Optimization against the first character.
           */
else
  if (this.firstChar != null) {
    //System.err.println("DEBUG: with firstchar-matching: "+this.firstChar);
    RangeToken range = this.firstChar;
    if (RegularExpression.isSet(this.options, IGNORE_CASE)) {
      range = this.firstChar.getCaseInsensitiveToken();
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = [[#variable19091a20]];
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit) {
          ch = REUtil.composeFromSurrogates(ch,  [[#variable19091680]]);
          if ( !range.match(ch))
            continue ;
        }
        else {
          if ( !range.match(ch)) {
            char ch1 = Character.toUpperCase((char) ch);
            if ( !range.match(ch1))
              if ( !range.match(Character.toLowerCase(ch1)))
                continue ;
          }
        }
        if (0 <= (matchEnd = this. [[#variable19084680]](con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
    else {
      for (matchStart = con.start; matchStart <= limit; matchStart++) {
        int ch = [[#variable19091a20]];
        if (REUtil.isHighSurrogate(ch) && matchStart + 1 < con.limit)
          ch = REUtil.composeFromSurrogates(ch,  [[#variable19091680]]);
        if ( !range.match(ch))
          continue ;
        if (0 <= (matchEnd = this. [[#variable19084680]](con, this.operations, matchStart, 1, this.options)))
          break;
      }
    }
  }
  /*
             * Straightforward matching.
             */
  else {
    for (matchStart = con.start; matchStart <= limit; matchStart++) {
      if (0 <= (matchEnd = this. [[#variable19084680]](con, this.operations, matchStart, 1, this.options)))
        break;
    }
  }
if (matchEnd >= 0) {
  if (con.match != null) {
    con.match.setBeginning(0, matchStart);
    con.match.setEnd(0, matchEnd);
  }
  con.inuse = false;
  return true;
}
else {
  con.inuse = false;
  return false;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#19084680]]
matchCharArray 
12[[#19084680]]
matchString 
13[[#19084680]]
matchCharacterIterator 
21[[#19091a20]]
target[matchStart] 
22[[#19091a20]]
target.charAt(matchStart) 
23[[#19091a20]]
target.setIndex(matchStart) 
31[[#19091680]]
target[matchStart + 1] 
32[[#19091680]]
target.charAt(matchStart + 1) 
33[[#19091680]]
target.setIndex(matchStart + 1)