Community
Participate
Working Groups
I have a class like this: -------8<------- package org.ufacekit.ui.layouts; import org.ufacekit.ui.layouts.properties.OrientationPropertyOwner; import org.ufacekit.ui.layouts.properties.OrientationPropertyOwner.Orientation; /** * box layout where the controls are laid switch the * <code>orientation</code> : * <ul> * <li> {@link Orientation#HORIZONTAL}, the controls are laid out from left to * right in the order that they appear in the box.</li> * <li>{@link Orientation#VERTICAL}, the controls are laid out from top to * bottom.</li> * </ul> */ public interface UIBoxLayout extends UILayout, OrientationPropertyOwner { } -------8<------- and the UI here shows an "unused import org.ufacekit.ui.layouts.properties.OrientationPropertyOwner.Orientation" though I'm using it in the JavaDoc.
I guess you inadvertently disabled Javadoc processing on the Java Compiler > Javadoc preference/properties page. *** This bug has been marked as a duplicate of bug 92821 ***
Markus - could a quickfix help there ? (like check the setting for javadoc processing and trigger appropriate action if not)
> Markus - could a quickfix help there ? (like check the setting for javadoc > processing and trigger appropriate action if not) That would be hard to implement with acceptable performance. We would basically have to compile the whole CU again with Javadoc processing enabled to find out whether an import would still be unused then. I adjusted the preference label a bit to make it more clear that also content assist and imports are affected by this setting.
(In reply to comment #1) > I guess you inadvertently disabled Javadoc processing on the Java Compiler > > Javadoc preference/properties page. > > *** This bug has been marked as a duplicate of bug 92821 *** > No because when I do this with a class it works the problem is only with the enum or is it an inner class problem?
Got it. The import is truly not necessary, since Orientation is accessible without the import based on the fact you import its enclosing type already (OrientationPropertyOwner), and UIBoxLayout extends OrientationPropertyOwner. Member types are inherited from super types... So you can discard the import, and everything will work fine. The compiler warning is thus accurate. ------------------------ Reproduced with standard testcase: import java.util.Map; import java.util.Map.Entry; /** * <li> {@link Entry} </li> */ public interface X extends Map { } Now, the next question is: Markus, organize imports will insert an unused import (try organize imports on the following testcase). import java.util.Map; /** * <li> {@link Entry} </li> */ public interface X extends Map { }
Hmm I spoke too fast. There seems to be an issue in javadoc resolution when removing the unused import, need to double check what's going on there.
> Member types are inherited from super types... This is only true for references in Java. The Javadoc tools has its own rules, see http://java.sun.com/javase/6/docs/technotes/tools/windows/javadoc.html#specifyingname : o Nested classes must be specified as outer.inner, not simply inner, for all forms.
See also bug 222188.
Ok when I use OrientationPropertyOwner.Orientation in JavaDoc it works and the "import org.ufacekit.ui.layouts.properties.OrientationPropertyOwner.Orientation" is not needed any more.
Created attachment 117195 [details] Proposed patch Added JavadocTestForClass054-056
Re: comment 7 Yes, this is what tricked me here. The patch addresses it. Note that the behavior depends on compliance too. If >= 1.5, then presence of single type import allows member single name access. Tom - how pressing is that in 3.4.x ? Can you wait until 3.5 ?
Released for 3.5M4. Fixed
Not pressing at all, so 3.5 is fine. Thanks for the fast fixing.
> Note that the behavior depends on compliance too. If >= 1.5, then presence of > single type import allows member single name access. Which is against the Javadoc spec, but some sunny people don't seem to care :-(
Verified for 3.5M4 using I20081209-0100