Open
Description
I'm using org.influxdb:influxdb-java:2.10
.
I'd like to limit my @Measurement
classes visibility to package-private, but currently it doesn't work because of the following exception:
org.influxdb.InfluxDBMapperException: java.lang.IllegalAccessException: Class org.influxdb.impl.InfluxDBResultMapper can not access a member of class com.example.MyMeasurement with modifiers "public"
The line which causes this is https://github.com/influxdata/influxdb-java/blob/influxdb-java-2.10/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java#L160.
Looks like it will be enough to replace
object = clazz.newInstance();
with
Constructor<T> defaultConstructor = clazz.getDeclaredConstructor();
defaultConstructor.setAccessible(true);
object = declaredConstructor.newInstance();
If there are no objections, I'll provide a PR.