Red Hat Bugzilla – Bug 610107
Search: expressions ending in whitespace are considered invalid
Last modified: 2010-08-12 12:53:03 EDT
In the resource browser or group browser, if you type any valid search expression it will filter the result list. However, if you add any whitespace to the end of it, the parser thinks the last search term is NULL, which bombs during query translation. As a result, the entire search expression is mark as invalid, and no results are filtered at all.
Author: Joseph Marques <email@example.com>
Date: Thu Jul 8 18:56:10 2010 -0400
BZ-610107: ensure search expression for translation into JPQL is whitespace-trimmed and non-null
Testing on build 139 of ci-rhq-release hudson job.
In the search bar I first tried,
which listed my one and only jboss instance in inventory, my rhq server. I then tried,
type="JBossAS Server "
No results were yielded, and I did not see any errors in the log. I then tried,
and it returned a number of results which excluded JBossAS Server. Next I tried,
and I saw the following error message in the server log,
ERROR [org.rhq.enterprise.server.util.CriteriaQueryGenerator] Could not get JPQL translation for 'type=""': org.antlr.runtime.tree.RewriteEmptyStreamException:rule doubleQuotedValue
but results were returned. I repeated the search strings again getting the same results. On the platforms subtab I also tried,
which resulted in the following error in the server log,
ERROR [org.rhq.enterprise.server.util.CriteriaQueryGenerator] Could not get JPQL translation for 'category="platform "': java.lang.IllegalArgumentException:No enum of type 'ResourceCategory' with name matching 'platform '
but my one and only platform in inventory was returned. I then tried
and I got the same result without any error message in the log.
I have verified with Joseph that the error messages in the logs are in fact expected. I have also tested without his fix, and that winds up displaying the error message in the UI as well. Marking this verified.
Mass-closure of verified bugs against JON.