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

NullPointerException in java.util.logging.Handler#isLoggable

XMLWordPrintable

        A DESCRIPTION OF THE PROBLEM :
        The JavaDoc of this method states that "It will return false if the {@code LogRecord} is null.", but there is no null-check. Instead in the second line of the method a call is done on the log record, resulting in NPE.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Call java.util.logging.Handler#isLoggable with null argument.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        false
        ACTUAL -
        NullPointerException

        CUSTOMER SUBMITTED WORKAROUND :
        Override the method in every handler and add a null-check

        FREQUENCY : always


              dfuchs Daniel Fuchs
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: