| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 96 | 2 | 6 | 0.986 | class_body_declarations[4] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 96 | 51 | plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/DoubleCache.java |
| 2 | 96 | 51 | 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>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();
}
|
| ||||
/** 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();
}
|
| |||
/** 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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#5af43aa0]] | double |
| 1 | 2 | [[#5af43aa0]] | float |
| 2 | 1 | [[#5af43a20]] | 0.0 |
| 2 | 2 | [[#5af43a20]] | 0.0F |
| 3 | 1 | [[#5af438c0]] | long |
| 3 | 2 | [[#5af438c0]] | int |
| 4 | 1 | [[#5af42940]] | Double |
| 4 | 2 | [[#5af42940]] | Float |
| 5 | 1 | [[#5af438a0]] | doubleToLongBits |
| 5 | 2 | [[#5af438a0]] | floatToIntBits |
| 6 | 1 | [[#5af43800]] | 9223372036854775808L |
| 6 | 2 | [[#5af43800]] | 2147483648 |