Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » @see Type + control + shift + O - adds java import
@see Type + control + shift + O - adds java import [message #258057] Mon, 12 January 2009 12:39 Go to next message
Eclipse UserFriend
------------ before organize imports -----------------------------


/**

* @see Panel

* @author jearly

*

*/

public class Test {

}

------------ after organize imports -----------------------------

when you do control + shift + O or organize imports this types is added to
your classes imports. I did not expect this to happen and it causes what
should be an unused import since there is no reference in the code but the
unused import validation doesn't complain; it assumes that javadoc is part
of the code which isn't correct and I have had javadoc cause more serious
issues such as pull in imports from an internal JDK implementation which
cause portability issues as well as OSGI unresolved issues.

import java.awt.Panel;

/**

* @see Panel

*

*/

public class Test {

}
Re: @see Type + control + shift + O - adds java import [message #258060 is a reply to message #258057] Mon, 12 January 2009 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: n.sherlock.gmail.com

Justin Early wrote:
> when you do control + shift + O or organize imports this types is added
> to your classes imports. >
> import java.awt.Panel;
>
> /**
>
> * @see Panel
>
> *
>
> */

I imagine that this is "as designed". The import needs to be added so
that the Javadoc processor can tell which "Panel" you are referring to.

Cheers,
Nicholas Sherlock
Re: @see Type + control + shift + O - adds java import [message #258165 is a reply to message #258060] Sat, 17 January 2009 18:56 Go to previous messageGo to next message
Eclipse UserFriend
The problem is that a @see Panel could refer to code that is not visible
from a Java or OSGI dependency perspective the import must be removed
otherwise their is a compiler error because the compiler can't resolve the
import that is only required by the @see java doc annotation. I can see if
this was a Java annotation the import must be there but not for a java doc
comment unless these are treated the same by JDT.
Re: @see Type + control + shift + O - adds java import [message #258174 is a reply to message #258165] Sun, 18 January 2009 17:46 Go to previous message
Eclipse UserFriend
Originally posted by: n.sherlock.gmail.com

Justin Early wrote:
> The problem is that a @see Panel could refer to code that is not visible
> from a Java or OSGI dependency perspective the import must be removed
> otherwise their is a compiler error because the compiler can't resolve
> the import that is only required by the @see java doc annotation. I can
> see if this was a Java annotation the import must be there but not for a
> java doc comment unless these are treated the same by JDT.
>

It looks like the problem is solved if you use the qualified name of the
class (i.e., with the package name in front). This provides the
disambiguation that JavaDoc requires to locate the class you are
referring to.

Cheers,
Nicholas Sherlock
Previous Topic:Extending JUnit plugins
Next Topic:programatically cascade refactorings
Goto Forum:
  


Current Time: Sat May 03 05:19:29 EDT 2025

Powered by FUDForum. Page generated in 0.03203 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top