Bug 513733 - JDT null analysis documentation for external annotations conflicts with actual functionality
Summary: JDT null analysis documentation for external annotations conflicts with actua...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.7 M7   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2017-03-15 20:08 EDT by Matthew DOnofrio CLA
Modified: 2017-05-11 06:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew DOnofrio CLA 2017-03-15 20:08:04 EDT
The documentation for external annotations:
https://wiki.eclipse.org/JDT_Core/Null_Analysis/External_Annotations

Provides the example:
interface java/util/Map
 <KV>
get
 (Ljava/lang/Object;)TV;
 (Ljava/lang/Object;)T0V;


Using this annotation throws a runtime exception:
Exception:java.io.IOException: missing class header in annotation file for java/util/Map

Full error log:
http://pastebin.com/raw/dkP8jgQf

The analysis will work if the word "interface" is instead written as "class"; but this conflicts with the documentation as well as the output of javap.
Comment 1 Stephan Herrmann CLA 2017-03-16 05:21:55 EDT
Thanks. 

The wiki page was inconsistent.

Under "File layout" we have:
--
typeHeader
    starts with the keyword class (subsuming also interfaces and enums)
--

so clearly the example was wrong.

The implementation ("Annotate" command) always uses "class" when creating a new .eea file.

Fixed in the wiki.

FWIW: apparently I had been considering to differentiate, but found no advantage. Then I remembered that all these are called class files, so "class" is already used as a generalization in other places. So, "class" is it.
Comment 2 Jay Arthanareeswaran CLA 2017-05-09 09:25:21 EDT
Verified for 4.7 M7