OpenJDK / portola / portola
changeset 48433:db09f53aba91
8193671: Default Methods tab under Method Summary includes static methods
Reviewed-by: jjg
author | ksrini |
---|---|
date | Wed, 03 Jan 2018 15:16:46 -0800 |
parents | b2cd597479ea |
children | 04d8d293e458 |
files | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java |
diffstat | 5 files changed, 48 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Thu Jan 04 15:50:51 2018 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Wed Jan 03 15:16:46 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -264,8 +264,7 @@ .addTab(resources.getText("doclet.Abstract_Methods"), utils::isAbstract) .addTab(resources.getText("doclet.Concrete_Methods"), e -> !utils.isAbstract(e) && !utils.isInterface(e.getEnclosingElement())) - .addTab(resources.getText("doclet.Default_Methods"), - e -> !utils.isAbstract(e) && utils.isInterface(e.getEnclosingElement())) + .addTab(resources.getText("doclet.Default_Methods"), utils::isDefault) .addTab(resources.getText("doclet.Deprecated_Methods"), e -> utils.isDeprecated(e) || utils.isDeprecated(typeElement)) .setTabScriptVariable("methods")
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java Thu Jan 04 15:50:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java Wed Jan 03 15:16:46 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,8 @@ /* * @test - * @bug 8002304 8024096 - * @summary Test for various method types in the method summary table + * @bug 8002304 8024096 8193671 + * @summary Test for various method type tabs in the method summary table * @author Bhavesh Patel * @library ../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -62,13 +62,18 @@ "<tr id=\"i0\" class=\"altColor\">"); checkOutput("pkg1/B.html", true, - "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " - + "Methods</span><span class=\"tabEnd\"> </span></span>" - + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" - + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" - + "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" - + "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" - + "</caption>"); + "var methods = {\"i0\":6,\"i1\":18,\"i2\":18,\"i3\":1,\"i4\":1," + + "\"i5\":6,\"i6\":6,\"i7\":6,\"i8\":6};\n", + "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t1\" class=\"tableTab\">" + + "<span><a href=\"javascript:show(1);\">Static Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t2\" class=\"tableTab\">" + + "<span><a href=\"javascript:show(2);\">Instance Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" class=\"tableTab\">" + + "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span><span id=\"t5\" class=\"tableTab\">" + + "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + + "<span class=\"tabEnd\"> </span></span></caption>\n"); checkOutput("pkg1/D.html", true, "var methods = {",
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java Thu Jan 04 15:50:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java Wed Jan 03 15:16:46 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,7 @@ /** * This is the third concrete instance method. + * @return a string */ public String getParameter() { return "test";
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java Thu Jan 04 15:50:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java Wed Jan 03 15:16:46 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,8 +24,8 @@ package pkg1; /** - * This interface has different types of methods such as "Instance Methods" and - * "Abstract Methods". All the tabs will display same list of methods. + * This interface has different types of methods such as "Static Methods", + * "Instance Methods", "Abstract Methods", "Default Methods". */ public interface B { @@ -36,21 +36,45 @@ /** * This is the second abstract instance method. + * @return a string */ public String getName(); /** * This is the third abstract instance method. + * @return a boolean value */ public boolean addEntry(); /** * This is the fourth abstract instance method. + * @return a boolean value */ public boolean removeEntry(); /** * This is the fifth abstract instance method. + * @return a string */ public String getPermissions(); + + /** + * A static interface method. + */ + public static void aStaticMethod() {} + + /** + * Another static interface method. + */ + public static void anotherStaticMethod() {} + + /** + * A default method. + */ + public default void aDefaultMethod() {} + + /** + * Another default method. + */ + public default void anotherDefaultMethod() {} }
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java Thu Jan 04 15:50:51 2018 +0000 +++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java Wed Jan 03 15:16:46 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,7 @@ /** * This is the second concrete instance method. + * @return a string */ public String getParameter() { return "test";