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

XMLEncoder fails to encode TitledBorders

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 7
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b20
    • CPU:
      sparc
    • OS:
      solaris_9
    • Verification:
      Not verified

      Backports

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  malenkov Sergey Malenkov (Inactive)
                  Reporter:
                  ndcosta Nelson Dcosta (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: