Opened 13 years ago

Closed 13 years ago

#1207 closed defect (fixed)

Using empty filters (= or <>) on an annotation column with units results in NullPointerException

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: critical Milestone: BASE 2.9.1
Component: core Version: 2.9
Keywords: Cc:

Description

  1. Create an annotation type for any kind of item. Select any unit and quantity.
  2. Go to the list page and display the column for the new annotation type.
  3. Try to filter with '=' or '<>' on the annotation column.

NullPointerException:null is displayed on the page and no results are returned. The log contains the stack trace:

19:29:42,404  WARN Application:1077 - Could not filter on 'Sample.#6'
java.lang.NullPointerException
        at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
        at java.util.regex.Matcher.reset(Matcher.java:291)
        at java.util.regex.Matcher.<init>(Matcher.java:211)
        at java.util.regex.Pattern.matcher(Pattern.java:888)
        at net.sf.basedb.util.units.UnitUtil.splitValueWithUnit(UnitUtil.java:87)
        at net.sf.basedb.core.PropertyFilter.getValueAsObject(PropertyFilter.java:262)
        at net.sf.basedb.core.PropertyFilter.getRestriction(PropertyFilter.java:492)
        at net.sf.basedb.core.ItemContext.configureQuery(ItemContext.java:1058)
        at net.sf.basedb.clients.web.Base.getConfiguredQuery(Base.java:939)
        at org.apache.jsp.biomaterials.samples.list_005fsamples_jsp._jspService(list_005fsamples_jsp.java:252)

Filtering on specific values seems to work.

Change History (2)

comment:1 Changed 13 years ago by Nicklas Nordborg

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 Changed 13 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [4692]) Fixes #1207: Using empty filters (= or <>) on an annotation column with units results in NullPointerException?

Note: See TracTickets for help on using tickets.