7006178: findbugs high priority issues in new javadoc

Fri, 11 Mar 2011 15:39:51 -0800

author
bpatel
date
Fri, 11 Mar 2011 15:39:51 -0800
changeset 927
b60754fe206d
parent 926
46ed58a098ad
child 928
307b065ff2af

7006178: findbugs high priority issues in new javadoc
Reviewed-by: jjg

src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testUseOption/C.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testUseOption/TestUseOption.java file | annotate | diff | comparison | revisions
test/com/sun/javadoc/testUseOption/UsedInC.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Fri Mar 11 14:07:11 2011 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Fri Mar 11 15:39:51 2011 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -305,11 +305,7 @@
    1.11              tr.addContent(tdFirst);
    1.12              HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
    1.13              tdLast.addStyle(HtmlStyle.colLast);
    1.14 -            if (pkg != null) {
    1.15 -                addSummaryComment(pkg, tdLast);
    1.16 -            } else {
    1.17 -                tdLast.addContent(getSpace());
    1.18 -            }
    1.19 +            addSummaryComment(pkg, tdLast);
    1.20              tr.addContent(tdLast);
    1.21              tbody.addContent(tr);
    1.22          }
    1.23 @@ -355,10 +351,7 @@
    1.24          contentTree.addContent(tdFirst);
    1.25          HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
    1.26          tdLast.addStyle(HtmlStyle.colLast);
    1.27 -        if (pkg != null)
    1.28 -            addSummaryComment(pkg, tdLast);
    1.29 -        else
    1.30 -            tdLast.addContent(getSpace());
    1.31 +        addSummaryComment(pkg, tdLast);
    1.32          contentTree.addContent(tdLast);
    1.33      }
    1.34  
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Fri Mar 11 14:07:11 2011 -0800
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Fri Mar 11 15:39:51 2011 -0800
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -246,10 +246,7 @@
    2.11          contentTree.addContent(tdFirst);
    2.12          HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
    2.13          tdLast.addStyle(HtmlStyle.colLast);
    2.14 -        if (pkg != null)
    2.15 -            addSummaryComment(pkg, tdLast);
    2.16 -        else
    2.17 -            tdLast.addContent(getSpace());
    2.18 +        addSummaryComment(pkg, tdLast);
    2.19          contentTree.addContent(tdLast);
    2.20      }
    2.21  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/com/sun/javadoc/testUseOption/C.java	Fri Mar 11 15:39:51 2011 -0800
     3.3 @@ -0,0 +1,41 @@
     3.4 +/*
     3.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 + *
     3.8 + * This code is free software; you can redistribute it and/or modify it
     3.9 + * under the terms of the GNU General Public License version 2 only, as
    3.10 + * published by the Free Software Foundation.
    3.11 + *
    3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 + * version 2 for more details (a copy is included in the LICENSE file that
    3.16 + * accompanied this code).
    3.17 + *
    3.18 + * You should have received a copy of the GNU General Public License version
    3.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 + *
    3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 + * or visit www.oracle.com if you need additional information or have any
    3.24 + * questions.
    3.25 + */
    3.26 +
    3.27 +/**
    3.28 + * Class in an unnamed package.
    3.29 + */
    3.30 +
    3.31 +public class C {
    3.32 +
    3.33 +    /**
    3.34 +     * Field in C.
    3.35 +     */
    3.36 +    public UsedInC fieldInC;
    3.37 +
    3.38 +    /**
    3.39 +     * Method in C.
    3.40 +     */
    3.41 +    public UsedInC methodInC(UsedInC p) {
    3.42 +        return p;
    3.43 +    }
    3.44 +}
     4.1 --- a/test/com/sun/javadoc/testUseOption/TestUseOption.java	Fri Mar 11 14:07:11 2011 -0800
     4.2 +++ b/test/com/sun/javadoc/testUseOption/TestUseOption.java	Fri Mar 11 15:39:51 2011 -0800
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -23,7 +23,7 @@
    4.11  
    4.12  /*
    4.13   * @test
    4.14 - * @bug 4496290 4985072
    4.15 + * @bug 4496290 4985072 7006178
    4.16   * @summary A simple test to determine if -use works.
    4.17   * @author jamieh
    4.18   * @library ../lib/
    4.19 @@ -34,7 +34,7 @@
    4.20  
    4.21  public class TestUseOption extends JavadocTester {
    4.22  
    4.23 -    private static final String BUG_ID = "4496290-4985072";
    4.24 +    private static final String BUG_ID = "4496290-4985072-7006178";
    4.25  
    4.26      //Input for string search tests.
    4.27      private static final String[] TEST2 = {
    4.28 @@ -54,6 +54,16 @@
    4.29          "Method in C8.",
    4.30      };
    4.31  
    4.32 +    private static final String[][] TEST3 = {
    4.33 +        {BUG_ID + "-3" + FS + "class-use" + FS + "UsedInC.html", "Uses of <a href=" +
    4.34 +                 "\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">" +
    4.35 +                 "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
    4.36 +        },
    4.37 +        {BUG_ID + "-3" + FS + "package-use.html", "<td class=\"colOne\">" +
    4.38 +                 "<a href=\"class-use/UsedInC.html#&lt;Unnamed&gt;\">UsedInC</a>&nbsp;</td>"
    4.39 +        }
    4.40 +    };
    4.41 +
    4.42      private static final String[] ARGS = new String[] {
    4.43          "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
    4.44      };
    4.45 @@ -62,6 +72,10 @@
    4.46          "-d", BUG_ID+"-2", "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
    4.47      };
    4.48  
    4.49 +    private static final String[] ARGS3 = new String[] {
    4.50 +        "-d", BUG_ID + "-3", "-sourcepath", SRC_DIR, "-use", SRC_DIR + FS + "C.java", SRC_DIR + FS + "UsedInC.java"
    4.51 +    };
    4.52 +
    4.53      /**
    4.54       * The entry point of the test.
    4.55       * @param args the array of command line arguments.
    4.56 @@ -93,6 +107,8 @@
    4.57              prevIndex = currentIndex;
    4.58          }
    4.59          tester.printSummary();
    4.60 +        run(tester, ARGS3, TEST3, NO_TEST);
    4.61 +        tester.printSummary();
    4.62      }
    4.63  
    4.64      /**
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/com/sun/javadoc/testUseOption/UsedInC.java	Fri Mar 11 15:39:51 2011 -0800
     5.3 @@ -0,0 +1,26 @@
     5.4 +/*
     5.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     5.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.7 + *
     5.8 + * This code is free software; you can redistribute it and/or modify it
     5.9 + * under the terms of the GNU General Public License version 2 only, as
    5.10 + * published by the Free Software Foundation.
    5.11 + *
    5.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    5.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    5.15 + * version 2 for more details (a copy is included in the LICENSE file that
    5.16 + * accompanied this code).
    5.17 + *
    5.18 + * You should have received a copy of the GNU General Public License version
    5.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    5.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    5.21 + *
    5.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    5.23 + * or visit www.oracle.com if you need additional information or have any
    5.24 + * questions.
    5.25 + */
    5.26 +
    5.27 +public class UsedInC
    5.28 +{
    5.29 +}

mercurial