Hi,

I found some behaviour of the logic:notEmpty tag which I think is
inconsistent.

Reading the documentation, I think it should call a collection's isEmpty()
method. It works as expected with a bean of type List, but it doesn't work
with a Map.

Testcase:

If emptyList was built with

  List emptyList = new ArrayList();

the following fragment correctly states only "emptyList empty":

  <logic:empty name="emptyList">emptyList empty</logic:empty><br>
  <logic:notEmpty name="emptyList">emptyList not empty</logic:notEmpty><br>

But if I change from emtpyList to

  Map emptyMap = new HashMap();

and test it with

  <logic:empty name="emptyMap">emptyMap empty</logic:empty><br>
  <logic:notEmpty name="emptyMap">emptyMap not empty</logic:notEmpty><br>

I get

  emptyMap not empty
  nonemptyMap not empty

instead of just "emptyMap empty". Both (mutually exclusive) statements seem
to evaluate to true.

So, is this a misunderstanding from my side or a bug in the implementation?

TIA

Steffen


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to