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

XML output could be optimized

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7
    • client-libs
    • Fix Understood
    • x86
    • windows_xp

      XML output could be optimized with already added <field> tag.

      Consider expected and actual XML files for the following object:

          public class Value {
              public int i = 10;
              public String s;
          }
          public class Bean {
              private Value value = new Value();
              public Value getValue() { return this.value; }
              public void setValue(Value value) { this.value = value; }
          }
          Bean bean = new Bean();
          bean.getBean().i = 0;
          bean.getBean().s = "name";


      Expected:
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0-internal" class="java.beans.XMLDecoder">
       <object class="Bean">
        <void id="Value0" property="value">
         <field name="i">
          <int>0</int>
         </field>
         <field name="s">
          <string>name</string>
         </field>
        </void>
       </object>
      </java>


      Actual:
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0-internal" class="java.beans.XMLDecoder">
       <object class="Bean">
        <void id="Value0" property="value">
         <void class="Value" method="getField">
          <string>i</string>
          <void method="set">
           <object idref="Value0">
            <void class="Value" method="getField">
             <string>s</string>
             <void method="set">
              <object idref="Value0"/>
              <string>name</string>
             </void>
            </void>
           </object>
           <int>0</int>
          </void>
         </void>
        </void>
       </object>
      </java>

            malenkov Sergey Malenkov (Inactive)
            malenkov Sergey Malenkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: