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
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
- csr for
-
JDK-8270037 Spec of ForwardingJavaFileManager/ForwardingFileObject/ForwardingJavaFileObject methods should mention delegation instead of being copied
-
- Closed
-