Skip to content

Commit

Permalink
readme - move indications to the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
lytles@takashi committed Sep 27, 2018
1 parent f520430 commit e9ebda3
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,6 @@ see the `demo` and `pshell` directories for some usage examples



## indications

starting with java 9, most reflection is considered "illegal". eg, running `demo.DemoNormal` **without a security manager** you'll get the following warning and exception:

```
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by demo.DemoNormal
(file:/.../permit-reflect/demo/target/classes/) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of demo.DemoNormal
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.IllegalAccessError:
class demo.DemoNormal (in unnamed module @0xb065c63)
cannot access class jdk.internal.jshell.tool.JShellToolBuilder (in module jdk.jshell)
because module jdk.jshell does not export jdk.internal.jshell.tool to unnamed module @0xb065c63
at demo.DemoNormal.main(DemoNormal.java:27)
```

this was access that was fine with java 8 and earlier

modules can also prevent compiling code with java 11 (or 9 or 10), eg:
```
src/demo/Pshell.java:12: error: package jdk.internal.jshell.tool is not visible
jdk.internal.jshell.tool.JShellTool tool
^
(package jdk.internal.jshell.tool is declared in module jdk.jshell, which does not export it)
```

a developer can work around these problems with `--add-exports` or by compiling with java 8.
`permit-reflect` can't help with these compilation issues



## installation

Expand Down Expand Up @@ -151,3 +118,36 @@ help keep the freedom in java by exercising reflection !



## indications

starting with java 9, most reflection is considered "illegal". eg, running `demo.DemoNormal` **without a security manager** you'll get the following warning and exception:

```
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by demo.DemoNormal
(file:/.../permit-reflect/demo/target/classes/) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of demo.DemoNormal
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.IllegalAccessError:
class demo.DemoNormal (in unnamed module @0xb065c63)
cannot access class jdk.internal.jshell.tool.JShellToolBuilder (in module jdk.jshell)
because module jdk.jshell does not export jdk.internal.jshell.tool to unnamed module @0xb065c63
at demo.DemoNormal.main(DemoNormal.java:27)
```

this was access that was fine with java 8 and earlier

modules can also prevent compiling code with java 11 (or 9 or 10), eg:
```
src/demo/Pshell.java:12: error: package jdk.internal.jshell.tool is not visible
jdk.internal.jshell.tool.JShellTool tool
^
(package jdk.internal.jshell.tool is declared in module jdk.jshell, which does not export it)
```

a developer can work around these problems with `--add-exports` or by compiling with java 8.
`permit-reflect` can't help with these compilation issues


0 comments on commit e9ebda3

Please sign in to comment.