Closed GoogleCodeExporter closed 9 years ago
Hi,
you are right, you will not be able to distinguish between different types of
generic lists after compilation because Java generics are erasure type. I think
the issue can be closed as there is no way to fix it.
Besides, I think it makes little sense to post List<Integer> to the event bus
anyway. You will not be able to use this type for some other purpose and it
contains no information on what kind of integers are inside. You will not be
able to add a comment to it. You are much better of posting events containing
the list. For example:
/** Magic numbers have changed! @see MagicNumbers */
class MagicNumbersChanged {
public final List<Integer> numbers;
}
In this case you will be able to access the numbers as a generic list and at
the same time you will be able to have different event types using
List<Integer>.
BR,
Yuriy
Original comment by Yuriy.Kulikov.87@gmail.com
on 14 Sep 2014 at 2:52
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:17
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
ekuef...@gmail.com
on 26 May 2013 at 3:18