Skip to content

Commit 4655729

Browse files
committed
fixed implementation (Issue #944)
1 parent 7c306bf commit 4655729

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

imixs-workflow-faces/src/main/java/org/imixs/workflow/faces/util/VectorConverter.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,19 @@ public class VectorConverter implements Converter {
4444

4545
@SuppressWarnings({ "unchecked" })
4646
public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException {
47-
// Return null for empty values to allow required validation to work
48-
if (value == null || value.trim().isEmpty()) {
49-
return null;
50-
}
47+
5148
// for backward compatibility we leave it a Vector even if a ArrayList would
5249
// make more sense here.
5350
Vector v = new Vector();
5451
String[] tokens = value.split(separator);
5552
for (int i = 0; i < tokens.length; i++) {
56-
String token = tokens[i].trim();
57-
// Optional: skip empty lines to avoid empty elements in the vector
58-
if (!token.isEmpty()) {
59-
v.addElement(token);
53+
String val = tokens[i].trim();
54+
if (!val.isEmpty()) {
55+
v.addElement(tokens[i].trim());
6056
}
6157
}
62-
// Return null if vector is empty after processing
63-
return v.isEmpty() ? null : v;
58+
59+
return v;
6460
}
6561

6662
/**

0 commit comments

Comments
 (0)