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

Missing tag for return type in method creating an instance of complex type

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java -version
      java version "1.8.0_92"
      Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      3.0.101-107-default #1 SMP Thu Jun 22 14:37:55 UTC 2017 (414ea9f) x86_64 x86_64 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      xjc -version
      xjc 2.3.0-b170531.0717

      A DESCRIPTION OF THE PROBLEM :
      When generating Java-classes with jaxb (xjc) the generated ObjectFactory contains method for creating an instance of complex type without @return tag for return type. This results in "Javadoc: Missing tag for return type" warning.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Generate java-classes from an xsd with xjc

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
          /**
           * Create an instance of {@link Item }
           * @return
           * the new instance of {@link Item }
           */
          public Item createItem() {
              return new Item();
          }
      ACTUAL -
          /**
           * Create an instance of {@link Item }
           *
           */
          public Item createItem() {
              return new Item();
          }

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Warning: Javadoc: Missing tag for return type

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      <?xml version="1.0" encoding="UTF-8" ?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified">

      <xs:element name="item" type="Item" />

      <xs:complexType name="Item">
                 <xs:sequence>
                   <xs:element name="title" type="xs:string"/>
                   <xs:element name="note" type="xs:string" minOccurs="0"/>
                 </xs:sequence>
      </xs:complexType>

      </xs:schema>
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              zli Zheng Jun Li
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: