CloneSet1103


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
13210.995class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
113526
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
213551
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java
Clone Instance
1
Line Count
13
Source Line
526
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java

        /**
         * Compares two arrays using equals() on the elements.
         * The arrays are first sorted.
         * Either or both arrays may be null.
         * Returns true if both are null.
         * Returns false if only one is null.
         * If both are arrays, returns true iff they have the same length and
         * iff, after sorting both arrays, all elements compare true with equals.
         * The original arrays are left untouched.
         */
        public static boolean equalArraysOrNullSortFirst(Comparable[] a, Comparable[] b) {
                if (a == b)     return true;
                if (a == null || b == null) return false;
                int len = a.length;
                if (len != b.length) return false;
                if (len >= 2) {  // only need to sort if more than two items
                        a = sortCopy(a);
                        b = sortCopy(b);
                }
                for (int i = 0; i < len; ++i) {
                        if ( !a[i].equals(b[i])) return false;
                }
                return true;
        }


Clone Instance
2
Line Count
13
Source Line
551
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java

        /**
         * Compares two String arrays using equals() on the elements.
         * The arrays are first sorted.
         * Either or both arrays may be null.
         * Returns true if both are null.
         * Returns false if only one is null.
         * If both are arrays, returns true iff they have the same length and
         * iff, after sorting both arrays, all elements compare true with equals.
         * The original arrays are left untouched.
         */
        public static boolean equalArraysOrNullSortFirst(String[] a, String[] b) {
                if (a == b)     return true;
                if (a == null || b == null) return false;
                int len = a.length;
                if (len != b.length) return false;
                if (len >= 2) {  // only need to sort if more than two items
                        a = sortCopy(a);
                        b = sortCopy(b);
                }
                for (int i = 0; i < len; ++i) {
                        if ( !a[i].equals(b[i])) return false;
                }
                return true;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Compares two arrays using equals() on the elements.
         * The arrays are first sorted.
         * Either or both arrays may be null.
         * Returns true if both are null.
         * Returns false if only one is null.
         * If both are arrays, returns true iff they have the same length and
         * iff, after sorting both arrays, all elements compare true with equals.
         * The original arrays are left untouched.
         */
/**
         * Compares two String arrays using equals() on the elements.
         * The arrays are first sorted.
         * Either or both arrays may be null.
         * Returns true if both are null.
         * Returns false if only one is null.
         * If both are arrays, returns true iff they have the same length and
         * iff, after sorting both arrays, all elements compare true with equals.
         * The original arrays are left untouched.
         */
public static boolean equalArraysOrNullSortFirst( [[#variable6196d260]][] a, [[#variable6196d260]][] b) {
  if (a == b)
    return true;
  if (a == null || b == null)
    return false;
  int len = a.length;
  if (len != b.length)
    return false;
  if (len >= 2) { // only need to sort if more than two items
    a = sortCopy(a);
    b = sortCopy(b);
  }
  for (int i = 0; i < len; ++i) {
    if ( !a[i].equals(b[i]))
      return false;
  }
  return true;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6196d260]]
Comparable 
12[[#6196d260]]
String