CloneSet54


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
96260.986class_body_declarations[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
19651
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java
29651
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java
Clone Instance
1
Line Count
96
Source Line
51
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java

/** Returns true if the collection contains an element for the key.
 *
 * @param key <CODE>double</CODE> the key that we are looking for
 * @return boolean
 */
public boolean containsKey(double key) {
        if (key == 0.0) {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == 0.0) {
                                long value1 = Double.doubleToLongBits(key);
                                long value2 = Double.doubleToLongBits(this.keyTable[i]);
                                if (value1 == -9223372036854775808L && value2 == -9223372036854775808L)
                                        return true;
                                if (value1 == 0 && value2 == 0)
                                        return true;
                        }
                }
        }
        else   {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == key) {
                                return true;
                        }
                }
        }
        return false;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>double</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int put(double key, int value) {
        if (this.elementSize == this.keyTable.length) {
                // resize
                System.arraycopy(this.keyTable, 0, (this.keyTable = new double[this.elementSize * 2]), 0, this.elementSize);
                System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
        }
        this.keyTable[this.elementSize] = key;
        this.valueTable[this.elementSize] = value;
        this.elementSize++;
        return value;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>double</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int putIfAbsent(double key, int value) {
        if (key == 0.0) {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == 0.0) {
                                long value1 = Double.doubleToLongBits(key);
                                long value2 = Double.doubleToLongBits(this.keyTable[i]);
                                if (value1 == -9223372036854775808L && value2 == -9223372036854775808L)
                                        return this.valueTable[i];
                                if (value1 == 0 && value2 == 0)
                                        return this.valueTable[i];
                        }
                }
        }
        else   {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == key) {
                                return this.valueTable[i];
                        }
                }
        }
        if (this.elementSize == this.keyTable.length) {
                // resize
                System.arraycopy(this.keyTable, 0, (this.keyTable = new double[this.elementSize * 2]), 0, this.elementSize);
                System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
        }
        this.keyTable[this.elementSize] = key;
        this.valueTable[this.elementSize] = value;
        this.elementSize++;
        return -value; // negative when added, assumes value is > 0
}

/**
 * Converts to a rather lengthy String.
 *
 * @return String the ascii representation of the receiver
 */
public String toString() {
        int max = this.elementSize;
        StringBuffer buf = new StringBuffer();
        buf.append("{"); //$NON-NLS-1$
        for (int i = 0; i < max; ++i) {
                if ((this.keyTable[i] != 0) || ((this.keyTable[i] == 0) && (this.valueTable[i] != 0))) {
                        buf.append(this.keyTable[i]).append("->").append(this.valueTable[i]); //$NON-NLS-1$
                }
                if (i < max) {
                        buf.append(", "); //$NON-NLS-1$
                }
        }
        buf.append("}"); //$NON-NLS-1$
        return buf.toString();
}


Clone Instance
2
Line Count
96
Source Line
51
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/FloatCache.java

/** Returns true if the collection contains an element for the key.
 *
 * @param key <CODE>float</CODE> the key that we are looking for
 * @return boolean
 */
public boolean containsKey(float key) {
        if (key == 0.0F) {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == 0.0F) {
                                int value1 = Float.floatToIntBits(key);
                                int value2 = Float.floatToIntBits(this.keyTable[i]);
                                if (value1 == -2147483648 && value2 == -2147483648)
                                        return true;
                                if (value1 == 0 && value2 == 0)
                                        return true;
                        }
                }
        }
        else   {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == key) {
                                return true;
                        }
                }
        }
        return false;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>float</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int put(float key, int value) {
        if (this.elementSize == this.keyTable.length) {
                // resize
                System.arraycopy(this.keyTable, 0, (this.keyTable = new float[this.elementSize * 2]), 0, this.elementSize);
                System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
        }
        this.keyTable[this.elementSize] = key;
        this.valueTable[this.elementSize] = value;
        this.elementSize++;
        return value;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>float</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int putIfAbsent(float key, int value) {
        if (key == 0.0F) {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == 0.0F) {
                                int value1 = Float.floatToIntBits(key);
                                int value2 = Float.floatToIntBits(this.keyTable[i]);
                                if (value1 == -2147483648 && value2 == -2147483648)
                                        return this.valueTable[i];
                                if (value1 == 0 && value2 == 0)
                                        return this.valueTable[i];
                        }
                }
        }
        else   {
                for (int i = 0, max = this.elementSize; i < max; i++) {
                        if (this.keyTable[i] == key) {
                                return this.valueTable[i];
                        }
                }
        }
        if (this.elementSize == this.keyTable.length) {
                // resize
                System.arraycopy(this.keyTable, 0, (this.keyTable = new float[this.elementSize * 2]), 0, this.elementSize);
                System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
        }
        this.keyTable[this.elementSize] = key;
        this.valueTable[this.elementSize] = value;
        this.elementSize++;
        return -value; // negative when added, assumes value is > 0
}

/**
 * Converts to a rather lengthy String.
 *
 * @return String the ascii representation of the receiver
 */
