Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Javadoc and @NonNull
Javadoc and @NonNull [message #1732979] Mon, 23 May 2016 14:08 Go to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
Has anyone successfully used (Sun jdk1.8.0_92) Javadoc for @NonNull
annotated source code?<br>
<br>
I get errors from infix annotated types such as<br>
<br>
<tt>  [javadoc]
E:\GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.pivot\src\org\eclipse\ocl\pivot\utilities\OCL.java:118:
error: annotation type not applicable to this kind of declaration</tt><tt><br>
</tt><tt>  [javadoc]     public static @NonNull OCL
newInstance(EPackage.@NonNull Registry ePackageRegistry) {</tt><tt><br>
</tt><tt>  [javadoc]    
                                                ^</tt><tt><br>
</tt><br>
I get errors from annotated template types such as<br>
<br>
<tt>  [javadoc]
E:\GIT\org.eclipse.ocl\plugins\org.eclipse.ocl.pivot.uml\emf-gen\org\eclipse\ocl\pivot\uml\internal\oclforuml\util\OCLforUMLSwitch.java:41:
error: annotation type not applicable to this kind of declaration</tt><tt><br>
</tt><tt>  [javadoc] public class OCLforUMLSwitch&lt;@Nullable T&gt;</tt><tt><br>
</tt><tt>  [javadoc]                              ^</tt><tt><br>
</tt><br>
Where Javadoc is generated, infixes are shown as untidy prefixes:<br>
<h4>getCSResource</h4>
<pre>@NonNull
public <a href="file:///C:/Users/Edward/AppData/Local/Temp/wz57c8/org/eclipse/ocl/pivot/resource/CSResource.html" title="interface in org.eclipse.ocl.pivot.resource">CSResource</a> getCSResource(@NonNull
org.eclipse.emf.common.util.URI uri,
@NonNull
java.io.InputStream inputStream)
throws java.io.IOException</pre>
<span class="throwsLabel"><br>
It all culminates in<br>
<br>
  [javadoc] java.lang.ClassCastException:
com.sun.tools.javac.code.Symbol$TypeVariableSymbol cannot be cast
to com.sun.tools.javac.code.Symbol$ClassSymbol<br>
  [javadoc]     at
com.sun.tools.javac.api.JavacTrees.attributeDocReference(JavacTrees.java:410)<br>
  [javadoc]     at
com.sun.tools.javac.api.JavacTrees.getElement(JavacTrees.java:345)<br>
  [javadoc]     at
com.sun.tools.doclint.Checker.visitReference(Checker.java:756)<br>
  [javadoc]     at
com.sun.tools.doclint.Checker.visitReference(Checker.java:95)<br>
  [javadoc]     at
com.sun.tools.javac.tree.DCTree$DCReference.accept(DCTree.java:523)<br>
  [javadoc]     at
com.sun.source.util.DocTreePathScanner.scan(DocTreePathScanner.java:65)<br>
  [javadoc]     at
com.sun.source.util.DocTreeScanner.visitLink(DocTreeScanner.java:177)<br>
  [javadoc]     at
com.sun.tools.doclint.Checker.visitLink(Checker.java:684)<br>
</span><br>
From the @NonNull errors it would appear that Javadoc -source 1.8 is
using 1.7 policies.<br>
<br>
Has Javadoc not been updated, or is there some magic incantation
that I should have used?<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
</body>
</html>
Re: Javadoc and @NonNull [message #1733032 is a reply to message #1732979] Mon, 23 May 2016 20:40 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Wow, interesting post format, particularly how the forum software adds a link to EPackage.@NonNull Razz

All I could find on this topic [1]:
Quote:
Impact
...
Documentation: javadoc must display annotations on type uses.


Maybe s.o. forgot to implement this? Oh my ...
Stephan

[1] http://openjdk.java.net/jeps/104
Re: Javadoc and @NonNull [message #1733098 is a reply to message #1733032] Tue, 24 May 2016 11:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi Stephan

Checking the bug database before reporting reveals

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8146008

which looks rather similar but only for Java 9.

I don't seem to be able to add a comment. Are you able to add a "Java 8
too" comment?

[The final CCE in my original post was the reaction to an attempt to
@link a method wrt a Template Parameter. That fixed, at least Javadoc is
produced but infix and template parameter @NonNull are ignored.]

Regards

Ed Willink

On 23/05/2016 21:40, Stephan Herrmann wrote:
> Wow, interesting post format, particularly how the forum software adds
> a link to mailto:EPackage.@NonNull :p
>
> All I could find on this topic [1]:
> Quote:
>> Impact
>> ...
>> Documentation: javadoc must display annotations on type uses.
>
>
> Maybe s.o. forgot to implement this? Oh my ...
> Stephan
>
> [1] http://openjdk.java.net/jeps/104
Re: Javadoc and @NonNull [message #1733105 is a reply to message #1733098] Tue, 24 May 2016 05:23 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
I have no privileges on Oracle's bug tracker. You can, however, see a little more on it via https://bugs.openjdk.java.net/browse/JDK-8146008

Stephan
Re: Javadoc and @NonNull [message #1733146 is a reply to message #1733105] Tue, 24 May 2016 18:17 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hm

Yes, but it seems a strange kind of Open consortium that prohibits
non-members from posting coments or raising bugs.

Regards

Ed


On 24/05/2016 06:23, Stephan Herrmann wrote:
> I have no privileges on Oracle's bug tracker. You can, however, see a
> little more on it via https://bugs.openjdk.java.net/browse/JDK-8146008
>
> Stephan
Previous Topic:Classes Suddenly Stopped Working
Next Topic:get Block of class ASTparser
Goto Forum:
  


Current Time: Mon Nov 04 05:40:33 GMT 2024

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

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

Back to the top