CloneSet63


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
102240.979class_body_declarations[7]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
110244
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.java
210250
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java
Clone Instance
1
Line Count
102
Source Line
44
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfIntValues.java

        public Object clone() throws CloneNotSupportedException {
                HashtableOfIntValues result = (HashtableOfIntValues) super.clone();
                result.elementSize = this.elementSize;
                result.threshold = this.threshold;

                int length = this.keyTable.length;
                result.keyTable = new char[length][];
                System.arraycopy(this.keyTable, 0, result.keyTable, 0, length);

                length = this.valueTable.length;
                result.valueTable = new int[length];
                System.arraycopy(this.valueTable, 0, result.valueTable, 0, length);
                return result;
        }

        public boolean containsKey(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return true;
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return false;
        }

        public int get(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return valueTable[index];
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return NO_VALUE;
        }

        public int put(char[] key, int value) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return valueTable[index] = value;
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                keyTable[index] = key;
                valueTable[index] = value;

                // assumes the threshold is never equal to the size of the table
                if ( ++elementSize > threshold)
                        rehash();
                return value;
        }

        public int removeKey(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key)) {
                                int value = valueTable[index];
                                elementSize--;
                                keyTable[index] = null;
                                valueTable[index] = NO_VALUE;
                                rehash();
                                return value;
                        }
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return NO_VALUE;
        }

        private void rehash() {

                HashtableOfIntValues newHashtable = new HashtableOfIntValues(elementSize * 2);          // double the number of expected elements
                char[] currentKey;
                for (int i = keyTable.length; --i >= 0;)
                        if ((currentKey = keyTable[i]) != null)
                                newHashtable.put(currentKey, valueTable[i]);

                this.keyTable = newHashtable.keyTable;
                this.valueTable = newHashtable.valueTable;
                this.threshold = newHashtable.threshold;
        }

        public int size() {
                return elementSize;
        }


Clone Instance
2
Line Count
102
Source Line
50
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/HashtableOfObject.java

        public Object clone() throws CloneNotSupportedException {
                HashtableOfObject result = (HashtableOfObject) super.clone();
                result.elementSize = this.elementSize;
                result.threshold = this.threshold;

                int length = this.keyTable.length;
                result.keyTable = new char[length][];
                System.arraycopy(this.keyTable, 0, result.keyTable, 0, length);

                length = this.valueTable.length;
                result.valueTable = new Object[length];
                System.arraycopy(this.valueTable, 0, result.valueTable, 0, length);
                return result;
        }

        public boolean containsKey(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return true;
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return false;
        }

        public Object get(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return valueTable[index];
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return null;
        }

        public Object put(char[] key, Object value) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
                                return valueTable[index] = value;
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                keyTable[index] = key;
                valueTable[index] = value;

                // assumes the threshold is never equal to the size of the table
                if ( ++elementSize > threshold)
                        rehash();
                return value;
        }

        public Object removeKey(char[] key) {
                int length = keyTable.length,
                        index = CharOperation.hashCode(key) % length;
                int keyLength = key.length;
                char[] currentKey;
                while ((currentKey = keyTable[index]) != null) {
                        if (currentKey.length == keyLength && CharOperation.equals(currentKey, key)) {
                                Object value = valueTable[index];
                                elementSize--;
                                keyTable[index] = null;
                                valueTable[index] = null;
                                rehash();
                                return value;
                        }
                        if ( ++index == length) {
                                index = 0;
                        }
                }
                return null;
        }

        private void rehash() {

                HashtableOfObject newHashtable = new HashtableOfObject(elementSize * 2);                // double the number of expected elements
                char[] currentKey;
                for (int i = keyTable.length; --i >= 0;)
                        if ((currentKey = keyTable[i]) != null)
                                newHashtable.put(currentKey, valueTable[i]);

                this.keyTable = newHashtable.keyTable;
                this.valueTable = newHashtable.valueTable;
                this.threshold = newHashtable.threshold;
        }

        public int size() {
                return elementSize;
        }


Clone AbstractionParameter Count: 4Parameter Bindings

public Object clone() throws CloneNotSupportedException {
   [[#variableb9268960]] result = ( [[#variableb9268960]]) super.clone();
  result.elementSize = this.elementSize;
  result.threshold = this.threshold;
  int length = this.keyTable.length;
  result.keyTable = new char[length][];
  System.arraycopy(this.keyTable, 0, result.keyTable, 0, length);
  length = this.valueTable.length;
  result.valueTable = [[#variableb91b77e0]];
  System.arraycopy(this.valueTable, 0, result.valueTable, 0, length);
  return result;
}

public boolean containsKey(char[] key) {
  int length = keyTable.length, index = CharOperation.hashCode(key) % length;
  int keyLength = key.length;
  char[] currentKey;
  while ((currentKey = keyTable[index]) != null) {
    if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
      return true;
    if ( ++index == length) {
      index = 0;
    }
  }
  return false;
}

public [[#variablebb139960]] get(char[] key) {
  int length = keyTable.length, index = CharOperation.hashCode(key) % length;
  int keyLength = key.length;
  char[] currentKey;
  while ((currentKey = keyTable[index]) != null) {
    if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
      return valueTable[index];
    if ( ++index == length) {
      index = 0;
    }
  }
  return [[#variablebb139b00]];
}

public [[#variablebb139960]] put(char[] key, [[#variablebb139960]] value) {
  int length = keyTable.length, index = CharOperation.hashCode(key) % length;
  int keyLength = key.length;
  char[] currentKey;
  while ((currentKey = keyTable[index]) != null) {
    if (currentKey.length == keyLength && CharOperation.equals(currentKey, key))
      return valueTable[index] = value;
    if ( ++index == length) {
      index = 0;
    }
  }
  keyTable[index] = key;
  valueTable[index] = value;
  // assumes the threshold is never equal to the size of the table
  if ( ++elementSize > threshold)
    rehash();
  return value;
}

public [[#variablebb139960]] removeKey(char[] key) {
  int length = keyTable.length, index = CharOperation.hashCode(key) % length;
  int keyLength = key.length;
  char[] currentKey;
  while ((currentKey = keyTable[index]) != null) {
    if (currentKey.length == keyLength && CharOperation.equals(currentKey, key)) {
       [[#variablebb139960]] value = valueTable[index];
      elementSize--;
      keyTable[index] = null;
      valueTable[index] = [[#variablebb139b00]];
      rehash();
      return value;
    }
    if ( ++index == length) {
      index = 0;
    }
  }
  return [[#variablebb139b00]];
}

private void rehash() {
   [[#variableb9268960]] newHashtable = new [[#variableb9268960]](elementSize * 2); // double the number of expected elements
  char[] currentKey;
  for (int i = keyTable.length; --i >= 0;)
    if ((currentKey = keyTable[i]) != null)
      newHashtable.put(currentKey, valueTable[i]);
  this.keyTable = newHashtable.keyTable;
  this.valueTable = newHashtable.valueTable;
  this.threshold = newHashtable.threshold;
}

public int size() {
  return elementSize;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b9268960]]
HashtableOfIntValues 
12[[#b9268960]]
HashtableOfObject 
21[[#b91b77e0]]
new int[length] 
22[[#b91b77e0]]
new Object[length] 
31[[#bb139960]]
int 
32[[#bb139960]]
Object 
41[[#bb139b00]]
NO_VALUE 
42[[#bb139b00]]
null