Bug 409352 - [regression] API tooling complains about missing @since tag for an interface method that has @noreference tag
Summary: [regression] API tooling complains about missing @since tag for an interface ...
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 RC3   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-28 22:54 EDT by Sergey Prigogin CLA
Modified: 2013-05-30 16:52 EDT (History)
4 users (show)

See Also:
markus.kell.r: review+
daniel_megert: review+
curtis.windatt.public: review+


Attachments
fix (1.07 KB, patch)
2013-05-29 10:37 EDT, Michael Rennie CLA
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2013-05-28 22:54:15 EDT
API tooling produces "Missing @since tag on getEvaluation()" error message for	http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IValue.java line 35. API tooling in Eclipse 3.8.2 was satisfied by the @noreference tag.
Comment 1 Michael Rennie CLA 2013-05-29 10:18:22 EDT
(In reply to comment #0)
> API tooling produces "Missing @since tag on getEvaluation()" error message
> for
> http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.
> core/parser/org/eclipse/cdt/core/dom/ast/IValue.java line 35. API tooling in
> Eclipse 3.8.2 was satisfied by the @noreference tag.

This is a regression introduced with the fix for bug 402393 - we corrected the detection for @noreference tags on interface fields (don't allow it), but at the same time broke the tag for interface methods. I will attach a patch.

There is a workaround however, you can add an API filter for the since tag warning.

Curtis, do we want to consider fixing this for RC3?
Comment 2 Michael Rennie CLA 2013-05-29 10:37:02 EDT
Created attachment 231701 [details]
fix

The patch allows the API description to be properly annotated with the tags for interface methods not explicitly tagged as public.
Comment 3 Curtis Windatt CLA 2013-05-29 12:02:17 EDT
Dani and Markus, please review this fix for RC3 inclusion.  Looks like we don't have enough people in PDE as the component lead and committer review must be separate people.

This regression should be fixed in Kepler as we do not want to change the tag behaviour on interface methods at this time.  A more detailed discussion on where the tags are supported is waiting until 4.4 (Bug 220905).  The fix is well contained, only modifying this specific case (method with a parent type that is an interface).
Comment 4 Dani Megert CLA 2013-05-29 15:16:07 EDT
Comment on attachment 231701 [details]
fix

The patch is good and I verified that it works.
Comment 5 Curtis Windatt CLA 2013-05-29 15:19:51 EDT
+1 for RC3
Comment 6 Markus Keller CLA 2013-05-29 15:20:43 EDT
I couldn't actually verify the scenario, but the fix looks reasonable (except for the strange formatting).

Note that there are more cases than this where members are implicitly public:

interface I {
    int pub(); // this fix
    int PUB = 1, PUB2 = 2;
    class PUB {}
}
@interface Annot {
    int pub();
    int PUB = 1;
    class PUB {}
}
enum En {
    PUB;
    void packAccess() {}
}
Comment 7 Dani Megert CLA 2013-05-29 15:28:43 EDT
(In reply to comment #6)
> I couldn't actually verify the scenario, but the fix looks reasonable

You can start a target and e.g. import JDT UI and set the baseline to 4.2.2. Then add a new method to an API interface and mark it with @noreference. Without the patch you get missing @since tag error. With the patch all is good.
Comment 8 Curtis Windatt CLA 2013-05-29 15:52:07 EDT
(In reply to comment #6)
> interface I {
>     class PUB {}
> }

We don't support @noreference on interface fields and this patch deals with the method case.  However, this case may not be handled correctly.  The tag validator is treating the class declaration as being package default.  This was discussed while fixing Bug 402393, but I don't see any comments relating to the resolution and none of the tag validator tests capture this case.

This discussion warrants a new bug tied to bug 220905.

I applied Mike's patch to master:
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=4c1c40c39bf4ef7f40947f109891be17ba006ffc
Comment 9 Curtis Windatt CLA 2013-05-29 16:20:14 EDT
(In reply to comment #8)
> We don't support @noreference on interface fields and this patch deals with
> the method case.  However, this case may not be handled correctly.  The tag
> validator is treating the class declaration as being package default.  This
> was discussed while fixing Bug 402393, but I don't see any comments relating
> to the resolution and none of the tag validator tests capture this case.
> 
> This discussion warrants a new bug tied to bug 220905.

Bug 409428 - Consistently handle implicitly public members

See also:
Bug 409393 - Content assist does not work on an interface field or method unless explicitly marked as public
Bug 409429 - Make content assist, tag scanner and tag validator consistent
Comment 10 Curtis Windatt CLA 2013-05-30 16:52:57 EDT
Verified in I20130529-2000