Wed, 18 Feb 2009 13:47:27 -0800
6802694: Javadoc doclet does not display deprecated information with -nocomment option for serialized form
Reviewed-by: jjg
1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Fri Feb 13 11:57:33 2009 +0000 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Wed Feb 18 13:47:27 2009 -0800 1.3 @@ -245,6 +245,29 @@ 1.4 } 1.5 1.6 /** 1.7 + * Check whether there are any tags to be printed. 1.8 + * 1.9 + * @param doc the Doc object to check for tags. 1.10 + * @return true if there are tags to be printed else return false. 1.11 + */ 1.12 + protected boolean hasTagsToPrint(Doc doc) { 1.13 + if (doc instanceof MethodDoc) { 1.14 + ClassDoc[] intfacs = ((MethodDoc)doc).containingClass().interfaces(); 1.15 + MethodDoc overriddenMethod = ((MethodDoc)doc).overriddenMethod(); 1.16 + if ((intfacs.length > 0 && 1.17 + new ImplementedMethods((MethodDoc)doc, this.configuration).build().length > 0) || 1.18 + overriddenMethod != null) { 1.19 + return true; 1.20 + } 1.21 + } 1.22 + TagletOutputImpl output = new TagletOutputImpl(""); 1.23 + TagletWriter.genTagOuput(configuration.tagletManager, doc, 1.24 + configuration.tagletManager.getCustomTags(doc), 1.25 + getTagletWriterInstance(false), output); 1.26 + return (output.toString().trim().isEmpty()); 1.27 + } 1.28 + 1.29 + /** 1.30 * Returns a TagletWriter that knows how to write HTML. 1.31 * 1.32 * @return a TagletWriter that knows how to write HTML.
2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Fri Feb 13 11:57:33 2009 +0000 2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java Wed Feb 18 13:47:27 2009 -0800 2.3 @@ -164,4 +164,20 @@ 2.4 public void writeMemberFooter(FieldDoc member) { 2.5 writer.dlEnd(); 2.6 } 2.7 + 2.8 + /** 2.9 + * Check to see if member details should be printed. If 2.10 + * nocomment option set or if there is no text to be printed 2.11 + * for deprecation info, inline comment, no serial tag or inline tags, 2.12 + * do not print member details. 2.13 + */ 2.14 + public boolean shouldPrintMemberDetails(FieldDoc field) { 2.15 + if (!configuration().nocomment) 2.16 + if((field.inlineTags().length > 0) || 2.17 + (field.tags("serial").length > 0) || (writer.hasTagsToPrint(field))) 2.18 + return true; 2.19 + if (!Util.isDeprecated(field)) 2.20 + return true; 2.21 + return false; 2.22 + } 2.23 }
3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java Fri Feb 13 11:57:33 2009 +0000 3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java Wed Feb 18 13:47:27 2009 -0800 3.3 @@ -67,4 +67,10 @@ 3.4 return output.toString(); 3.5 } 3.6 3.7 + /** 3.8 + * Check whether the taglet output is empty. 3.9 + */ 3.10 + public boolean isEmpty() { 3.11 + return (toString().trim().isEmpty()); 3.12 + } 3.13 }
4.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java Fri Feb 13 11:57:33 2009 +0000 4.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java Wed Feb 18 13:47:27 2009 -0800 4.3 @@ -152,6 +152,17 @@ 4.4 * @param member the member to write the header for. 4.5 */ 4.6 public void writeMemberFooter(FieldDoc member); 4.7 + 4.8 + /** 4.9 + * Check to see if member details should be printed. If 4.10 + * nocomment option set or if there is no text to be printed 4.11 + * for deprecation info, inline comment, no serial tag or inline tags, 4.12 + * do not print member details. 4.13 + * 4.14 + * @param member the member to check details for. 4.15 + * @return true if details need to be printed 4.16 + */ 4.17 + public boolean shouldPrintMemberDetails(FieldDoc member); 4.18 } 4.19 4.20 /**
5.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Fri Feb 13 11:57:33 2009 +0000 5.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java Wed Feb 18 13:47:27 2009 -0800 5.3 @@ -403,16 +403,17 @@ 5.4 if (classDoc.definesSerializableFields()) { 5.5 FieldDoc serialPersistentField = 5.6 Util.asList(classDoc.serializableFields()).get(0); 5.7 - String comment = serialPersistentField.commentText(); 5.8 - if (comment.length() > 0) { 5.9 + // Check to see if there are inline comments, tags or deprecation 5.10 + // information to be printed. 5.11 + if (fieldWriter.shouldPrintMemberDetails(serialPersistentField)) { 5.12 fieldWriter.writeHeader( 5.13 configuration.getText("doclet.Serialized_Form_class")); 5.14 + fieldWriter.writeMemberDeprecatedInfo(serialPersistentField); 5.15 if (!configuration.nocomment) { 5.16 - fieldWriter.writeMemberDeprecatedInfo(serialPersistentField); 5.17 fieldWriter.writeMemberDescription(serialPersistentField); 5.18 fieldWriter.writeMemberTags(serialPersistentField); 5.19 - fieldWriter.writeMemberFooter(serialPersistentField); 5.20 } 5.21 + fieldWriter.writeMemberFooter(serialPersistentField); 5.22 } 5.23 } 5.24 } 5.25 @@ -429,6 +430,16 @@ 5.26 } 5.27 5.28 /** 5.29 + * Build the field deprecation information. 5.30 + */ 5.31 + public void buildFieldDeprecationInfo() { 5.32 + if (!currentClass.definesSerializableFields()) { 5.33 + FieldDoc field = (FieldDoc)currentMember; 5.34 + fieldWriter.writeMemberDeprecatedInfo(field); 5.35 + } 5.36 + } 5.37 + 5.38 + /** 5.39 * Build the field information. 5.40 */ 5.41 public void buildFieldInfo() { 5.42 @@ -459,7 +470,6 @@ 5.43 "doclet.MissingSerialTag", cd.qualifiedName(), 5.44 field.name()); 5.45 } 5.46 - fieldWriter.writeMemberDeprecatedInfo(field); 5.47 fieldWriter.writeMemberDescription(field); 5.48 fieldWriter.writeMemberTags(field); 5.49 }
6.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Fri Feb 13 11:57:33 2009 +0000 6.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Wed Feb 18 13:47:27 2009 -0800 6.3 @@ -1,30 +1,30 @@ 6.4 <?xml version='1.0' encoding='utf-8'?> 6.5 - 6.6 -<!-- 6.7 - Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. 6.8 - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.9 - 6.10 - This code is free software; you can redistribute it and/or modify it 6.11 - under the terms of the GNU General Public License version 2 only, as 6.12 - published by the Free Software Foundation. Sun designates this 6.13 - particular file as subject to the "Classpath" exception as provided 6.14 - by Sun in the LICENSE file that accompanied this code. 6.15 - 6.16 - This code is distributed in the hope that it will be useful, but WITHOUT 6.17 - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.18 - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.19 - version 2 for more details (a copy is included in the LICENSE file that 6.20 - accompanied this code). 6.21 - 6.22 - You should have received a copy of the GNU General Public License version 6.23 - 2 along with this work; if not, write to the Free Software Foundation, 6.24 - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.25 - 6.26 - Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 6.27 - CA 95054 USA or visit www.sun.com if you need additional information or 6.28 - have any questions. 6.29 ---> 6.30 - 6.31 + 6.32 +<!-- 6.33 + Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. 6.34 + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.35 + 6.36 + This code is free software; you can redistribute it and/or modify it 6.37 + under the terms of the GNU General Public License version 2 only, as 6.38 + published by the Free Software Foundation. Sun designates this 6.39 + particular file as subject to the "Classpath" exception as provided 6.40 + by Sun in the LICENSE file that accompanied this code. 6.41 + 6.42 + This code is distributed in the hope that it will be useful, but WITHOUT 6.43 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.44 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.45 + version 2 for more details (a copy is included in the LICENSE file that 6.46 + accompanied this code). 6.47 + 6.48 + You should have received a copy of the GNU General Public License version 6.49 + 2 along with this work; if not, write to the Free Software Foundation, 6.50 + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.51 + 6.52 + Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 6.53 + CA 95054 USA or visit www.sun.com if you need additional information or 6.54 + have any questions. 6.55 +--> 6.56 + 6.57 6.58 <Doclet> 6.59 6.60 @@ -183,8 +183,8 @@ 6.61 <MethodHeader/> 6.62 <SerializableMethods> 6.63 <MethodSubHeader/> 6.64 + <DeprecatedMethodInfo/> 6.65 <MethodInfo> 6.66 - <DeprecatedMethodInfo/> 6.67 <MethodDescription/> 6.68 <MethodTags/> 6.69 </MethodInfo> 6.70 @@ -193,6 +193,7 @@ 6.71 <FieldHeader/> 6.72 <SerializableFields> 6.73 <FieldSubHeader/> 6.74 + <FieldDeprecationInfo/> 6.75 <FieldInfo/> 6.76 <FieldFooter/> 6.77 </SerializableFields>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java Wed Feb 18 13:47:27 2009 -0800 7.3 @@ -0,0 +1,151 @@ 7.4 +/* 7.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 7.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.7 + * 7.8 + * This code is free software; you can redistribute it and/or modify it 7.9 + * under the terms of the GNU General Public License version 2 only, as 7.10 + * published by the Free Software Foundation. Sun designates this 7.11 + * particular file as subject to the "Classpath" exception as provided 7.12 + * by Sun in the LICENSE file that accompanied this code. 7.13 + * 7.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 7.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 7.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 7.17 + * version 2 for more details (a copy is included in the LICENSE file that 7.18 + * accompanied this code). 7.19 + * 7.20 + * You should have received a copy of the GNU General Public License version 7.21 + * 2 along with this work; if not, write to the Free Software Foundation, 7.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 7.23 + * 7.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 7.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 7.26 + * have any questions. 7.27 + */ 7.28 + 7.29 +/* 7.30 + * @test 7.31 + * @bug 6802694 7.32 + * @summary This test verifies deprecation info in serialized-form.html. 7.33 + * @author Bhavesh Patel 7.34 + * @library ../lib/ 7.35 + * @build JavadocTester 7.36 + * @build TestSerializedFormDeprecationInfo 7.37 + * @run main TestSerializedFormDeprecationInfo 7.38 + */ 7.39 + 7.40 +public class TestSerializedFormDeprecationInfo extends JavadocTester { 7.41 + 7.42 + private static final String BUG_ID = "6802694"; 7.43 + 7.44 + // Test for normal run of javadoc. The serialized-form.html should 7.45 + // display the inline comments, tags and deprecation information if any. 7.46 + private static final String[][] TEST_CMNT_DEPR = { 7.47 + {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL + NL + 7.48 + "<DT><STRONG>Throws:</STRONG>" + NL + "<DD><CODE>" + 7.49 + "java.io.IOException</CODE><DT><STRONG>See Also:</STRONG>" + 7.50 + "<DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" + 7.51 + "<CODE>C1.setUndecorated(boolean)</CODE></A></DD>" + NL + 7.52 + "</DL>" + NL + "</DL>"}, 7.53 + {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + 7.54 + "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" + 7.55 + " 1.5, replaced by" + NL + 7.56 + " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" + 7.57 + "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + 7.58 + "<DD>This field indicates whether the C1 is undecorated." + NL + 7.59 + "<P>" + NL + "<DT><DD> <DL>" + NL + 7.60 + "<DT><STRONG>Since:</STRONG></DT>" + NL + 7.61 + " <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" + 7.62 + "<DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" + 7.63 + "<CODE>C1.setUndecorated(boolean)</CODE></A></DL>" + NL + 7.64 + "</DL>"}, 7.65 + {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + 7.66 + "<DD><STRONG>Deprecated.</STRONG> <I>As of JDK version" + 7.67 + " 1.5, replaced by" + NL + 7.68 + " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" + 7.69 + "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL + 7.70 + "<DD>Reads the object stream." + NL + "<P>" + NL + 7.71 + "<DD><DL>" + NL + NL + "<DT><STRONG>Throws:" + 7.72 + "</STRONG>" + NL + "<DD><CODE><code>" + 7.73 + "IOException</code></CODE>" + NL + 7.74 + "<DD><CODE>java.io.IOException</CODE></DD>" + NL + 7.75 + "</DL>" + NL + "</DL>"}, 7.76 + {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + 7.77 + "<DD><STRONG>Deprecated.</STRONG> <DD>" + 7.78 + "The name for this class." + NL + "<P>" + NL + 7.79 + "<DT><DD> <DL>" + NL + "</DL>" + NL + "</DL>"}}; 7.80 + 7.81 + // Test with -nocomment option. The serialized-form.html should 7.82 + // not display the inline comments and tags but should display deprecation 7.83 + // information if any. 7.84 + private static final String[][] TEST_NOCMNT = { 7.85 + {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" + 7.86 + "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" + 7.87 + "Deprecated.</STRONG> <I>As of JDK version 1.5, replaced by" + NL + 7.88 + " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" + 7.89 + "setUndecorated(boolean)</CODE></A>.</I></DL>"}, 7.90 + {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" + 7.91 + "Deprecated.</STRONG> <I>As of JDK version" + 7.92 + " 1.5, replaced by" + NL + 7.93 + " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" + 7.94 + "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL + 7.95 + "</DL>"}, 7.96 + {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" + 7.97 + "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" + 7.98 + "Deprecated.</STRONG> </DL>"}}; 7.99 + 7.100 + // Test with -nodeprecated option. The serialized-form.html should 7.101 + // ignore the -nodeprecated tag and display the deprecation info. This 7.102 + // test is similar to the normal run of javadoc in which inline comment, tags 7.103 + // and deprecation information will be displayed. 7.104 + private static final String[][] TEST_NODEPR = TEST_CMNT_DEPR; 7.105 + 7.106 + // Test with -nodeprecated and -nocomment options. The serialized-form.html should 7.107 + // ignore the -nodeprecated tag and display the deprecation info but should not 7.108 + // display the inline comments and tags. This test is similar to the test with 7.109 + // -nocomment option. 7.110 + private static final String[][] TEST_NOCMNT_NODEPR = TEST_NOCMNT; 7.111 + 7.112 + private static final String[] ARGS1 = 7.113 + new String[] { 7.114 + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; 7.115 + 7.116 + private static final String[] ARGS2 = 7.117 + new String[] { 7.118 + "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; 7.119 + 7.120 + private static final String[] ARGS3 = 7.121 + new String[] { 7.122 + "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; 7.123 + 7.124 + private static final String[] ARGS4 = 7.125 + new String[] { 7.126 + "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; 7.127 + 7.128 + /** 7.129 + * The entry point of the test. 7.130 + * @param args the array of command line arguments. 7.131 + */ 7.132 + public static void main(String[] args) { 7.133 + TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo(); 7.134 + run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT); 7.135 + run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR); 7.136 + run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); 7.137 + run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR); 7.138 + tester.printSummary(); 7.139 + } 7.140 + 7.141 + /** 7.142 + * {@inheritDoc} 7.143 + */ 7.144 + public String getBugId() { 7.145 + return BUG_ID; 7.146 + } 7.147 + 7.148 + /** 7.149 + * {@inheritDoc} 7.150 + */ 7.151 + public String getBugName() { 7.152 + return getClass().getName(); 7.153 + } 7.154 +}
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/pkg1/C1.java Wed Feb 18 13:47:27 2009 -0800 8.3 @@ -0,0 +1,108 @@ 8.4 +/* 8.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 8.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8.7 + * 8.8 + * This code is free software; you can redistribute it and/or modify it 8.9 + * under the terms of the GNU General Public License version 2 only, as 8.10 + * published by the Free Software Foundation. Sun designates this 8.11 + * particular file as subject to the "Classpath" exception as provided 8.12 + * by Sun in the LICENSE file that accompanied this code. 8.13 + * 8.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 8.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 8.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 8.17 + * version 2 for more details (a copy is included in the LICENSE file that 8.18 + * accompanied this code). 8.19 + * 8.20 + * You should have received a copy of the GNU General Public License version 8.21 + * 2 along with this work; if not, write to the Free Software Foundation, 8.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 8.23 + * 8.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 8.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 8.26 + * have any questions. 8.27 + */ 8.28 + 8.29 +package pkg1; 8.30 + 8.31 +import java.io.IOException; 8.32 +import java.io.Serializable; 8.33 + 8.34 +/** 8.35 + * A class comment for testing. 8.36 + * 8.37 + * @author Bhavesh Patel 8.38 + * @see C2 8.39 + * @since JDK1.0 8.40 + */ 8.41 + 8.42 +public class C1 implements Serializable { 8.43 + 8.44 + /** 8.45 + * This field indicates whether the C1 is undecorated. 8.46 + * 8.47 + * @see #setUndecorated(boolean) 8.48 + * @since 1.4 8.49 + * @serial 8.50 + * @deprecated As of JDK version 1.5, replaced by 8.51 + * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}. 8.52 + */ 8.53 + @Deprecated 8.54 + public boolean undecorated = false; 8.55 + 8.56 + private String title; 8.57 + 8.58 + /** 8.59 + * This enum specifies the possible modal exclusion types. 8.60 + * 8.61 + * @since 1.6 8.62 + */ 8.63 + public static enum ModalExclusionType { 8.64 + /** 8.65 + * No modal exclusion. 8.66 + */ 8.67 + NO_EXCLUDE, 8.68 + /** 8.69 + * <code>APPLICATION_EXCLUDE</code> indicates that a top-level window 8.70 + * won't be blocked by any application-modal dialogs. Also, it isn't 8.71 + * blocked by document-modal dialogs from outside of its child hierarchy. 8.72 + */ 8.73 + APPLICATION_EXCLUDE 8.74 + }; 8.75 + 8.76 + /** 8.77 + * Constructor. 8.78 + * 8.79 + * @param title the title 8.80 + * @param test boolean value 8.81 + * @exception IllegalArgumentException if the <code>owner</code>'s 8.82 + * <code>GraphicsConfiguration</code> is not from a screen device 8.83 + * @exception HeadlessException 8.84 + */ 8.85 + public C1(String title, boolean test) { 8.86 + 8.87 + } 8.88 + 8.89 + public C1(String title) { 8.90 + 8.91 + } 8.92 + 8.93 + /** 8.94 + * Method comments. 8.95 + * @param undecorated <code>true</code> if no decorations are 8.96 + * to be enabled; 8.97 + * <code>false</code> if decorations are to be enabled. 8.98 + * @see #readObject() 8.99 + * @since 1.4 8.100 + */ 8.101 + public void setUndecorated(boolean undecorated) { 8.102 + /* Make sure we don't run in the middle of peer creation.*/ 8.103 + } 8.104 + 8.105 + /** 8.106 + * @see #setUndecorated(boolean) 8.107 + */ 8.108 + public void readObject() throws IOException { 8.109 + 8.110 + } 8.111 +}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/pkg1/C2.java Wed Feb 18 13:47:27 2009 -0800 9.3 @@ -0,0 +1,86 @@ 9.4 +/* 9.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.7 + * 9.8 + * This code is free software; you can redistribute it and/or modify it 9.9 + * under the terms of the GNU General Public License version 2 only, as 9.10 + * published by the Free Software Foundation. Sun designates this 9.11 + * particular file as subject to the "Classpath" exception as provided 9.12 + * by Sun in the LICENSE file that accompanied this code. 9.13 + * 9.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 9.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 9.17 + * version 2 for more details (a copy is included in the LICENSE file that 9.18 + * accompanied this code). 9.19 + * 9.20 + * You should have received a copy of the GNU General Public License version 9.21 + * 2 along with this work; if not, write to the Free Software Foundation, 9.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 9.23 + * 9.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 9.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 9.26 + * have any questions. 9.27 + */ 9.28 + 9.29 +package pkg1; 9.30 + 9.31 +import java.io.ObjectInputStream; 9.32 +import java.io.IOException; 9.33 +import java.io.Serializable; 9.34 + 9.35 +/** 9.36 + * A class comment for testing. 9.37 + * 9.38 + * @author Bhavesh Patel 9.39 + * @see C1 9.40 + * @since JDK1.0 9.41 + */ 9.42 + 9.43 +public class C2 implements Serializable { 9.44 + 9.45 + /** 9.46 + * This field indicates title. 9.47 + */ 9.48 + String title; 9.49 + 9.50 + public static enum ModalType { 9.51 + NO_EXCLUDE 9.52 + }; 9.53 + 9.54 + /** 9.55 + * Constructor. 9.56 + * 9.57 + */ 9.58 + public C2() { 9.59 + 9.60 + } 9.61 + 9.62 + public C2(String title) { 9.63 + 9.64 + } 9.65 + 9.66 + /** 9.67 + * Set visible. 9.68 + * 9.69 + * @param set boolean 9.70 + * @since 1.4 9.71 + * @deprecated As of JDK version 1.5, replaced by 9.72 + * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}. 9.73 + */ 9.74 + @Deprecated 9.75 + public void setVisible(boolean set) { 9.76 + } 9.77 + 9.78 + /** 9.79 + * Reads the object stream. 9.80 + * 9.81 + * @param s ObjectInputStream 9.82 + * @throws <code>IOException</code> 9.83 + * @deprecated As of JDK version 1.5, replaced by 9.84 + * {@link C1#setUndecorated(boolean) setUndecorated(boolean)}. 9.85 + */ 9.86 + @Deprecated 9.87 + public void readObject(ObjectInputStream s) throws IOException { 9.88 + } 9.89 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/test/com/sun/javadoc/testSerializedFormDeprecationInfo/pkg1/C3.java Wed Feb 18 13:47:27 2009 -0800 10.3 @@ -0,0 +1,65 @@ 10.4 +/* 10.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 10.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.7 + * 10.8 + * This code is free software; you can redistribute it and/or modify it 10.9 + * under the terms of the GNU General Public License version 2 only, as 10.10 + * published by the Free Software Foundation. Sun designates this 10.11 + * particular file as subject to the "Classpath" exception as provided 10.12 + * by Sun in the LICENSE file that accompanied this code. 10.13 + * 10.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 10.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 10.17 + * version 2 for more details (a copy is included in the LICENSE file that 10.18 + * accompanied this code). 10.19 + * 10.20 + * You should have received a copy of the GNU General Public License version 10.21 + * 2 along with this work; if not, write to the Free Software Foundation, 10.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 10.23 + * 10.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 10.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 10.26 + * have any questions. 10.27 + */ 10.28 + 10.29 +package pkg1; 10.30 + 10.31 +import java.io.Serializable; 10.32 + 10.33 +/** 10.34 + * Test for Serializable 10.35 + * 10.36 + * @author Bhavesh Patel 10.37 + * @deprecated This class is no longer used. 10.38 + */ 10.39 +@Deprecated 10.40 +public abstract class C3 implements Serializable { 10.41 + 10.42 + /** 10.43 + * The name for this class. 10.44 + * 10.45 + * @serial 10.46 + */ 10.47 + private String name; 10.48 + 10.49 + /** 10.50 + * @serial 10.51 + */ 10.52 + private int publicKey; 10.53 + 10.54 + /** 10.55 + * Constructor for serialization only. 10.56 + */ 10.57 + protected C3() { 10.58 + 10.59 + } 10.60 + 10.61 + /** 10.62 + * Prints general information. 10.63 + * 10.64 + */ 10.65 + public void printInfo() { 10.66 + 10.67 + } 10.68 +}