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

argument formatting for assert() and friends

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: hs17
    • Fix Version/s: hs18
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b05
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        The HotSpot assert(), guarantee(), etc., macros require a message argument which is printed if the condition does not hold, e.g.:

           assert(referent->is_oop(), "bad referent");

        As currently implemented the message must be a string literal. It would be much more useful if multiple arguments could be used with format strings to provide more information, e.g.:

           assert(referent->is_oop(), "bad referent %p", referent);

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jcoomes John Coomes
                  Reporter:
                  jcoomes John Coomes
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: