Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6589532
Votes 0
Synopsis XMLEncoder fails to encode TitledBorders
Category java:classes_beans
Reported Against
Release Fixed 7(b20), 6u4(b03) (Bug ID:2151637)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 06-AUG-2007
Description
FULL PRODUCT VERSION :
1.6.0_02

ADDITIONAL OS VERSION INFORMATION :
Solaris 9 (sparc) 09/04

A DESCRIPTION OF THE PROBLEM :
java.beans.XMLEncoder produces errors when encoding TitledBorders with defaulted title color. This breaks in 1.6.0_02 but works fine in 1.5.0_11.

(my apologies for not having more information in other fields but my Solaris box has no access to the internet).


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac test.java
java test


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No errors from XMLEncoder.
ACTUAL -
Errors printed to screen by XMLEncoder (or recieved via the exception handler API)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.InstantiationException: sun.swing.PrintColorUIResource
Continuing...
java.lang.Exception: XMLEncoder: discarding statement XMLEncoder.writeObject(PrintColorUIResource)



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Color;
import java.beans.XMLEncoder;
import java.io.ByteArrayOutputStream;
import javax.swing.UIManager;

public class test
{
   public static void main(String[] args)
   {
      Color c = UIManager.getColor("TtitledBorder.titledColor");
      new XMLEncoder(new ByteArrayOutputStream()).writeObject(c);
   }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
When creating a TitledBorder, always specify the titleColor rather than relying on the default Ocean color.

Release Regression From : 5.0u11
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.
Posted Date : 2007-08-06 12:26:15.0
Work Around
N/A
Evaluation
The PrintColorUIResource class was added.
@ConstructorProperties can't be used,
because the equals() method is not implemented properly.
Posted Date : 2007-08-09 11:37:56.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang