Skip to content

Commit

Permalink
Fixed MID-1847 (serialization of SearchFilterType incorrect w.r.t. sc…
Browse files Browse the repository at this point in the history
…hema)
  • Loading branch information
mederly committed Jul 11, 2014
1 parent a5181ec commit 6e351ed
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -74,7 +74,9 @@

@XmlAccessorType(XmlAccessType.NONE) // we select getters/fields to expose via JAXB individually
@XmlType(name = "SearchFilterType", propOrder = { // no prop order, because we serialize this class manually
// BTW, the order is the following: description, filterClause
})

public class SearchFilterType implements Serializable, Cloneable, Equals, HashCode, DebugDumpable, Revivable
{
private final static long serialVersionUID = 201303040000L;
Expand Down Expand Up @@ -235,12 +237,14 @@ public MapXNode serializeToXNode(PrismContext prismContext) throws SchemaExcepti
if (description == null) {
return xmap;
} else {
if (xmap == null) {
xmap = new MapXNode();
}
xmap.put(SearchFilterType.F_DESCRIPTION, new PrimitiveXNode<>(description));
// we have to serialize the map in correct order (see MID-1847): description first, filter clause next
MapXNode newXMap = new MapXNode();
newXMap.put(SearchFilterType.F_DESCRIPTION, new PrimitiveXNode<>(description));
if (xmap != null && !xmap.isEmpty()) {
newXMap.put(xmap.getSingleSubEntry("search filter"));
}
return newXMap;
}
return xmap;
}

@Override
Expand Down

0 comments on commit 6e351ed

Please sign in to comment.