Creates a new ConstantsBuffer which is already preinitialized to contain the constants defined by the respective org.opalj.br.instructions.LDC instructions.
Creates a new ConstantsBuffer which is already preinitialized to contain the constants defined by the respective org.opalj.br.instructions.LDC instructions.
This is necessary to ensure that these entries are assigned values less than 255, because the constant pool reference used by LDC instructions is just one unsigned byte.
The set of unique LDC instructions. For each constant referred to by an LDC
instruction we (need to) create the required ConstantPool entry right away to
ensure the index is an unsigned byte value.
To collect a org.opalj.br.ClassFile's ldc instructions use collectLDCs.
If a class has more than 254 unique constants and all of them use simple LDC (not
LDC_W) instructions, a ConstantPoolException will be thrown.
Furthermore, a ConstantPoolException is thrown if the maximum size of the pool
(65535 entries) is exceeded.
Factory methods and helper methods to create a valid ConstantsBuffer.