We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using distinct with a collection query, if the first value is null, a NullPointerException is thrown. e.g. for:
public class CollectionQueryDistinctNPE { public static class Example { } @Test public void test() throws Exception { final Example e = alias(Example.class, "example"); final List<Example> examples = Arrays.asList(null, new Example(), null); from($(e), examples).distinct().list($(e)); } }
throws:
java.lang.NullPointerException at com.mysema.query.collections.DefaultQueryEngine.distinct(DefaultQueryEngine.java:97) at com.mysema.query.collections.DefaultQueryEngine.evaluateSingleSource(DefaultQueryEngine.java:203) at com.mysema.query.collections.DefaultQueryEngine.list(DefaultQueryEngine.java:89) at com.mysema.query.collections.AbstractCollQuery.list(AbstractCollQuery.java:203)
A suggested fix would be to add a null check at DefaultQueryEngine:97 :
if (!list.isEmpty() && list.get(0) != null && list.get(0).getClass().isArray()) {
The text was updated successfully, but these errors were encountered:
#466 Fix distinct handling
01980be
Released in 3.2.3
Sorry, something went wrong.
No branches or pull requests
When using distinct with a collection query, if the first value is null, a NullPointerException is thrown.
e.g. for:
throws:
A suggested fix would be to add a null check at DefaultQueryEngine:97 :
The text was updated successfully, but these errors were encountered: