MCPcopy Create free account
hub / github.com/beanshell/beanshell / put

Method put

src/bsh/org/objectweb/asm/ClassWriter.java:926–947  ·  view source on GitHub ↗

Puts the given item in the constant pool's hash table. The hash table must not already contains this item. @param i the item to be added to the constant pool's hash table.

(final Item i)

Source from the content-addressed store, hash-verified

924 */
925
926 private void put (final Item i) {
927 if (index > threshold) {
928 int oldCapacity = table.length;
929 Item oldMap[] = table;
930 int newCapacity = oldCapacity * 2 + 1;
931 Item newMap[] = new Item[newCapacity];
932 threshold = (int)(newCapacity * 0.75);
933 table = newMap;
934 for (int j = oldCapacity; j-- > 0; ) {
935 for (Item old = oldMap[j]; old != null; ) {
936 Item e = old;
937 old = old.next;
938 int index = (e.hashCode & 0x7FFFFFFF) % newCapacity;
939 e.next = newMap[index];
940 newMap[index] = e;
941 }
942 }
943 }
944 int index = (i.hashCode & 0x7FFFFFFF) % table.length;
945 i.next = table[index];
946 table[index] = i;
947 }
948
949 /**
950 * Puts one byte and two shorts into the constant pool.

Callers 11

newUTF8Method · 0.95
newClassMethod · 0.95
newFieldMethod · 0.95
newMethodMethod · 0.95
newItfMethodMethod · 0.95
newIntegerMethod · 0.95
newFloatMethod · 0.95
newLongMethod · 0.95
newDoubleMethod · 0.95
newStringMethod · 0.95
newNameTypeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected