According to javadoc, MemoryAccessProvider.readUnsafeConstant should throw IllegalArgumentException only. However, current implementation throws NullPointerException in case kind == null. So, implementation or javadoc should be updated to match each other.