On 08/09/2012 07:55 AM, Claudio Bley wrote: >>> + VIR_ERR_UNKNOWN; /* unknown error (must be the last entry!) */ >> >> ...and this common use of a name among two different enums going to bite >> us? > > No, not at all. Enums are type-safe in Java and enums have their own > namespace; one always has to specify the enum name when referring to > an enum constant. (except in case statements where the compiler can > infer the type of the enum constant) Good. > > Rather, I would /very/ much like these superfluous prefixes of all enum > constants to be removed from the libvirt-java interface. They're of no > use really, despite adding to the code bloat. Indeed - the whole point of bindings in OO languages is to remove the superfluous prefixes used for namespacing in C when we can instead use the object oriented namespacing; ErrorDomain.FROM_QEMU reads much better than ErrorDomain.VIR_FROM_QEMU. A followup patch to alter the namespacing might be nice (but _then_ you have to worry about back-compat to existing clients; can you have two enum names, FROM_QEMU and VIR_FROM_QEMU, that both share the same numeric value?) > -- >8 -- > Subject: [libvirt-java PATCHv3] Fix IndexOutOfBoundsException for > unknown error number/domain/level > codes. 'git am' couldn't parse this properly, and I had to amend the commit to trim out the rest of your message (not a severe issue, but I'm not sure why things didn't quite go like normal). > > Remove default constructor because it does not init the object properly. > > Add a special *_UNKNOWN enum value to each enum which is used when the > given enum code is out of bounds. > --- > src/main/java/org/libvirt/Error.java | 43 +++++++++++++++++++++++++++++------- > 1 file changed, 35 insertions(+), 8 deletions(-) ACK and pushed. -- Eric Blake eblake@xxxxxxxxxx +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list