Uploaded image for project: 'DMR'
  1. DMR
  2. DMR-39

ListModelValue.asPropertyList() can discard items from non-PROPERTY/non-OBJECT lists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.5.0.Final
    • 1.4.1.Final
    • None

      This will fail on the last line:

      ModelNode list = new ModelNode();
      list.add("a");
      list.add("b");
      list.add("c");
      List<Property> propList = list.asPropertyList();
      assert propList.get(0).getName().equals("a");
      assert propList.get(0).getValue().asString().equals("b");
      assert propList.size() > 1;
      

      The unmatched "c" gets dropped.

      A list like this should fail in asPropertyList() with an IAE. In theory we could add a Property with name "c" and an undefined value, but since this never worked before I think we shouldn't try and support an ambiguous thing like this and should just reject it.

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: