private void createConstantPoolReference(Data constantPoolData,
			AbstractConstantPoolInfoJava constantPoolInfo, BootstrapMethods[] bootstrapMethods,
			Map<Integer, Integer> indexMap, int i) {

		if (constantPoolInfo instanceof ConstantPoolClassInfo ||
			constantPoolInfo instanceof ConstantPoolStringInfo ||
			constantPoolInfo instanceof ConstantPoolMethodTypeInfo) {
			Data data = constantPoolData.getComponent(indexMap.get(i));
			Data indexData = data.getComponent(1);
			Object indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}

		}
		else if (constantPoolInfo instanceof ConstantPoolFieldReferenceInfo ||
			constantPoolInfo instanceof ConstantPoolMethodReferenceInfo ||
			constantPoolInfo instanceof ConstantPoolInterfaceMethodReferenceInfo ||
			constantPoolInfo instanceof ConstantPoolNameAndTypeInfo) {
			Data data = constantPoolData.getComponent(indexMap.get(i));
			Data indexData = data.getComponent(1);
			Object indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}
			indexData = data.getComponent(2);
			indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}
		}
		else if (constantPoolInfo instanceof ConstantPoolInvokeDynamicInfo) {
			Data data = constantPoolData.getComponent(indexMap.get(i));
			Data indexData = data.getComponent(1);
			Object indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				BootstrapMethods bootstrapMethod = bootstrapMethods[index];
				index = bootstrapMethod.getBootstrapMethodsReference() & 0xFFFF;
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}
			indexData = data.getComponent(2);
			indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}
		}
		else if (constantPoolInfo instanceof ConstantPoolMethodHandleInfo) {
			Data data = constantPoolData.getComponent(indexMap.get(i));
			Data indexData = data.getComponent(2);
			Object indexValue = indexData.getValue();
			if (indexValue instanceof Scalar) {
				int index = (int) (((Scalar) indexValue).getValue() & 0xFFFF);
				Data referredData = constantPoolData.getComponent(indexMap.get(index));
				indexData.addValueReference(referredData.getAddress(), RefType.DATA);
			}
		}
	}
Create datatypes for all classes mentioned in the constant pool
@param program program file
@param classFile ClassFileJava associated with {@code program} 
@param monitor for canceling analysis
@param messageLog for logging messages
Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/analyzers/JavaAnalyzer.java