-
Bug
-
Resolution: Fixed
-
P3
-
7
-
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>
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>
- relates to
-
JDK-6953447 XML output could be optimized
- Open