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

Errors in ObjectName constructors.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • core-svc
    • None
    • b27
    • generic
    • generic

      --------------------------
      --- ObjectName(String) ---
      --------------------------

      ----------------------------------------------
      Accepted but should be rejected (key is empty)
      ----------------------------------------------
      ObjectName = d:=v

      ----------------------------------------------
      Rejected but should be accepted (value can be empty)
      ----------------------------------------------
      ObjectName = d:k=
      javax.management.MalformedObjectNameException: Unterminated key property part
      at javax.management.ObjectName.construct(ObjectName.java:465)
      at javax.management.ObjectName.<init>(ObjectName.java:1302)
      at NullEmptyKeyValue.createObjectName(NullEmptyKeyValue.java:11)
      at NullEmptyKeyValue.main(NullEmptyKeyValue.java:56)

      ----------------------------------------
      --- ObjectName(String,String,String) ---
      ----------------------------------------

      ----------------------------------------------
      Should throw NullPointerException instead of MalformedObjectNameException
      ----------------------------------------------
      ObjectName.Domain = d
      ObjectName.Key = k
      ObjectName.Value = null
      javax.management.MalformedObjectNameException: Invalid value (null)
      at javax.management.ObjectName.checkValue(ObjectName.java:888)
      at javax.management.ObjectName.construct(ObjectName.java:630)
      at javax.management.ObjectName.<init>(ObjectName.java:1324)
      at NullEmptyKeyValue.createObjectName2(NullEmptyKeyValue.java:27)
      at NullEmptyKeyValue.main(NullEmptyKeyValue.java:64)

      ----------------------------------------------
      Rejected but should be accepted (value can be empty)
      ----------------------------------------------
      ObjectName.Domain = d
      ObjectName.Key = k
      ObjectName.Value =
      javax.management.MalformedObjectNameException: Invalid value (empty)
      at javax.management.ObjectName.checkValue(ObjectName.java:892)
      at javax.management.ObjectName.construct(ObjectName.java:630)
      at javax.management.ObjectName.<init>(ObjectName.java:1324)
      at NullEmptyKeyValue.createObjectName2(NullEmptyKeyValue.java:27)
      at NullEmptyKeyValue.main(NullEmptyKeyValue.java:65)

      ------------------------------------
      --- ObjectName(String,Hashtable) ---
      ------------------------------------

      ----------------------------------------------
      Rejected but should be accepted (value can be empty)
      ----------------------------------------------
      ObjectName.Domain = d
      ObjectName.Hashtable = {k=}
      javax.management.MalformedObjectNameException: Invalid value (empty)
      at javax.management.ObjectName.checkValue(ObjectName.java:892)
      at javax.management.ObjectName.construct(ObjectName.java:630)
      at javax.management.ObjectName.<init>(ObjectName.java:1345)
      at NullEmptyKeyValue.createObjectName3(NullEmptyKeyValue.java:42)
      at NullEmptyKeyValue.main(NullEmptyKeyValue.java:78)

      ###@###.### 2005-2-16 10:05:52 GMT

            lmalvent Luis-Miguel Alventosa (Inactive)
            lmalvent Luis-Miguel Alventosa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: