I do this in my code:
Enumeration liste = attribut.getListe ();
if (liste != null) {
while (liste.hasMoreElements ()) {
...
I have one element in my Enumeration but when I inspect liste.hasMoreElements (), why does it return false?
I would have
getListe()always return a collection (empty or otherwise) and only use an Iterator.e.g.
Instead of creating an empty list you can use Collections.emptyList() (and other empty collections)
If your Enumeration should have an element but doesn’t, it would suggest you have a bug in getListe()