Paul Benedict pbenedict at apache.org
Tue Aug 20 13:27:11 UTC 2013

Jon, it's not a problem with the method docs, per se. The issue is about
how the generation isn't documented. My questioning started because I was
using several enums without javadoc available, but I did have the source
available, and couldn't figure out how the method came to be. Since I've
asked, everyone knew (but me!) it was a generated method, but I couldn't
divine that knowledge.

My recommendation is to add an @implNote on Enum.valueOf(Class, String) so
that people know each subclass will get a generated method that behaves
similarly. What do you think?

On Mon, Aug 19, 2013 at 9:23 AM, Paul Benedict <pbenedict at apache.org> wrote:

> I have been working with classes that don't have javadoc attachments. The
> problem was I couldn't find the method in the source nor was the method
> part of the Enum class. So where did it materialize from? Now I know the
> answer: the compiler generates it.
> I really think this knowledge should be added to the Enum javadoc class. I
> had to go on quite a goose hunt to find this fact.
> Paul
> On Mon, Aug 19, 2013 at 3:32 AM, Alan Bateman <Alan.Bateman at oracle.com>wrote:
>> On 18/08/2013 05:07, Paul Benedict wrote:
>>> I think the generated method needs to be listed in the class javadoc at
>>> least. I presume it throws an exception too (like the other valueOf) if
>>> the
>>> String can't be resolved to a constant, but no user is going to discover
>>> this fact through the documentation.
>>>  Have you checked the generated avadoc for your enum? The
>> valueOf(String) should be there and specified to throw IAE or NPE.
>> -Alan
> --
> Cheers,
> Paul


More information about the core-libs-dev mailing list