Details
-
Bug
-
Resolution: Fixed
-
Medium
-
2.5.1
-
None
-
None
Description
Exception from FSH-5283:
08:37:31 ERROR - org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: query [select review from com.cenqua.crucible.model.Review review join review.project proj where () and ( (lower(review.name) like '%trm-34944%' or lower(review.description) like '%trm-34944%' or lower(proj.projKey) like '%trm-34944%' )) and review.stateName <> 'Dead' order by review.id desc] Feb 21, 2011 8:37:31 AM com.sun.jersey.server.impl.application.WebApplicationImpl onException SEVERE: Internal server error java.lang.NullPointerException at java.util.LinkedList.addAll(Unknown Source) at java.util.LinkedList.addAll(Unknown Source) at java.util.LinkedList.<init>(Unknown Source) at com.atlassian.crucible.spi.impl.DefaultSearchService.searchForReviews(DefaultSearchService.java:37)
This is because of two problems:
- the HQL query is malformed because of the empty parenthesis in the where clause ("where ()"):
select review from com.cenqua.crucible.model.Review review join review.project proj where () and ( (lower(review.name) like '%trm-34944%' or lower(review.description) like '%trm-34944%' or lower(proj.projKey) like '%trm-34944%' )) and review.stateName <> 'Dead' order by review.id desc
- any exception causes DefaultReviewManager#searchReviewForTerms() to return a null instead of an empty collection (regression created in
CRUC-3617)