Adds a CONSTANT_NameAndType_info to the constant pool of this symbol table. Does nothing if the constant pool already contains a similar item. @param name a field or method name. @param descriptor a field or method descriptor. @return a new or already existing Symbol with the given value.
(final String name, final String descriptor)
| 738 | * @return a new or already existing Symbol with the given value. |
| 739 | */ |
| 740 | int addConstantNameAndType(final String name, final String descriptor) { |
| 741 | final int tag = Symbol.CONSTANT_NAME_AND_TYPE_TAG; |
| 742 | int hashCode = hash(tag, name, descriptor); |
| 743 | Entry entry = get(hashCode); |
| 744 | while (entry != null) { |
| 745 | if (entry.tag == tag |
| 746 | && entry.hashCode == hashCode |
| 747 | && entry.name.equals(name) |
| 748 | && entry.value.equals(descriptor)) { |
| 749 | return entry.index; |
| 750 | } |
| 751 | entry = entry.next; |
| 752 | } |
| 753 | constantPool.put122(tag, addConstantUtf8(name), addConstantUtf8(descriptor)); |
| 754 | return put(new Entry(constantPoolCount++, tag, name, descriptor, hashCode)).index; |
| 755 | } |
| 756 | |
| 757 | /** |
| 758 | * Adds a new CONSTANT_NameAndType_info to the constant pool of this symbol table. |
no test coverage detected