OpenNTF/org.openntf.domino

List not empty when using getColumnValue("colName", ArrayList.class) on an empty column

dnmd opened this issue · 1 comments

dnmd commented

When using entry.getColumnValue("colName", ArrayList.class) on an empty column, it does not return an empty list as one might expect. But a list with one String element.

List<String> list = entry.getColumnValue("colName", ArrayList.class);

System.out.println(list.isEmpty()); // false
System.out.println(list.size()); // == 1
  1. I don't know if this is intended or by design but I could not find any examples / known issues about it.
  2. What would be a proper way to prevent such behavior? As I would expect an empty List, my guess is that it happens somewhere around here

We would have to add a switch for this behavior, because the legacy API
returns a Vector with one "" in it when a column value is "empty"
just like it does with an "empty" field. There's actually no such thing as
empty in Notes.

On Mon, Nov 2, 2015 at 5:44 AM, dnmd notifications@github.com wrote:

When using entry.getColumnValue("colName", ArrayList.class) on an empty
column, it does not return an empty list as one might expect. But a list
with one String element.

List list = entry.getColumnValue("colName", ArrayList.class);
System.out.println(list.isEmpty()); // falseSystem.out.println(list.size()); // == 1

  1. I don't know if this is intended or by design but I could not find any
    examples / known issues about it.
  2. What would be a proper way to prevent such behavior? As I would expect
    an empty List, my guess is that it happens somewhere around here
    https://github.com/OpenNTF/org.openntf.domino/blob/master/domino/core/src/main/java/org/openntf/domino/impl/ViewEntry.java#L522


Reply to this email directly or view it on GitHub
#140.