JDK-8139607 : -release option forces StandardJavaFileManager
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-14
  • Updated: 2017-11-10
  • Resolved: 2017-11-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10 b31Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The -release option throws an exception if a JSR199 implementation uses a JavaFileManager instead of a StandardJavaFileManager:
Error: -release option specified, but the provided JavaFileManager is not a StandardJavaFileManager.

This basically forces any decent JSR199 implementation to use StandardJavaFileManager even if they don't want to.

I wonder if StandardJavaFileManager is really necessary. With the -release option you're basically telling Javac to use the appropriate bootclasspath, so Javac can look there first without having to set it in StandardJavaFileManager and then retrieve it from there again.
Comments
One possible solution is that internally, javac could wrap any user-provided file manager, diverting use of PLATFORM_CLASS_PATH to the -release mechanism, and all else to the user-provided file manager. That being said, the recent fix for JDK-8059976 is a big step in the right direction to enable folk to provide their own virtual file system instead of their own JavaFileManager.
09-12-2015