CloneSet477


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
30210.987class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
130263
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java
230306
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java
Clone Instance
1
Line Count
30
Source Line
263
Source File
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java

EntryResult[] queryIn(Index index) throws IOException {
        char[] key = this.declaringSimpleName; // can be null
        int matchRule = getMatchRule();

        switch (getMatchMode()) {
                case R_EXACT_MATCH:
                        if (this.isCamelCase) break;
                        if (this.declaringSimpleName != null && this.parameterCount >= 0 && !this.varargs)
                                key = createIndexKey(this.declaringSimpleName, this.parameterCount);
                        else { // do a prefix query with the declaringSimpleName
                                matchRule &= ~R_EXACT_MATCH;
                                matchRule |= R_PREFIX_MATCH;
                        }
                        break;
                case R_PREFIX_MATCH:
                        // do a prefix query with the declaringSimpleName
                        break;
                case R_PATTERN_MATCH:
                        if (this.parameterCount >= 0 && !this.varargs)
                                key = createIndexKey(this.declaringSimpleName == null ? ONE_STAR:  this.declaringSimpleName, this.parameterCount);
                        else if (this.declaringSimpleName != null && this.declaringSimpleName[this.declaringSimpleName.length - 1] != '*')
                                key = CharOperation.concat(this.declaringSimpleName, ONE_STAR, SEPARATOR);
                        // else do a pattern query with just the declaringSimpleName
                        break;
                case R_REGEXP_MATCH:
                        // TODO (frederic) implement regular expression match
                        break;
              }

        return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
}


Clone Instance
2
Line Count
30
Source Line
306
Source File
plugins/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java

EntryResult[] queryIn(Index index) throws IOException {
        char[] key = this.selector; // can be null
        int matchRule = getMatchRule();

        switch (getMatchMode()) {
                case R_EXACT_MATCH:
                        if (this.isCamelCase) break;
                        if (this.selector != null && this.parameterCount >= 0 && !this.varargs)
                                key = createIndexKey(this.selector, this.parameterCount);
                        else { // do a prefix query with the selector
                                matchRule &= ~R_EXACT_MATCH;
                                matchRule |= R_PREFIX_MATCH;
                        }
                        break;
                case R_PREFIX_MATCH:
                        // do a prefix query with the selector
                        break;
                case R_PATTERN_MATCH:
                        if (this.parameterCount >= 0 && !this.varargs)
                                key = createIndexKey(this.selector == null ? ONE_STAR:  this.selector, this.parameterCount);
                        else if (this.selector != null && this.selector[this.selector.length - 1] != '*')
                                key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR);
                        // else do a pattern query with just the selector
                        break;
                case R_REGEXP_MATCH:
                        // TODO (frederic) implement regular expression match
                        break;
              }

        return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
}


Clone AbstractionParameter Count: 1Parameter Bindings

EntryResult[] queryIn(Index index) throws IOException {
  char[] key = this. [[#variablea4df5b80]]; // can be null
  int matchRule = getMatchRule();
  switch (getMatchMode()) {
    case R_EXACT_MATCH:
      if (this.isCamelCase)
        break;
      if (this. [[#variablea4df5b80]]!= null && this.parameterCount >= 0 && !this.varargs)
        key = createIndexKey(this. [[#variablea4df5b80]], this.parameterCount);
      else { // do a prefix query with the declaringSimpleName // do a prefix query with the selector
        matchRule &= ~R_EXACT_MATCH;
        matchRule |= R_PREFIX_MATCH;
      }
      break;
    case R_PREFIX_MATCH:
      // do a prefix query with the declaringSimpleName
      // do a prefix query with the selector
      break;
    case R_PATTERN_MATCH:
      if (this.parameterCount >= 0 && !this.varargs)
        key = createIndexKey(this. [[#variablea4df5b80]]== null ? ONE_STAR: this. [[#variablea4df5b80]], this.parameterCount);
      else
        if (this. [[#variablea4df5b80]]!= null && this. [[#variablea4df5b80]][this. [[#variablea4df5b80]].length - 1] != '*')
          key = CharOperation.concat(this. [[#variablea4df5b80]], ONE_STAR, SEPARATOR);
      // else do a pattern query with just the declaringSimpleName
      // else do a pattern query with just the selector
      break;
    case R_REGEXP_MATCH:
      // TODO (frederic) implement regular expression match
      break;
  }
  return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#a4df5b80]]
declaringSimpleName 
12[[#a4df5b80]]
selector