private int literalIndexForInvokeAndConstantDynamic(int bootStrapIndex, char[] selector, char[] descriptor, int tag) {
int index;
if ((index = putInDynamicCacheIfAbsent(bootStrapIndex, selector, descriptor, this.currentIndex)) < 0) {
this.currentIndex++;
if ((index = -index) > 0xFFFF){
this.classFile.referenceBinding.scope.problemReporter().noMoreAvailableSpaceInConstantPool(this.classFile.referenceBinding.scope.referenceType());
}
int length = this.offsets.length;
if (length <= index) {
System.arraycopy(this.offsets, 0, (this.offsets = new int[index * 2]), 0, length);
}
this.offsets[index] = this.currentOffset;
writeU1(tag);
int classIndexOffset = this.currentOffset;
if (this.currentOffset + 4 >= this.poolContent.length) {
resizePoolContents(4);
}
this.currentOffset+=4;
int nameAndTypeIndex = literalIndexForNameAndType(selector, descriptor);
this.poolContent[classIndexOffset++] = (byte) (bootStrapIndex >> 8);
this.poolContent[classIndexOffset++] = (byte) bootStrapIndex;
this.poolContent[classIndexOffset++] = (byte) (nameAndTypeIndex >> 8);
this.poolContent[classIndexOffset] = (byte) nameAndTypeIndex;
}
return index;
}