Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146676

Unused code in jdk.javadoc.internal.doclets.formats.html.FieldWriterImpl.addComments()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: None
    • Component/s: tools
    • Labels:

      Description

      Senseless unused code in jdk.javadoc.internal.doclets.formats.html.FieldWriterImpl.addComments():

          public void addComments(VariableElement field, Content fieldTree) {
              Element holder = field.getEnclosingElement();
              if (!utils.getInlineTags(field).isEmpty()) {
                  if (holder.equals(typeElement) ||
                          (!utils.isPublic(holder) || utils.isLinkable((TypeElement)holder))) {
                      writer.addInlineComment(field, fieldTree);
                  } else {
                      Content link =
                              writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY,
                              (TypeElement)holder, (Element)field,
                              utils.isIncluded(holder)
                                      ? holder.asType().toString() : utils.getQualifiedTypeName(holder.asType()),
                                  false);
      ............................

      "holder.equals(typeElement)" can never be true for fields. It seems that this fragment was just copied from MethodWriterImpl (where it was used to count comments of overridden parent methods).

        Attachments

          Activity

            People

            Assignee:
            ksrini Kumar Srinivasan
            Reporter:
            ogb Oleg Barbashov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: