langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Fri Dec 21 15:27:55 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java Tue Dec 25 17:23:59 2012 -0800
@@ -239,7 +239,14 @@
if ((member.isField() || member.isMethod()) &&
writer instanceof ClassWriterImpl &&
((ClassWriterImpl) writer).getClassDoc().isInterface()) {
- mod = Util.replaceText(mod, "public", "").trim();
+ // This check for isDefault() and the default modifier needs to be
+ // added for it to appear on the method details section. Once the
+ // default modifier is added to the Modifier list on DocEnv and once
+ // it is updated to use the javax.lang.model.element.Modifier, we
+ // will need to remove this.
+ mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ?
+ Util.replaceText(mod, "public", "default").trim() :
+ Util.replaceText(mod, "public", "").trim();
}
if(mod.length() > 0) {
htmltree.addContent(mod);
@@ -313,8 +320,18 @@
code.addContent(configuration.getText("doclet.Package_private"));
code.addContent(" ");
}
- if (member.isMethod() && ((MethodDoc)member).isAbstract()) {
- code.addContent("abstract ");
+ if (member.isMethod()) {
+ if (((MethodDoc)member).isAbstract()) {
+ code.addContent("abstract ");
+ }
+ // This check for isDefault() and the default modifier needs to be
+ // added for it to appear on the "Modifier and Type" column in the
+ // method summary section. Once the default modifier is added
+ // to the Modifier list on DocEnv and once it is updated to use the
+ // javax.lang.model.element.Modifier, we will need to remove this.
+ else if (((MethodDoc)member).isDefault()) {
+ code.addContent("default ");
+ }
}
if (member.isStatic()) {
code.addContent("static ");
@@ -547,6 +564,9 @@
methodType = (classdoc.isInterface() || ((MethodDoc)member).isAbstract()) ?
methodType | MethodTypes.ABSTRACT.value() :
methodType | MethodTypes.CONCRETE.value();
+ if (((MethodDoc)member).isDefault()) {
+ methodType = methodType | MethodTypes.DEFAULT.value();
+ }
if (Util.isDeprecated(member) || Util.isDeprecated(classdoc)) {
methodType = methodType | MethodTypes.DEPRECATED.value();
}