The parameter is declared as follows,
@Persistent private Set<ScopeType> scope = new LinkedHashSet<ScopeType>();
While fetching with High-level datastore fetch, it responds with LinkedHashSet, but on Low-level fetch the response is a HashSet, Is this something expected?
That looks reasonable. The type of
scopeisSet, notLinkedHashSetnorHashSet. Those are implementation types. Any user ofscopeis only guaranteed that the declared type is satisfied, not that a particular implementation is in use.If the order-preserving feature of
LinkedHashSetmust be maintained, thenscopemust be declared asLinkedHashSet.Using a concrete type as a declared type breaks most style rules, but is in this case unavoidable. There is no interface similar to
Setwhich is available to be used. That is a consequence of limitations of java's typing.