Skip to main content

Why is javax.xml.stream without type parameters?

5 replies [Last post]
jirkahana
Offline
Joined: 2005-11-09

Is there any reason why javax.xml.stream does not pass any type parameters to classes like Iterator? For example XMLEventReader inherits from Iterator and not Iterator. Thus next() returns Object and must be cast to XMLEvent.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
forax
Offline
Joined: 2004-10-07

No, i can find a reason.
Stax is based on a code written by BEA that use the JDK1.4.
I think the code wasn't upgraded when it was included
into mustang.

I've found other places that doesn't use generics:
EndElement, XMLEventFactory and XMLEventReader.

i hope this bug will be corrected soon.

Rémi Forax

forax
Offline
Joined: 2004-10-07

This bug has been accepted with number 6472193
and will be available in one or two days at
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6472193

Because some parts of it will be non-backward compatible,
i will try to provide a patch this week-end
in order to fix it before mustang release.

Rémi

jirkahana
Offline
Joined: 2005-11-09

Great, thanks! I just voted for it.

forax
Offline
Joined: 2004-10-07

I've submitted a patch, i hope it could be included
in mustang.

Rémi

jirkahana
Offline
Joined: 2005-11-09

That's great! Thanks. It would be really stupid if it was not included....