Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-5641

NullPointerException in REST search reviews for terms (because of an invalid HQL query)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.5.2
    • 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)

      Attachments

        Activity

          People

            abuttfield Anna Buttfield [Atlassian]
            pepoirot Pierre-Etienne Poirot (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: