Skip to content

Commit

Permalink
Need to revert the usage of streams, as EclipseLink 2.5 is broken.
Browse files Browse the repository at this point in the history
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=429992

As we are stuck on Glassfish 4.1 for now (see IQSS#4172, IQSS#4248 and IQSS#4260),
we cannot simply upgrade. Meh.

This reverts commit c80aeea.
  • Loading branch information
poikilotherm committed Aug 1, 2019
1 parent c80aeea commit b0d9c66
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/edu/harvard/iq/dataverse/DatasetField.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
Expand Down Expand Up @@ -209,11 +208,13 @@ public void setControlledVocabularyValues(List<ControlledVocabularyValue> contro
* @return List of matching vocabulary items (containing the query string in their l18n string)
*/
public Collection<ControlledVocabularyValue> completeVocabulary(String query) {
String q = query.toLowerCase();
return this.getDatasetFieldType().getControlledVocabularyValues()
.stream()
.filter(cvv -> cvv.getLocaleStrValue().toLowerCase().contains(q))
.collect(Collectors.toList());
Collection<ControlledVocabularyValue> filtered = new ArrayList<>();
for (ControlledVocabularyValue item : this.getDatasetFieldType().getControlledVocabularyValues()) {
if (item.getLocaleStrValue().toLowerCase().contains(query.toLowerCase())) {
filtered.add(item);
}
}
return filtered;
}

/**
Expand Down

0 comments on commit b0d9c66

Please sign in to comment.