Duplicate :
|
|
Relates :
|
A DESCRIPTION OF THE REGRESSION : Works in 5.0 but not Mustang b77. Have not tested other builds. XMLEncoder encoder = new XMLEncoder(new FileOutputStream("C:/temp.txt")); encoder.writeObject(new Insets(1, 1, 1, 1)); The bug is probably related to 5082816 that got broken in 5.0 beta 2. That bug is confirmed but not fixed. This is a new bug though since this code works in 5.0. REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE: public class TestCase { public static void main(String[] args) { try { XMLEncoder enc = new XMLEncoder(new FileOutputStream("Test.xml")); enc.writeObject(new Insets(0, 0, 0, 0)); enc.close(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } } } RELEASE LAST WORKED: 5.0 Update 6 RELEASE TEST FAILS: mustang-beta EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - An XML File ACTUAL - java.lang.NoSuchMethodException: java.awt.Insets.getTop() Continuing ... java.lang.NoSuchMethodException: java.awt.Insets.getLeft() Continuing ... java.lang.NoSuchMethodException: java.awt.Insets.getBottom() Continuing ... java.lang.NoSuchMethodException: java.awt.Insets.getRight() Continuing ... java.lang.IllegalArgumentException Continuing ... java.lang.Exception: XMLEncoder: discarding statement XMLEncoder.writeObject(Insets); OBSERVED APPLICATION IMPACT: This will break any application that is using the XMLEncoder/XMLDecoder and with it serializes an Insets() object.