CloneSet2926


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
11201.000class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1112605
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
211408
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java
Clone Instance
1
Line Count
11
Source Line
2605
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java

/**
 * Answers true if the given name starts with the given prefix, false otherwise.
 * The comparison is case sensitive.
 * <br>
 * <br>
 * For example:
 * <ol>
 * <li><pre>
 *    prefix = { 'a' , 'b' }
 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
 *    result => true
 * </pre>
 * </li>
 * <li><pre>
 *    prefix = { 'a' , 'c' }
 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
 *    result => false
 * </pre>
 * </li>
 * </ol>
 * 
 * @param prefix the given prefix
 * @param name the given name
 * @return true if the given name starts with the given prefix, false otherwise
 * @throws NullPointerException if the given name is null or if the given prefix is null
 */
public static final boolean prefixEquals(char[] prefix, char[] name) {

        int max = prefix.length;
        if (name.length < max)
                return false;
        for (int i = max;
                --i >= 0;) 
                  // assumes the prefix is not larger than the name
                if (prefix[i] != name[i])
                        return false;
        return true;
}


Clone Instance
2
Line Count
11
Source Line
408
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java

        public static final boolean prefixEquals(char[] prefix, char[] name) {

                int max = prefix.length;
                if (name.length < max)
                        return false;
                for (int i = max;
                        --i >= 0;) 
                          // assumes the prefix is not larger than the name
                                if (prefix[i] != name[i])
                                        return false;
                        return true;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
 * Answers true if the given name starts with the given prefix, false otherwise.
 * The comparison is case sensitive.
 * <br>
 * <br>
 * For example:
 * <ol>
 * <li><pre>
 *    prefix = { 'a' , 'b' }
 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
 *    result => true
 * </pre>
 * </li>
 * <li><pre>
 *    prefix = { 'a' , 'c' }
 *    name = { 'a' , 'b', 'b', 'a', 'b', 'a' }
 *    result => false
 * </pre>
 * </li>
 * </ol>
 * 
 * @param prefix the given prefix
 * @param name the given name
 * @return true if the given name starts with the given prefix, false otherwise
 * @throws NullPointerException if the given name is null or if the given prefix is null
 */
public static final boolean prefixEquals(char[] prefix, char[] name) {
  int max = prefix.length;
  if (name.length < max)
    return false;
  for (int i = max; --i >= 0;) // assumes the prefix is not larger than the name
    if (prefix[i] != name[i])
      return false;
  return true;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None