public String toString() {
        int max = this.elementSize;
        StringBuffer buf = new StringBuffer();
        buf.append("{"); //$NON-NLS-1$
        for (int i = 0; i < max; ++i) {
                if ((this.keyTable[i] != 0) || ((this.keyTable[i] == 0) && (this.valueTable[i] != 0))) {
                        buf.append(this.keyTable[i]).append("->").append(this.valueTable[i]); //$NON-NLS-1$
                }
                if (i < max) {
                        buf.append(", "); //$NON-NLS-1$
                }
        }
        buf.append("}"); //$NON-NLS-1$
        return buf.toString();
}


Clone AbstractionParameter Count: 6Parameter Bindings

/** Returns true if the collection contains an element for the key.
 *
 * @param key <CODE>double</CODE> the key that we are looking for
 * @return boolean
 */
/** Returns true if the collection contains an element for the key.
 *
 * @param key <CODE>float</CODE> the key that we are looking for
 * @return boolean
 */
public boolean containsKey( [[#variable5af43aa0]] key) {
  if (key == [[#variable5af43a20]]) {
    for (int i = 0, max = this.elementSize; i < max; i++) {
      if (this.keyTable[i] == [[#variable5af43a20]]) {
         [[#variable5af438c0]] value1 = [[#variable5af42940]]. [[#variable5af438a0]](key);
         [[#variable5af438c0]] value2 = [[#variable5af42940]]. [[#variable5af438a0]](this.keyTable[i]);
        if (value1 == - [[#variable5af43800]]&& value2 == - [[#variable5af43800]])
          return true;
        if (value1 == 0 && value2 == 0)
          return true;
      }
    }
  }
  else {
    for (int i = 0, max = this.elementSize; i < max; i++) {
      if (this.keyTable[i] == key) {
        return true;
      }
    }
  }
  return false;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>double</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>float</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int put( [[#variable5af43aa0]] key, int value) {
  if (this.elementSize == this.keyTable.length) {
    // resize
    System.arraycopy(this.keyTable, 0, (this.keyTable = new [[#variable5af43aa0]][this.elementSize * 2]), 0, this.elementSize);
    System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
  }
  this.keyTable[this.elementSize] = key;
  this.valueTable[this.elementSize] = value;
  this.elementSize++;
  return value;
}

/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>double</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
/**
 * Puts the specified element into the hashtable, using the specified
 * key.  The element may be retrieved by doing a get() with the same key.
 * 
 * @param key <CODE>float</CODE> the specified key in the hashtable
 * @param value <CODE>int</CODE> the specified element
 * @return int value
 */
public int putIfAbsent( [[#variable5af43aa0]] key, int value) {
  if (key == [[#variable5af43a20]]) {
    for (int i = 0, max = this.elementSize; i < max; i++) {
      if (this.keyTable[i] == [[#variable5af43a20]]) {
         [[#variable5af438c0]] value1 = [[#variable5af42940]]. [[#variable5af438a0]](key);
         [[#variable5af438c0]] value2 = [[#variable5af42940]]. [[#variable5af438a0]](this.keyTable[i]);
        if (value1 == - [[#variable5af43800]]&& value2 == - [[#variable5af43800]])
          return this.valueTable[i];
        if (value1 == 0 && value2 == 0)
          return this.valueTable[i];
      }
    }
  }
  else {
    for (int i = 0, max = this.elementSize; i < max; i++) {
      if (this.keyTable[i] == key) {
        return this.valueTable[i];
      }
    }
  }
  if (this.elementSize == this.keyTable.length) {
    // resize
    System.arraycopy(this.keyTable, 0, (this.keyTable = new [[#variable5af43aa0]][this.elementSize * 2]), 0, this.elementSize);
    System.arraycopy(this.valueTable, 0, (this.valueTable = new int[this.elementSize * 2]), 0, this.elementSize);
  }
  this.keyTable[this.elementSize] = key;
  this.valueTable[this.elementSize] = value;
  this.elementSize++;
  return -value; // negative when added, assumes value is > 0
}

/**
 * Converts to a rather lengthy String.
 *
 * @return String the ascii representation of the receiver
 */
public String toString() {
  int max = this.elementSize;
  StringBuffer buf = new StringBuffer();
  buf.append("{"); //$NON-NLS-1$
  for (int i = 0; i < max; ++i) {
    if ((this.keyTable[i] != 0) || ((this.keyTable[i] == 0) && (this.valueTable[i] != 0))) {
      buf.append(this.keyTable[i]).append("->").append(this.valueTable[i]); //$NON-NLS-1$
    }
    if (i < max) {
      buf.append(", "); //$NON-NLS-1$
    }
  }
  buf.append("}"); //$NON-NLS-1$
  return buf.toString();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#5af43aa0]]
double 
12[[#5af43aa0]]
float 
21[[#5af43a20]]
0.0 
22[[#5af43a20]]
0.0F 
31[[#5af438c0]]
long 
32[[#5af438c0]]
int 
41[[#5af42940]]
Double 
42[[#5af42940]]
Float 
51[[#5af438a0]]
doubleToLongBits 
52[[#5af438a0]]
floatToIntBits 
61[[#5af43800]]
9223372036854775808L 
62[[#5af43800]]
2147483648