Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
13 | 2 | 1 | 0.995 | class_body_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 13 | 526 | plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java |
2 | 13 | 551 | 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; } |
| ||||
/** * 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; } |
| |||
/** * 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6196d260]] | Comparable |
1 | 2 | [[#6196d260]] | String |