You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2018/12/30 10:58:00 UTC
[jira] [Updated] (MJAVADOC-559) Extra duplicate "throws" tags added
to methods with same names
[ https://issues.apache.org/jira/browse/MJAVADOC-559?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Scholte updated MJAVADOC-559:
------------------------------------
Description:
This was one of the bugs I'd submitted a patch for in MJAVADOC-452. In that patch I had added a change buffer so that the javadoc output for each method would be queued up, stripped of duplicates, and sorted before writing. I think we still need that logic. Consider the class below, where i have a method getFirstValue and two methods getFirstValueAsInt. The latter both have a proper declaration of throws NFE, but then each gets an extra declaration at the end of the javadoc block. I ran this test using the MJAVADOC-452 branch:
{code}
/**
* Method getFirstValue.
*
* @param key
* String
* @param defaultValue
* a {@link java.lang.String} object.
* @return String
* @since 2.7.3
*/
public String getFirstValue(String key, String defaultValue) {
...
}
/**
* Method getFirstValueAsInt.
*
* @param key
* String
* @return int
* @throws java.lang.NumberFormatException
* if the value is not an integer
* @since 3.0
* @throws java.lang.NumberFormatException if any.
*/
public int getFirstValueAsInt(String key) throws NumberFormatException {
...
}
/**
* NOTE: this method returns the defaultValue if the stored value is null <em>OR</em> an empty string
*
* @param key
* String
* @param defaultValue
* a int.
* @return int
* @throws java.lang.NumberFormatException
* if the value is not an integer
* @since 3.0
* @throws java.lang.NumberFormatException if any.
*/
public int getFirstValueAsInt(String key, int defaultValue) throws NumberFormatException {
...
}
{code}
Robert would you like me to create a patch for this or to do it yourself? If you could merge the 452 branch into master I can do a pull from master. Or I could pull from 452. Let me know if you'd like some help here. Thanks!
Best regards,
Richard
was:
This was one of the bugs I'd submitted a patch for in MJAVADOC-452. In that patch I had added a change buffer so that the javadoc output for each method would be queued up, stripped of duplicates, and sorted before writing. I think we still need that logic. Consider the class below, where i have a method getFirstValue and two methods getFirstValueAsInt. The latter both have a proper declaration of throws NFE, but then each gets an extra declaration at the end of the javadoc block. I ran this test using the MJAVADOC-452 branch:
{{/**}}
{{ * Method getFirstValue.}}
{{ *}}
{{ * @param key}}
{{ * String}}
{{ * @param defaultValue}}
{{ * a \{@link java.lang.String} object.}}
{{ * @return String}}
{{ * @since 2.7.3}}
{{ */}}
{{ public String getFirstValue(String key, String defaultValue) {}}
{{...}}
{{}}}
{{/**}}
{{ * Method getFirstValueAsInt.}}
{{ *}}
{{ * @param key}}
{{ * String}}
{{ * @return int}}
{{ * @throws java.lang.NumberFormatException}}
{{ * if the value is not an integer}}
{{ * @since 3.0}}
{{ {color:#FF0000}* @throws java.lang.NumberFormatException if any.{color}}}
{{*/}}
{{ public int getFirstValueAsInt(String key) throws NumberFormatException {}}
{{...}}
{{}}}
{{/**}}
{{ * NOTE: this method returns the defaultValue if the stored value is null <em>OR</em> an empty string}}
{{ *}}
{{ * @param key}}
{{ * String}}
{{ * @param defaultValue}}
{{ * a int.}}
{{ * @return int}}
{{ * @throws java.lang.NumberFormatException}}
{{ * if the value is not an integer}}
{{ * @since 3.0}}
{{ {color:#FF0000}* @throws java.lang.NumberFormatException if any.{color}}}
{{ */}}
{{ public int getFirstValueAsInt(String key, int defaultValue) throws NumberFormatException {}}
{{...}}
{{}}}
Robert would you like me to create a patch for this or to do it yourself? If you could merge the 452 branch into master I can do a pull from master. Or I could pull from 452. Let me know if you'd like some help here. Thanks!
Best regards,
Richard
> Extra duplicate "throws" tags added to methods with same names
> --------------------------------------------------------------
>
> Key: MJAVADOC-559
> URL: https://issues.apache.org/jira/browse/MJAVADOC-559
> Project: Maven Javadoc Plugin
> Issue Type: Bug
> Components: fix
> Affects Versions: 2.10.4, 3.0.1
> Reporter: Richard Sand
> Priority: Major
>
> This was one of the bugs I'd submitted a patch for in MJAVADOC-452. In that patch I had added a change buffer so that the javadoc output for each method would be queued up, stripped of duplicates, and sorted before writing. I think we still need that logic. Consider the class below, where i have a method getFirstValue and two methods getFirstValueAsInt. The latter both have a proper declaration of throws NFE, but then each gets an extra declaration at the end of the javadoc block. I ran this test using the MJAVADOC-452 branch:
> {code}
> /**
> * Method getFirstValue.
> *
> * @param key
> * String
> * @param defaultValue
> * a {@link java.lang.String} object.
> * @return String
> * @since 2.7.3
> */
> public String getFirstValue(String key, String defaultValue) {
> ...
> }
> /**
> * Method getFirstValueAsInt.
> *
> * @param key
> * String
> * @return int
> * @throws java.lang.NumberFormatException
> * if the value is not an integer
> * @since 3.0
> * @throws java.lang.NumberFormatException if any.
> */
> public int getFirstValueAsInt(String key) throws NumberFormatException {
> ...
> }
> /**
> * NOTE: this method returns the defaultValue if the stored value is null <em>OR</em> an empty string
> *
> * @param key
> * String
> * @param defaultValue
> * a int.
> * @return int
> * @throws java.lang.NumberFormatException
> * if the value is not an integer
> * @since 3.0
> * @throws java.lang.NumberFormatException if any.
> */
> public int getFirstValueAsInt(String key, int defaultValue) throws NumberFormatException {
> ...
> }
> {code}
> Robert would you like me to create a patch for this or to do it yourself? If you could merge the 452 branch into master I can do a pull from master. Or I could pull from 452. Let me know if you'd like some help here. Thanks!
>
> Best regards,
> Richard
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)