Index: openide/text/src/org/openide/text/PrintSettings.java =================================================================== RCS file: /cvs/openide/text/src/org/openide/text/PrintSettings.java,v retrieving revision 1.3 diff -u -r1.3 PrintSettings.java --- openide/text/src/org/openide/text/PrintSettings.java 23 Nov 2006 05:26:45 -0000 1.3 +++ openide/text/src/org/openide/text/PrintSettings.java 15 May 2007 01:28:25 -0000 @@ -26,6 +26,7 @@ import java.awt.print.PageFormat; import java.awt.print.Paper; import java.awt.print.PrinterJob; +import java.beans.beancontext.BeanContext; import java.io.IOException; import java.io.ObjectInput; @@ -110,7 +111,8 @@ * @exception IOException */ public void writeExternal(ObjectOutput obtos) throws IOException { - super.writeExternal(obtos); +// Don't store the children, we should not have any anyway. +// super.writeExternal(obtos); obtos.writeBoolean(wrap); obtos.writeObject(headerFormat); obtos.writeObject(footerFormat); @@ -127,7 +129,31 @@ * @exception ClassNotFoundException */ public void readExternal(ObjectInput obtis) throws IOException, ClassNotFoundException { - super.readExternal(obtis); +// super.readExternal(obtis); + + // Fastforward through the stream and skip all child options. This is + // to avoid super.readExternal to load SystemOptions that might have been + // serialized as the childern for this SCO. + Object obj = obtis.readObject(); + if (obj instanceof BeanContext) { + // old version of serialization + // XXX does this really work?? + } else { + // new version with safe serialization + // there are two null markers, one added by SystemOption.writeExternal + // and the other one added by ContextSystemOption.writeExternal + for (int i = 0; i < 2; i++) { + while (obj != null) { + // read next + obj = obtis.readObject(); + } + + if (i == 0) { + obj = obtis.readObject(); + } + } + } + wrap = obtis.readBoolean(); headerFormat = (String) obtis.readObject(); footerFormat = (String) obtis.readObject();