javac could wrap user provided file managers

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: None
    • Component/s: tools
    • None

      Currently, javac allows a user to specify a file manager to the JavaCompiler API.

      The current behavior is that specifying some options, like -classpath, -source, etc, have an unspecified permanent side effect on the user provided file manager.

      In addition, as noted in JDK-8139607, options like -release only work in conjunction with a StandardJavaFileManager.

      A different approach would be for javac to "wrap" any user provided file manager with an instance-specific file manager, such that any changes resulting from javac options are confined to that instance, and not propagated to the user-provided file manager.

      Thus, the behavior of methods in such a wrapper would be:
          if this method is affected by local changes, impl the method locally; otherwise, delegate to the user provided file manager.

      Note that (separately) the user file manager is already wrapped using ClientCodeWrapper, which exists to trap exceptions in a user provided file manager. The wrapping described here would be in addition to the use of ClientCodeWrapper.

            Assignee:
            Unassigned
            Reporter:
            Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: