(fmt) Add String.format support to Throwable

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P5
    • None
    • Affects Version/s: 5.0
    • Component/s: core-libs
    • x86
    • windows_xp

      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...

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

              Created:
              Updated:
              Imported:
              Indexed: