diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyStatementDaoFiltering.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyStatementDaoFiltering.java index c11a36d4c..a7f9868dd 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyStatementDaoFiltering.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/DataPropertyStatementDaoFiltering.java @@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.filtering; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -14,8 +14,6 @@ import edu.cornell.mannlib.vitro.webapp.beans.DataProperty; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatementImpl; import edu.cornell.mannlib.vitro.webapp.beans.Individual; -import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement; -import edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatementImpl; import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao; import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilters; @@ -111,10 +109,10 @@ class DataPropertyStatementDaoFiltering extends BaseFiltering implements DataPro * * Filtering is applied to a list of DataPropertyStatement. Create these statements, mapped * to the literal that they are built from, apply filtering to the statements, then get - * the associated literals out of the original list. + * the associated literals out of the original list. Use a LinkedHashMap to preserve the ordering. */ Map stmtsToLiterals = - new HashMap(literals.size()); + new LinkedHashMap(literals.size()); for (Literal literal : literals) { String value = literal.getLexicalForm(); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyStatementDaoFiltering.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyStatementDaoFiltering.java index a4ab893d1..3e83c2d9e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyStatementDaoFiltering.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/filtering/ObjectPropertyStatementDaoFiltering.java @@ -3,8 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.dao.filtering; import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -102,10 +101,10 @@ class ObjectPropertyStatementDaoFiltering extends BaseFiltering implements Objec * * Filtering is applied to a list of ObjectPropertyStatements. Create these statements, mapped * to the item in data that they are built from, apply filtering to the statements, then get - * the associated data out of the original list. + * the associated data out of the original list. Use a LinkedHashMap to preserve the ordering. */ Map> stmtsToData = - new HashMap>(data.size()); + new LinkedHashMap>(data.size()); for (Map map : data) { String objectUri = map.get(objectKey);