JDK-5033028 : (fmt) IllegalFormatException contructor should be package-private, not public
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-04-16
  • Updated: 2017-05-16
  • Resolved: 2004-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b49Fixed
Related Reports
Relates :  
Description
External users should not instantiate IllegalFormatException.  If a formatting
error occurs, the explicit subtype which describes the error should be used.

-- iag@sfbay 2004-04-16

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b49 tiger-beta2
14-06-2004

SUGGESTED FIX *************** *** 9,20 **** /** * Unchecked exception thrown when a format string contains an illegal syntax ! * or a format specifier that is incompatible with the given arguments. * - * <p> Unless otherwise specified, passing a <tt>null</tt> argument to any - * method or constructor in this class will cause a {@link - * NullPointerException} to be thrown. - * * @version %I%, %G% * @since 1.5 */ --- 9,18 ---- /** * Unchecked exception thrown when a format string contains an illegal syntax ! * or a format specifier that is incompatible with the given arguments. Only ! * explicit subtypes of this exception which correspond to specific errors ! * should be instantiated. * * @version %I%, %G% * @since 1.5 */ *************** *** 21,29 **** public class IllegalFormatException extends IllegalArgumentException { private static final long serialVersionUID = 18830826L; ! ! /** ! * Constructs an instance of this class. ! */ ! public IllegalFormatException() { } } --- 19,25 ---- public class IllegalFormatException extends IllegalArgumentException { private static final long serialVersionUID = 18830826L; ! ! // package-private to prevent explicit instantiation ! IllegalFormatException() { } } -- iag@sfbay 2004-04-16
16-04-2004

EVALUATION The suggested fix should be implemented. -- iag@sfbay 2004-04-16
16-04-2004