On Fri, Jan 16, 2009 at 3:17 AM, Tom Hawtin <tackl...@tackline.plus.com> wrote:
>
> On Jan 14, 3:28 pm, Reinier Zwitserloot <reini...@gmail.com> wrote:
>
>> com.package.ContainingClass.foobar(Ljava/util/List;V)
>> com.package.ContainingClass.foobar(Ljava/util/List;I)
>>
>> which is not okay - being only different in return type is not
>> allowed. This isn't a big concern and is not generally covered by what
>> is meant with 'we should reify generics', but its important to know
>> that this can pretty much never be fixed without serious overhauling
>> of the JVM.
>
> Adding generic type information to method calls and using that
> together with the generic type information already present on methods
> in the class file doesn't seem a great stretch to me. The question is
> what sort of bangs-per-buck are you getting. The bucks are small, bit
> the bangs are barely a fizzle, IMO. But I think thats a general
> problem with reification.

You could make the same point for any overloading. If you can
distinguish between

  singleParameterMethod(A param);
and
  singleParameterMethod(B param);

why not distinguish

  listParameterMethod(List<A> param);
and
  listParameterMethod(List<B> param);

?

The conceptual difference seems very similar. Even more extreme if you
include arrays -- but I'd rather ignore those.

>> what can actually be recovered by the JVM at runtime is this:
>>
>> List<String> foo = new ArrayList();
>
> It gets more paradoxical with the like of Collections.emptySet

The problem exists only if you look at a mutable version, otherwise
the empty set can be seen as being of any type. Once you require
mutability it is only fair to request the specification of a type
parameter.

  Peter

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to