concept nothing in category java
appears as: nothing

This is an excerpt from Manning's book The Java Module System.
These aren’t technical requirements; nothing stops you from targeting Java 11 and putting half of the code in
src/main/javaand the other half, or even all of it, insrc/main/java-11. But that will only cause confusion.
Figure 1.10 The maintainers of Eclipse JGit didn’t intend the types in
org.eclipse.jgit.internalfor public consumption. Unfortunately, because Java has no concept of JAR internals, there’s nothing the maintainers can do to stop anycom.company.Typefrom compiling against it. Even if it were only package visible, it could still be accessed via reflection.![]()
Reflection is bound by the same accessibility rules as regular code. Regarding having to read the module that you access, the reflection API makes things easier by implicitly adding a reads edge. Regarding exported or opened packages, there’s nothing the author of the reflecting code can do about it if a module owner didn’t prepare their module for it. (The only solution would be the --add-openscommand-line option.)