Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-1915

PatientService.getPatients(String, int, Integer) should accept a null second parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: OpenMRS 1.8.0
    • Fix Version/s: OpenMRS 1.8.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low
    • Development:

      Description

      EncounterService and LocationService have methods like getXyzs(String query, Integer start, Integer length). For some reason the equivalent PatientService.getPatients method uses an int as the 'start' parameter, so it doesn't accept nulls.

      I came across this while trying to use the Logic module's query tester. Stack trace below.

      I intend to fix this by changing the method signature to take an Integer parameter, and ensuring that the service method correctly handles null.

      java.lang.NullPointerException
      	at org.openmrs.web.dwr.DWRPatientService.findBatchOfPatients(DWRPatientService.java:116)
      	at org.openmrs.web.dwr.DWRPatientService.findPatients(DWRPatientService.java:87)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
      	at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
      	at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
      	at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
      	at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
      	at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
      	at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              darius Darius Jazayeri
              Reporter:
              darius Darius Jazayeri
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: