JAXB Implementation project has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
The fluent-api plugin already generates vararg-based withXYZ() methods for
collection properties. This works fine in most cases, but when XJC generates
properties of type JAXBElement, you end up with a lot of compiler warning when
using the vararg method.
This is because JAXBElement is a generic type, and when you pass an object of a
generic type to a method with a vararg parameter, the compiler complains:
"a generic array is created for a varargs parameter"
It's a pointless and harmless warning, but you get a lot of them.
I suggest that the fluent-api plugin also generates a with...() method that
takes a single, non-vararg parameter, as a special case for the vararg version.
This would remove the warnings in cases where we only have a single object to
add to the collection.
If this wasn't auto-generated code, I wouldn't see it as worth the bother, but
it would many of my bindings less frustrating.
The fluent-api plugin already generates vararg-based withXYZ() methods for collection properties. This works fine in most cases, but when XJC generates properties of type JAXBElement, you end up with a lot of compiler warning when using the vararg method.
This is because JAXBElement is a generic type, and when you pass an object of a generic type to a method with a vararg parameter, the compiler complains:
"a generic array is created for a varargs parameter"
It's a pointless and harmless warning, but you get a lot of them.
I suggest that the fluent-api plugin also generates a with...() method that takes a single, non-vararg parameter, as a special case for the vararg version. This would remove the warnings in cases where we only have a single object to add to the collection.
If this wasn't auto-generated code, I wouldn't see it as worth the bother, but it would many of my bindings less frustrating.
Environment
Operating System: All Platform: All
Affected Versions
[current]