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

Add asserts to Reference.getInactive()

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      generic
    • OS:
      generic

      Description

      A follow-up to JDK-8256106, this is adding two asserts to check that the API is used as it should be, i.e. only on inactive FinalReferences. Also, in Finalizer, where getInactive() is used, there is a null-check. The GC must never clean the referent, and Java code doesn't clean it either, it would be a bug if we ever see null there. I think it's better to fail there (with assert or NPE) when that happens instead of silently accepting it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rkennke Roman Kennke
              Reporter:
              rkennke Roman Kennke
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: