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

HotSpot Style Guide promotes ShouldNotReachHere

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot

      The Style Guide currently says:

        Implement classes as if expecting rough usage by clients. Check for
        incorrect usage of a class
        using `assert(...)`, `guarantee(...)`, `ShouldNotReachHere()` and
        comments wherever needed. Performance is almost never a reason to
        omit asserts.

      The Compiler team made an effort to replace ShouldNotReachHere() with fatal("descriptive message"), which gives useful information without needing to look at a backtrace. Maybe there should be common guidance about this. Perhaps deprecate ShouldNotReachHere in favor of something more informative. Or perhaps ShouldNotReachHere should take message arguments.

            Unassigned Unassigned
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: