Skip to content

Commit 2bb144c

Browse files
committed
[KNOWAGE-6496] Using an analytical driver that has values with white spaces at the end is not working
1 parent c8e2c26 commit 2bb144c

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

knowagedao/src/main/java/it/eng/spagobi/behaviouralmodel/lov/bo/LovResultHandler.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
*/
1818
package it.eng.spagobi.behaviouralmodel.lov.bo;
1919

20-
import it.eng.spago.base.SourceBean;
21-
import it.eng.spago.base.SourceBeanException;
22-
2320
import java.util.ArrayList;
2421
import java.util.List;
2522

2623
import org.apache.log4j.Logger;
2724

25+
import it.eng.spago.base.SourceBean;
26+
import it.eng.spago.base.SourceBeanException;
27+
2828
/**
2929
* Defines method to manage lov result
3030
*/
@@ -115,10 +115,12 @@ public List getValues(String valueColumnName) {
115115
public boolean containsValue(String value, String valueColumnName) {
116116
List values = getValues(valueColumnName);
117117
for (int i = 0; i < values.size(); i++) {
118-
if (value == null && values.get(i) == null)
118+
if (value == null && values.get(i) == null) {
119119
return true;
120-
if (values.get(i) != null && values.get(i).toString().equalsIgnoreCase(value))
120+
}
121+
if (values.get(i) != null && values.get(i).toString().trim().equalsIgnoreCase(value)) {
121122
return true;
123+
}
122124
}
123125
return false;
124126
}
@@ -160,10 +162,11 @@ public String getValueDescription(String value, String valueColumnName, String d
160162
return null;
161163
}
162164
Object description = sb.getAttribute(descriptionColumnName);
163-
if (description == null)
165+
if (description == null) {
164166
return null;
165-
else
167+
} else {
166168
return description.toString();
169+
}
167170
}
168171

169172
/**

0 commit comments

Comments
 (0)