JavadocMethod:预期的@param 标记错误实际上存在

JavadocMethod: Expected @param tag error when actually it exist

我收到以下检查样式错误

[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[45,46] (javadoc) JavadocMethod: Expected @param tag for 'retrievePersonByPersonIdPayerResponse'.
[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[46,33] (javadoc) JavadocMethod: Expected @param tag for 'fidelioPostResponse'.
[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[46,62] (javadoc) JavadocMethod: Expected @param tag for 'personId'.
[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[46,89] (javadoc) JavadocMethod: Expected @param tag for 'blist'.
[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[46,103] (javadoc) JavadocMethod: Expected @param tag for 'paymentType'.
[ERROR] src\main\java\com\disney\wdpr\dclm\personalization\base\service\mapper\PaymentSvcMapper.java:[47,21] (javadoc) JavadocMethod: Expected @param tag for 'routedPId'.

但是我的代码在指定的函数和行号中包含@param 标签。

/**
 * @param retrievePersonByPersonIdPayerResponse
 * @param fidelioPostResponse
 * @param personId
 * @param blist
 * @param paymentType
 * @param routedPId
 * @return
 */
public static PaymentResponse mapPaymentRequest(
        RetrievePersonByPersonIdResponse retrievePersonByPersonIdPayerResponse,
        FidelioPostResponse fidelioPostResponse, Integer personId, HashSet<Integer> blist, String paymentType,
        Integer routedPId) {

请指教

这是因为你只列出论据,却没有解释。您的 javadoc 是一种浪费 space,它不会添加代码中不存在的任何内容。

这是一个最小的例子:

public class Test {
    /**
     * @param theFoo what to foo
     */
    public String foo(String theFoo) {
        return theFoo;
    }
}

当我 运行 javadoc 时,我收到类似的投诉:

robert:~$ javadoc Test.java
Loading source file Test.java...
Constructing Javadoc information...
Standard Doclet version 14.0.1
Building tree for all the packages and classes...
Generating ./Test.html...
Test.java:3: warning: no description for @param
     * @param theFoo
       ^
Test.java:5: warning: no @return
    public String foo(String theFoo) {
                  ^
...

只需添加一点解释即可修复它:

public class Test {
    /**
     * @param theFoo what to foo
     * @return the same foo
     */
    public String foo(String theFoo) {
        return theFoo;
    }
}

您不会收到有关它的警告,但老实说,您的 Javadoc 应该在第一个 @param.

上方解释该方法的作用