A simpler model for repeating annotations

Remi Forax forax at univ-mlv.fr
Thu Jan 3 02:40:51 PST 2013


On 01/03/2013 02:46 AM, Alex Buckley wrote:
> Having spent today writing out the expected behavior of core 
> reflection methods, I'm sympathetic to the idea that 
> get[Declared]Annotations(Class) should be more clearly distinguished. 
> I've avoided the term "repeating" in API names since repetition is not 
> really the point - the point is multiple applications of the same 
> annotation type, but "multiple" has its own downsides since there may 
> only be one annotation for the new methods to return. I'd favor 
> something more like getAll[Declared]Annotations(Class). Comments welcome.
>
> Alex

yes, getAll* is Ok for me.

Rémi

>
> On 1/2/2013 7:32 AM, Paul Benedict wrote:
>> BTW, I read something by Remi a few days back that was quite
>> interesting. It was from another thread. He said that correct method
>> overloading is not supposed to change behavior. Given that bit of
>> wisdom, that's why I recommend a renaming here. Behavior is changing,
>> thus a new name should be given.
>>
>> On Wed, Jan 2, 2013 at 9:22 AM, Paul Benedict <pbenedict at apache.org> 
>> wrote:
>>> I like the new proposal better. Yet, there's one thing that bothers
>>> me, which is the naming of get[Declared]Annotations(Foo.class). It's
>>> way too easy to look at the API and miss the difference in behavior
>>> here. I propose giving it this name:
>>> get[Declared]RepeatingAnnotations(Foo.class) -- and do the same for
>>> language model's new typed method.
>>>
>>> Paul




More information about the enhanced-metadata-spec-discuss mailing list