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

MemoryUsage.from throws NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 24.0.2
    • core-svc

      A DESCRIPTION OF THE PROBLEM :
      A CompositeData contains a null value element, MemoryUsage.from(CompositeData) throws NPE.



      ---------- BEGIN SOURCE ----------
      import javax.management.openmbean.*;
      import java.lang.management.MemoryUsage;

      public class MemoryUsageCompositeData {
          public static void main(String[] argv) throws Exception {
              String[] names = {"committed", "init", "max", "used"};
              CompositeData cd = new CompositeDataSupport(
                  new CompositeType("MemoryUsage", "MemoryUsage composite type", names, names,
                      new OpenType[]{SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG}),
                  names,
                  new Object[]{null, 1024L, 10240L, 2048L});
              MemoryUsage.from(cd);
          }
      }
      ---------- END SOURCE ----------

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: