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

PlatformLogger.getLogger missing a null check

XMLWordPrintable

    • b01
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      openjdk version "1.8.0_432"
      OpenJDK Runtime Environment (Temurin)(build 1.8.0_432-b06)
      OpenJDK 64-Bit Server VM (Temurin)(build 25.432-b06, mixed mode)

      openjdk version "11.0.25" 2024-10-15
      OpenJDK Runtime Environment Temurin-11.0.25+9 (build 11.0.25+9)
      OpenJDK 64-Bit Server VM Temurin-11.0.25+9 (build 11.0.25+9, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      We found that the PlatformLogger.getLogger(String name) API lacks a null check. It's unreasonable for the parameter name to take a null value, and a null check should be performed, as well as a NullPointerException should be thrown. Additionally, we tested this API using the latest OpenJ9, and OpenJ9 does perform a null check in this case.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      NullPointerException

      ---------- BEGIN SOURCE ----------
      public class test {
          public static void main(String[] args) {
              PlatformLogger.getLogger(null);
          }
      }
      ---------- END SOURCE ----------

            kfarrell Kieran Farrell
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: