CloneSet309


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
32210.990class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
132124
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
232159
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
Clone Instance
1
Line Count
32
Source Line
124
Source File
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;
        }


Clone Instance
2
Line Count
32
Source Line
159
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java

        // 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;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

// 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#be7c1920]]
ReferenceBinding 
12[[#be7c1920]]
TypeBinding