Method attributes cause spaces in javadocs

I am using Java 8 and I have a spring controller that has a method to create a new user:

/**
 * Creates a new user in the system
 * 
 * @param username The new user username
 * @param email The new user email
 * @param password The new user password
 * @return the new user
 */
@RequestMapping(value = "/user/create", method = RequestMethod.POST)
@ResponseBody
public String createUser(
        @RequestParam(value = "username") String username,
        @RequestParam(value = "email") String email,
        @RequestParam(value = "password") String password) {
    return "";
}

      

When I generate the javadocs for this, I get a ton of spaces before the parameters. The generated HTML has many spaces in the tag <pre>

before the parameters in the list.

If I remove the attributes @RequestMapping

and @ResponseBody

from the method, then the javadocs come out as expected.

I have put the resulting generated output from the javadoc tool in the following code snippet. First, how is it done today, and second, how to look right with the attributes removed.

<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="createUser-java.lang.String-java.lang.String-java.lang.String-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createUser</h4>
<pre>@RequestMapping(value="/user/create",
                method=POST)
 @ResponseBody
public&nbsp;java.lang.String&nbsp;createUser(@RequestParam(value="username")
                                                                                                                        java.lang.String&nbsp;username,
                                                                                                                        @RequestParam(value="email")
                                                                                                                        java.lang.String&nbsp;email,
                                                                                                                        @RequestParam(value="password")
                                                                                                                        java.lang.String&nbsp;password)</pre>
<div class="block">Creates a new user in the system</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - The new user username</dd>
<dd><code>email</code> - The new user email</dd>
<dd><code>password</code> - The new user password</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new user</dd>
</dl>
</li>
</ul>
<a name="createUserWithoutAttributes-java.lang.String-java.lang.String-java.lang.String-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>createUserWithoutAttributes</h4>
<pre>public&nbsp;java.lang.String&nbsp;createUserWithoutAttributes(@RequestParam(value="username")
                                                    java.lang.String&nbsp;username,
                                                    @RequestParam(value="email")
                                                    java.lang.String&nbsp;email,
                                                    @RequestParam(value="password")
                                                    java.lang.String&nbsp;password)</pre>
<div class="block">Creates a new user in the system</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - The new user username</dd>
<dd><code>email</code> - The new user email</dd>
<dd><code>password</code> - The new user password</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new user</dd>
</dl>
</li>
</ul>
</li>
</ul>
      

Run codeHide result


I don't know where to start digging into this, so I appreciate any input.

javadoc -J version says:

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      

Javadoc command:

javadoc -d docs -Xdoclint:none -sourcepath ./MyProject/src -subpackages com -classpath ./spring-web-4.0.8.RELEASE.jar./spring-context-4.0.8.RELEASE.jar

+3


source to share





All Articles