JDK-6402062 : LTP: XMLEncoder could not write object of type java.awt.Insets (fails since mustang-b76)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 1.4.0,5.0,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic,x86
  • Submitted: 2006-03-22
  • Updated: 2012-03-23
  • Resolved: 2006-04-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b80Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
JCK            : JCK6.0 b20
J2SE           : FAIL - *SINCE* mustang b76
Platform[s]    : FAIL - seems to be all
switch/Mode    : FAIL - default
Regression     : Since tiger

This test fails because b76 unable to run the following code (part of the test api/java_beans/XMLDecoder/index.html#read[XMLDecoder0034] ):

import java.beans.*;
import java.io.*;
import java.awt.*;

public class Bean{

	public static void main(String args[]){

        XMLEncoder xmlEnc = new XMLEncoder(new ByteArrayOutputStream());
        xmlEnc.writeObject(new java.awt.Insets(1, 2, 3, 4));
	}
}

then this code is run it displays at console the following message *without any exception*:

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(Ins
ets);
Continuing ...

and then everything goes wrong for api/java_beans/XMLDecoder/index.html#read[XMLDecoder0034]

Comments
EVALUATION Seems that GridBagConstraints class could not be used with XMLEncoder/XMLDecoder
22-03-2006

EVALUATION This is regression bug since bug 4741757 was fixed. We have removed field access because it crashed with Security Manager and violates the JavaBeans specification. So we should add special persistence delegate for Insets into MetaData class.
22-03-2006