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

Spec of ForwardingJavaFileManager/ForwardingFileObject/ForwardingJavaFileObject methods should mention delegation instead of being copied

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 17
    • 18
    • tools
    • b06

    Description

      The following classes

        https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/ForwardingFileObject.html
        https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/ForwardingJavaFileObject.html
        https://docs.oracle.com/en/java/javase/16/docs/api/java.compiler/javax/tools/ForwardingJavaFileManager.html

      are expected to forward all calls to the given file manager or file object or java file object and this is mentioned at class level specs:

      > Forwards calls to a given file object
      > Forwards calls to a given file manager

      However specification for their methods is simply copied from FileObject, JavaFileObject, JavaFileManager interfaces.

      This leads to misleading specs for forwarding implementations of interface methods, since the original specs of the interfaces often refer to "this file object" or "this file manager" and these assertions are just copied.

      Specification for methods of ForwardingX should be overridden to provide correct assertions and expectations.
      Or it should be just hidden somehow since there's nothing actually for this methods to specify in addition to what's said at class level:

      > Forwards calls to a given file object
      > Forwards calls to a given file manager




      Attachments

        Issue Links

          Activity

            People

              jjg Jonathan Gibbons
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: