| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 32 | 2 | 1 | 0.990 | class_body_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 32 | 124 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java |
| 2 | 32 | 159 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java |
| ||||
// 5.1.10
public static ReferenceBinding[] greaterLowerBound(ReferenceBinding[] types) {
if (types == null) return null;
int length = types.length;
if (length == 0) return null;
ReferenceBinding[] result = types;
int removed = 0;
for (int i = 0; i < length; i++) {
ReferenceBinding iType = result[i];
if (iType == null) continue ;
for (int j = 0; j < length; j++) {
if (i == j) continue ;
ReferenceBinding jType = result[j];
if (jType == null) continue ;
if (iType.isCompatibleWith(jType)) { // if Vi <: Vj, Vj is removed
if (result == types) { // defensive copy
System.arraycopy(result, 0, result = new ReferenceBinding[length], 0, length);
}
result[j] = null;
removed++;
}
}
}
if (removed == 0) return result;
if (length == removed) return null;
ReferenceBinding[] trimmedResult = new ReferenceBinding[length - removed];
for (int i = 0, index = 0; i < length; i++) {
ReferenceBinding iType = result[i];
if (iType != null) {
trimmedResult[index++ ] = iType;
}
}
return trimmedResult;
}
|
| ||||
// 5.1.10
public static TypeBinding[] greaterLowerBound(TypeBinding[] types) {
if (types == null) return null;
int length = types.length;
if (length == 0) return null;
TypeBinding[] result = types;
int removed = 0;
for (int i = 0; i < length; i++) {
TypeBinding iType = result[i];
if (iType == null) continue ;
for (int j = 0; j < length; j++) {
if (i == j) continue ;
TypeBinding jType = result[j];
if (jType == null) continue ;
if (iType.isCompatibleWith(jType)) { // if Vi <: Vj, Vj is removed
if (result == types) { // defensive copy
System.arraycopy(result, 0, result = new TypeBinding[length], 0, length);
}
result[j] = null;
removed++;
}
}
}
if (removed == 0) return result;
if (length == removed) return null;
TypeBinding[] trimmedResult = new TypeBinding[length - removed];
for (int i = 0, index = 0; i < length; i++) {
TypeBinding iType = result[i];
if (iType != null) {
trimmedResult[index++ ] = iType;
}
}
return trimmedResult;
}
|
| |||
// 5.1.10
public static [[#variablebe7c1920]][] greaterLowerBound( [[#variablebe7c1920]][] types) {
if (types == null)
return null;
int length = types.length;
if (length == 0)
return null;
[[#variablebe7c1920]][] result = types;
int removed = 0;
for (int i = 0; i < length; i++) {
[[#variablebe7c1920]] iType = result[i];
if (iType == null)
continue ;
for (int j = 0; j < length; j++) {
if (i == j)
continue ;
[[#variablebe7c1920]] jType = result[j];
if (jType == null)
continue ;
if (iType.isCompatibleWith(jType)) { // if Vi <: Vj, Vj is removed
if (result == types) { // defensive copy
System.arraycopy(result, 0, result = new [[#variablebe7c1920]][length], 0, length);
}
result[j] = null;
removed++;
}
}
}
if (removed == 0)
return result;
if (length == removed)
return null;
[[#variablebe7c1920]][] trimmedResult = new [[#variablebe7c1920]][length - removed];
for (int i = 0, index = 0; i < length; i++) {
[[#variablebe7c1920]] iType = result[i];
if (iType != null) {
trimmedResult[index++ ] = iType;
}
}
return trimmedResult;
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#be7c1920]] | ReferenceBinding |
| 1 | 2 | [[#be7c1920]] | TypeBinding |