Bug 212912 - Javadoc bugs in IMemberValuePair
Summary: Javadoc bugs in IMemberValuePair
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-13 13:37 EST by Markus Keller CLA
Modified: 2008-02-04 15:49 EST (History)
1 user (show)

See Also:


Attachments
Fix (2.32 KB, patch)
2008-01-29 08:28 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-12-13 13:37:38 EST
Follow-up to bug 210565 comment 9

> I don't think that we can refer to compile-time constants here since the user
> can put anything (for example the user forgot .class in the following case:
> @MyAnnot(clazz=Object) )

That argument would apply to the other value kinds as well. E.g. @SuppressWarnings(@Bla) or @SuppressWarnings(Bla.class) also result in the syntactically correct value kinds, but they don't resolve when compiled.

At least you should remove the "Especially" and replace it by "For example,".

And please also fix the wrong note in K_CLASS (attachment 85192 [details]).
Comment 1 Jerome Lanneluc CLA 2007-12-14 11:20:02 EST
(In reply to comment #0)
> Follow-up to bug 210565 comment 9
> 
> > I don't think that we can refer to compile-time constants here since the user
> > can put anything (for example the user forgot .class in the following case:
> > @MyAnnot(clazz=Object) )
> 
> That argument would apply to the other value kinds as well. E.g.
> @SuppressWarnings(@Bla) or @SuppressWarnings(Bla.class) also result in the
> syntactically correct value kinds, but they don't resolve when compiled.
I just meant that we cannot say that the simple name is a compile-time constant. In the case of @SuppressWarnings(@Bla), @Bla is for sure an annotation and in the case of @SuppressWarnings(Bla.class), Blass.class is for sure a class literal.

> At least you should remove the "Especially" and replace it by "For example,".
Maxime, it looks like using "especially" as you suggested is not clear for all. What do you think?

> And please also fix the wrong note in K_CLASS (attachment 85192 [details]).
I'm not sure to understand why the note is wrong. Can you please explain? 

Comment 2 Maxime Daniel CLA 2008-01-02 08:14:56 EST
(In reply to comment #1)
> > At least you should remove the "Especially" and replace it by "For example,".
> Maxime, it looks like using "especially" as you suggested is not clear for all.
> What do you think?
We decided for especially because you wanted to put a specific emphasis on that use case. According to Merriam-Webster, our proposal is correct and conveys your intent. If this confuses some readers, you may want to change it anyway. I fear that 'For example,' would miss your point. One trick you could try would be to use simpler words (aka get rid of especially), but to complete them by a more verbose writing, starting with 'An example of interest...' for example. Another trick would be to give more than one example in a way that makes clear that you do not aim at listing all possible use cases, and to keep 'especially' to emphasize the use case that triggered the API introduction, but that would obviously result into a longer text.
Comment 3 Markus Keller CLA 2008-01-03 10:05:01 EST
(In reply to comment #1)

> > And please also fix the wrong note in K_CLASS (attachment 85192 [details] [details]).
> I'm not sure to understand why the note is wrong. Can you please explain? 

Is: "Note that one can use {@link IType#resolveType(String)} to find the corresponding {@link IType}."

Problem: The return type of IType#resolveType(String) is String[][], so this method alone is not enough to find the corresponding IType.

Proposed solution: "Note that one can use {@link IType#resolveType(String)} and e.g. {@link IJavaProject#findType(String, String, org.eclipse.core.runtime.IProgressMonitor)} to find the corresponding {@link IType}."
=> Tells the user how to find an IType for the String[][]
Comment 4 Markus Keller CLA 2008-01-03 10:54:23 EST
> I just meant that we cannot say that the simple name is a compile-time
> constant. In the case of @SuppressWarnings(@Bla), @Bla is for sure an
> annotation and in the case of @SuppressWarnings(Bla.class), Blass.class is for
> sure a class literal.

That's why I added "(unresolved)" in "This represents an (unresolved) reference to a compile-time constant". Even if the simple name is e.g. "Object", it can still only be a reference to a compile-time constant. It can never be a reference to e.g. a type.

I still think the current "Especially" makes little sense. That the simple name is "FIRST" is not a special or common case - it's only an example of the only correct case (where the name refers to a constant).

To make this explicit, you could say: "The name refers to a compile-time constant, unless there's a compile error."
Comment 5 Maxime Daniel CLA 2008-01-04 01:28:10 EST
(In reply to comment #4)
> I still think the current "Especially" makes little sense. That the simple name
> is "FIRST" is not a special or common case - it's only an example of the only
> correct case (where the name refers to a constant).
The complete sentence reads 'Especially if the simple name is "FIRST" and there is a static import for "MyEnum.FIRST", this can represent an enumeration's constant.' This is because the feature was introduced to support enumerations and Jérôme wanted to emphasize this. But there would still be use cases that are not related to enumerations (aka static final fields, see bug 210565 comment #5 example). Hence the use of especially. My comments about possible variants above still apply though.

Comment 6 Markus Keller CLA 2008-01-04 08:35:56 EST
How about fixing Jerome's initial suggestion (bug 210565 comment 1):
'The simple name refers to an enum constant or another compile-time constant if the code is correct (e.g. "FIRST" when there is a static import for "MyEnum.FIRST").'
=> Makes no guesses and is simple and correct iff the code compiles.

"Especially" followed by a concrete example is just wrong, because the example is *not* special. But I won't spend more time on this argument any more.
Comment 7 Maxime Daniel CLA 2008-01-04 09:11:27 EST
(In reply to comment #6)
> How about fixing Jerome's initial suggestion (bug 210565 comment 1):
> 'The simple name refers to an enum constant or another compile-time constant if
> the code is correct (e.g. "FIRST" when there is a static import for
> "MyEnum.FIRST").'
> => Makes no guesses and is simple and correct iff the code compiles.
I like it.

> "Especially" followed by a concrete example is just wrong, because the example
> is *not* special. But I won't spend more time on this argument any more.
Again, especially does not systematically imply that you're talking about anything 'special'. Merriam-Webster states (amongst other definitions) that especially can stand for 'in particular', which merely marks the intent of the writer to insist on a specific case (that has nothing special beyond the intent of the author to insist on it). Agree that this does not deserve too long a discussion though ;-)
Comment 8 Markus Keller CLA 2008-01-29 08:28:43 EST
Created attachment 88122 [details]
Fix

Here's a patch that implements comment 6 (Maxime said: "I like it.") and comment 3.
Comment 9 Jerome Lanneluc CLA 2008-02-01 10:25:25 EST
Thanks Markus. Patch released for 3.4M5.
Comment 10 Kent Johnson CLA 2008-02-04 15:49:33 EST
Verified for 3.4M5 using I20080204-0010