Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8149604

javac could wrap user provided file managers

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • None
    • 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.

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

              Created:
              Updated: