Menu

Modified template for getters is adding non-existant @return

Help
Kat
2014-06-26
2014-06-27
  • Kat

    Kat - 2014-06-26

    I'm trying to make the comment for my getters look like this:

    /**
     * Gets the {@link #${e.g(1).fl()}}.
     */
    

    Eg, for int getFoo(), I'd get:

    /**
     * Gets the {@link #foo}.
     */
    

    But for some reason that I can't figure out (and is driving me crazy), the actual comment that JAutodoc generates is:

    /**
     * Gets the {@link #foo}.
     *
     * @return the foo
     */
    

    I can't figure out where the extra text is coming from! At first I thought perhaps that the templates "stack", so I deleted all the other templates, but it's still appearing.

    I also have issues with the setters inserting a new line in the document. My setters are using:

    /**
     * Sets the {@link #${e.g(1).fl()}}.
     * @param ${e.g(2)} The new value.
     */
    

    But they end up looking like:

    /**
     * Sets the {@link #foo}.
     *
     * @param foo The new value.
     */
    

    And I don't know why that new line is being inserted.

    Are templates not inserted verbatim?

     
    • Martin Kesting

      Martin Kesting - 2014-06-27
      1. The Javadoc comment is incomplete without the @return tag and JAutodoc always completes a comment, independent from the template. So your desired result is not possible with JAutodoc.

      2. The templates are getting parsed (looking for missing tags), then completed and the output is re-formatted. When you select the option "Use Eclipse comment formatter", you can configure the output under "Preferences->Java->Code Style->Formatter". Tab: Comments.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.