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

LTP: XMLEncoder does not update initialized property of GridBagConstraints type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • client-libs
    • b97
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.7.0-internal"
      Java(TM) SE Runtime Environment (build 1.7.0-internal-sm162706_05_oct_2006_15_12-b00)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b100, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP Professional Service Pack 2

      A DESCRIPTION OF THE PROBLEM :
      The bean with initialized property could not be encoded/decoded successfully.

          public class GridBagConstraintsBeanGood {
              private GridBagConstraints gbc;

              public GridBagConstraints getGridBagConstraints() {
                  return this.gbc;
              }

              public void setGridBagConstraints( GridBagConstraints gbc ) {
                  this.gbc = gbc;
              }
          }

          public class GridBagConstraintsBeanBad {
              private GridBagConstraints gbc = new GridBagConstraints();

              public GridBagConstraints getGridBagConstraints() {
                  return this.gbc;
              }

              public void setGridBagConstraints( GridBagConstraints gbc ) {
                  this.gbc = gbc;
              }
          }

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create instances of beans.
      2. Set new value of the property for each of them.
      3. Encode and decode modified instances.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0-internal" class="java.beans.XMLDecoder">
       <object class="GridBagConstraintsBeanGood">
        <void property="gridBagConstraints">
         <object class="java.awt.GridBagConstraints">
          <int>1</int>
          <int>2</int>
          <int>3</int>
          <int>4</int>
          <double>0.1</double>
          <double>0.2</double>
          <int>11</int>
          <int>3</int>
          <object class="java.awt.Insets">
           <int>1</int>
           <int>2</int>
           <int>4</int>
           <int>3</int>
          </object>
          <int>-1</int>
          <int>-2</int>
         </object>
        </void>
       </object>
       <object class="GridBagConstraintsBeanBad">
        <void property="gridBagConstraints">
         <object class="java.awt.GridBagConstraints">
          <int>1</int>
          <int>2</int>
          <int>3</int>
          <int>4</int>
          <double>0.1</double>
          <double>0.2</double>
          <int>11</int>
          <int>3</int>
          <object class="java.awt.Insets">
           <int>1</int>
           <int>2</int>
           <int>4</int>
           <int>3</int>
          </object>
          <int>-1</int>
          <int>-2</int>
         </object>
        </void>
       </object>
      </java>
      ACTUAL -
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0-internal" class="java.beans.XMLDecoder">
       <object class="GridBagConstraintsBeanGood">
        <void property="gridBagConstraints">
         <object class="java.awt.GridBagConstraints">
          <int>1</int>
          <int>2</int>
          <int>3</int>
          <int>4</int>
          <double>0.1</double>
          <double>0.2</double>
          <int>11</int>
          <int>3</int>
          <object class="java.awt.Insets">
           <int>1</int>
           <int>2</int>
           <int>4</int>
           <int>3</int>
          </object>
          <int>-1</int>
          <int>-2</int>
         </object>
        </void>
       </object>
       <object class="GridBagConstraintsBeanBad"/>
      </java>

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: