Unused imports and @link javadoc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unused imports and @link javadoc

Stevo Slavić
Hello Checkstyle users,

Checkstyle 5.1 (used via Sonar, btw, whose upgrade to 5.3
http://jira.codehaus.org/browse/SONAR-1836 is blocked by
http://sourceforge.net/tracker/?func=detail&aid=3132645&group_id=29721&atid=397078
) and 5.3 (through eclipse-cs plugin) report that a class A has an
unused import of class B referenced only in @link javadoc of a method
in class A. Eclipse IDE configured on save to automatically arrange
import section, adds import of B in A.

Can someone please enlighten me on who is correct, Checkstyle in
reporting unused import or Eclipse in configuring import for a class
only referenced in javadoc?

Thanks in advance!

Regards,
Stevo.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Unused imports and @link javadoc

Oliver Burn

Eclipse is correct.

On 30/03/2011 10:57 AM, "Stevo Slavić" <[hidden email]> wrote:
> Hello Checkstyle users,
>
> Checkstyle 5.1 (used via Sonar, btw, whose upgrade to 5.3
> http://jira.codehaus.org/browse/SONAR-1836 is blocked by
> http://sourceforge.net/tracker/?func=detail&aid=3132645&group_id=29721&atid=397078
> ) and 5.3 (through eclipse-cs plugin) report that a class A has an
> unused import of class B referenced only in @link javadoc of a method
> in class A. Eclipse IDE configured on save to automatically arrange
> import section, adds import of B in A.
>
> Can someone please enlighten me on who is correct, Checkstyle in
> reporting unused import or Eclipse in configuring import for a class
> only referenced in javadoc?
>
> Thanks in advance!
>
> Regards,
> Stevo.
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user
Reply | Threaded
Open this post in threaded view
|

Re: Unused imports and @link javadoc

Stevo Slavić
Thanks Oliver,

Found bug report:
http://sourceforge.net/tracker/?func=detail&atid=397078&aid=652303&group_id=29721

And javadoc FAQ explaining that referenced class "must be referenced
by a declaration or any kind of import statement":
http://java.sun.com/j2se/javadoc/faq/index.html#missinglinks

IMO proper solution would be to fix "Unused imports" check. Current
workaround is to reference class using full class path and not just by
name.

Regards,
Stevo.

On Wed, Mar 30, 2011 at 2:44 AM, Oliver Burn <[hidden email]> wrote:

> Eclipse is correct.
>
> On 30/03/2011 10:57 AM, "Stevo Slavić" <[hidden email]> wrote:
>> Hello Checkstyle users,
>>
>> Checkstyle 5.1 (used via Sonar, btw, whose upgrade to 5.3
>> http://jira.codehaus.org/browse/SONAR-1836 is blocked by
>>
>> http://sourceforge.net/tracker/?func=detail&aid=3132645&group_id=29721&atid=397078
>> ) and 5.3 (through eclipse-cs plugin) report that a class A has an
>> unused import of class B referenced only in @link javadoc of a method
>> in class A. Eclipse IDE configured on save to automatically arrange
>> import section, adds import of B in A.
>>
>> Can someone please enlighten me on who is correct, Checkstyle in
>> reporting unused import or Eclipse in configuring import for a class
>> only referenced in javadoc?
>>
>> Thanks in advance!
>>
>> Regards,
>> Stevo.
>>
>>
>> ------------------------------------------------------------------------------
>> Enable your software for Intel(R) Active Management Technology to meet the
>> growing manageability and security demands of your customers. Businesses
>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>> be a part of the solution? Download the Intel(R) Manageability Checker
>> today! http://p.sf.net/sfu/intel-dev2devmar
>> _______________________________________________
>> Checkstyle-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
> ------------------------------------------------------------------------------
> Enable your software for Intel(R) Active Management Technology to meet the
> growing manageability and security demands of your customers. Businesses
> are taking advantage of Intel(R) vPro (TM) technology - will your software
> be a part of the solution? Download the Intel(R) Manageability Checker
> today! http://p.sf.net/sfu/intel-dev2devmar
> _______________________________________________
> Checkstyle-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
>
>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Checkstyle-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/checkstyle-user