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

(fmt) Add String.format support to Throwable

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P5
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

    Description

      A DESCRIPTION OF THE REQUEST :
      Add String.format() support to Throwable.

      Something like this:

      public Throwable(String message, Object... format);
      public Throwable(Throwable cause, String message, Object... format);

      I think the reasons are obvious but it keeps people from having to do:

      new Throwable(String.format("this bad thing happened: %s", badThing));

      I think this type of support should be added to *every* exception. I know that may be a large task but at least adding it to the more common user-thrown exceptions would be good (Exception, RuntimeException, etc...).

      JUSTIFICATION :
      Because doing this:

      new Throwable(String.format("this bad thing happened: %s", badThing)); is dumb...

      Attachments

        Activity

          People

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Imported:
              Indexed: