/** * Rehashes the content of the table into a bigger table. * This method is called automatically when the hashtable's * size exceeds the threshold. */ private void rehash() { ObjectCache newHashtable = new ObjectCache(this.keyTable.length * 2); for (int i = this.keyTable.length; --i >= 0;) if (this.keyTable[i] != null) newHashtable.put(this.keyTable[i], this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } /**
public UnconditionalFlowInfo initsOnException(ReferenceBinding exceptionType) { int index; if ((index = this.indexes.get(exceptionType)) < 0) { return FlowInfo.DEAD_END; } return this.initsOnExceptions[index]; }
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** Returns true if the collection contains an element for the key. * * @param key char[] the key that we are looking for * @return boolean */ public boolean containsKey(Object key) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /** Gets the object associated with the specified key in the
/** * Converts to a rather lengthy String. * * @return String the ascii representation of the receiver */ public String toString() { int max = size(); StringBuffer buf = new StringBuffer(); buf.append("{"); //$NON-NLS-1$ for (int i = 0; i < max; ++i) { if (this.keyTable[i] != null) { 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(); } }
for (int i = 0; i < count; i++) { ReferenceBinding handledException = handledExceptions[i]; this.indexes.put(handledException, i); // key type -> value index if (handledException.isUncheckedException(true)) { if (markExceptionsAndThrowableAsReached ||
/** Returns true if the collection contains an element for the key. * * @param key char[] the key that we are looking for * @return boolean */ public boolean containsKey(Object key) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /** Gets the object associated with the specified key in the
/** * Converts to a rather lengthy String. * * @return String the ascii representation of the receiver */ public String toString() { int max = size(); StringBuffer buf = new StringBuffer(); buf.append("{"); //$NON-NLS-1$ for (int i = 0; i < max; ++i) { if (this.keyTable[i] != null) { 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(); } }
ReferenceBinding handledException = handledExceptions[i]; int catchBlock = this.exceptionToCatchBlockMap != null? this.exceptionToCatchBlockMap[i] : i; this.indexes.put(handledException, i); // key type -> value index if (handledException.isUncheckedException(true)) { if (markExceptionsAndThrowableAsReached ||
/** * Rehashes the content of the table into a bigger table. * This method is called automatically when the hashtable's * size exceeds the threshold. */ private void rehash() { ObjectCache newHashtable = new ObjectCache(this.keyTable.length * 2); for (int i = this.keyTable.length; --i >= 0;) if (this.keyTable[i] != null) newHashtable.put(this.keyTable[i], this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
public UnconditionalFlowInfo initsOnException(ReferenceBinding exceptionType) { int index; if ((index = this.indexes.get(exceptionType)) < 0) { return FlowInfo.DEAD_END; } return this.initsOnExceptions[index]; }
/** Returns true if the collection contains an element for the key. * * @param key char[] the key that we are looking for * @return boolean */ public boolean containsKey(Object key) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /** Gets the object associated with the specified key in the
/** * Converts to a rather lengthy String. * * @return String the ascii representation of the receiver */ public String toString() { int max = size(); StringBuffer buf = new StringBuffer(); buf.append("{"); //$NON-NLS-1$ for (int i = 0; i < max; ++i) { if (this.keyTable[i] != null) { 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(); } }
for (int i = 0; i < count; i++) { ReferenceBinding handledException = handledExceptions[i]; this.indexes.put(handledException, i); // key type -> value index if (handledException.isUncheckedException(true)) { if (markExceptionsAndThrowableAsReached ||
/** * Rehashes the content of the table into a bigger table. * This method is called automatically when the hashtable's * size exceeds the threshold. */ private void rehash() { ObjectCache newHashtable = new ObjectCache(this.keyTable.length * 2); for (int i = this.keyTable.length; --i >= 0;) if (this.keyTable[i] != null) newHashtable.put(this.keyTable[i], this.valueTable[i]); this.keyTable = newHashtable.keyTable; this.valueTable = newHashtable.valueTable; this.threshold = newHashtable.threshold; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
public void recordHandlingException( ReferenceBinding exceptionType, UnconditionalFlowInfo flowInfo, TypeBinding raisedException, ASTNode invocationSite, boolean wasAlreadyDefinitelyCaught) { int index = this.indexes.get(exceptionType); int cacheIndex = index / ExceptionHandlingFlowContext.BitCacheSize; int bitMask = 1 << (index % ExceptionHandlingFlowContext.BitCacheSize); if (!wasAlreadyDefinitelyCaught) { this.isNeeded[cacheIndex] |= bitMask; } this.isReached[cacheIndex] |= bitMask; this.initsOnExceptions[index] = (this.initsOnExceptions[index].tagBits & FlowInfo.UNREACHABLE) == 0 ? this.initsOnExceptions[index].mergedWith(flowInfo): flowInfo.unconditionalCopy(); }
/** Returns true if the collection contains an element for the key. * * @param key char[] the key that we are looking for * @return boolean */ public boolean containsKey(Object key) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /** Gets the object associated with the specified key in the
/** * Converts to a rather lengthy String. * * @return String the ascii representation of the receiver */ public String toString() { int max = size(); StringBuffer buf = new StringBuffer(); buf.append("{"); //$NON-NLS-1$ for (int i = 0; i < max; ++i) { if (this.keyTable[i] != null) { 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(); } }