JDK-8168101 : java.io.OptionalDataException should have public constructors
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2016-10-17
  • Updated: 2022-03-31
  • Resolved: 2018-05-21
Related Reports
Relates :  
Description
java.io.OptionalDataException has only package private constructors.
To ease its use by non-JDK serialization mechanisms it should have public constructors.

The public fields for eof and length are another anomaly.  Adding getter methods would be a useful addition and deprecating the public fields.
Comments
No compelling rationale to add constructors
21-05-2018