jdereg / json-io

Convert Java to JSON. Convert JSON to Java. Pretty print JSON. Java JSON serializer. Deep copy Java object graphs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Illegal reflective access

gskorupa opened this issue · comments

commented

When running my application that uses json-io 4.10.0 on Java 10 several warnings appear: see below.
Anyway, thanks for the great job!

WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.HashMap.table
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.HashMap.entrySet
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.HashMap.size
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:dist/cricket-1.2.38.jar) to field java.util.HashMap.modCount
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.HashMap.threshold
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.HashMap.loadFactor
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.AbstractMap.keySet
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (file:cricket-1.2.38.jar) to field java.util.AbstractMap.values

Hi Greg, have you been able to resolve this? I'm facing the same issue in my project:
WARNING: Illegal reflective access by com.cedarsoftware.util.io.MetaUtils (jar:file:/C:/Applications/INSTALLER/bravura-installer.jar!/lib/json-io-4.10.1.jar!/) to constructor java.io.File(java.lang.String,int)

Does it mean that json-io uses reflection ?

This should be fixed in the 4.11.0 release. The library indeed uses reflection in order to extract values from the objects it serializes. That is not what was causing this warning, however. The source of this warning is the use of .setAccessible() API, which I have removed.