Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-774

Infinite recursive loop because method calls itself instead of delegate

    XMLWordPrintable

    Details

      Description

      SpotBugs spotted a bug in class org.openmrs.module.webservices.rest.OpenmrsPathMatcher

      Bug : There is an apparent infinite recursive loop in org.openmrs.module.webservices.rest.OpenmrsPathMatcher.matchStart(String, String)

      This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow.

      Rank : Scary (9), confidence : High *Pattern : IL_INFINITE_RECURSIVE_LOOP * Type : IL, Category : CORRECTNESS (Correctness)

       

      The method

      {{}}

      public boolean matchStart(String pattern, String path) {

      {{   return this.matchStart(pattern, path);}}

      {{ }}}

      should be

      public boolean matchStart(String pattern, String path) {

      {{   return this.}}delegate{{.matchStart(pattern, path); }}

      {{ }}}

      {{ }}

       Sorry, I can't figure out which component to choose but the class lives in

      <artifactId>webservices.rest-omod-common</artifactId>
       <packaging>jar</packaging>
       <name>Rest Web Services Common OMOD</name>
       <description>OpenMRS module project for Rest Web Services</description>

      The parent is

      <parent>
       <groupId>org.openmrs.module</groupId>
       <artifactId>webservices.rest</artifactId>
       <version>2.26.0-SNAPSHOT</version>
       </parent>

       

      {{ }}

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              herbert24 Herbert Yiga
              Reporter:
              farndt Franziska Arndt
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: