Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1832

ModeShape CMIS component has bug in JcrService

    Details

      Description

      While trying to use the new ModeShape CMIS gear, we found strange exceptions:

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1

      See longer stack trace below. They appear to come from the following method:

      private String workspace(String repositoryId)

      { return repositoryId.indexOf(":") > 0 ? null : repositoryId.substring(repositoryId.indexOf(":"), repositoryId.length()); }

      It appears that the test there is backwards. It should be a less-than and not a greater-than. The method above it (private String name(String repositoryId)) appears to suffer from the same bug.

      — login: FedoraRepository
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1904)
      at org.modeshape.cmis.JcrService.workspace(JcrService.java:378)
      at org.modeshape.cmis.JcrService.login(JcrService.java:360)
      at org.modeshape.cmis.JcrService.getRepositoryInfos(JcrService.java:103)
      at org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.getRepositoryInfos(CmisServiceWrapper.java:488)
      at org.apache.chemistry.opencmis.server.impl.browser.RepositoryService.getRepositories(RepositoryService.java:65)
      at org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.dispatch(CmisBrowserBindingServlet.java:288)
      at org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.service(CmisBrowserBindingServlet.java:248)
      ...

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                oleg.kulikov Oleg Kulikov
                Reporter:
                ajs6f A Soroka
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: