Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1582

NullPointerException in queryDataNodesAcrossAnchors

XMLWordPrintable

      The implementation of org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl#queryDataNodesAcrossAnchors is broken, throwing NullPointerException when called in some cases:

      def result = objectUnderTest.queryDataNodesAcrossAnchors('cpsPerformanceDataspace', '/bookstore', INCLUDE_ALL_DESCENDANTS)

      This exception gets thrown:

      java.lang.NullPointerException
          at org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl.toDataNode(CpsDataPersistenceServiceImpl.java:461)
          at org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl.createDataNodesFromFragmentEntities(CpsDataPersistenceServiceImpl.java:404)
          at org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl.getDataNodesUsingRegexQuickFind(CpsDataPersistenceServiceImpl.java:369)
          at org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl.queryDataNodes(CpsDataPersistenceServiceImpl.java:330)
          at org.onap.cps.spi.impl.CpsDataPersistenceServiceImpl.queryDataNodesAcrossAnchors(CpsDataPersistenceServiceImpl.java:345)
          at org.onap.cps.api.impl.CpsQueryServiceImpl.queryDataNodesAcrossAnchors(CpsQueryServiceImpl.java:54)
          at org.onap.cps.integration.performance.cps.QueryPerfTest.Query complete data trees across all anchors with #scenario.(QueryPerfTest.groovy:55)
      

      To be more specific, it succeeds with complex queries, e.g. with leaf-conditions like:
      '//openroadm-device[@status="success"]'
      But it throws NullPointerException with simple queries, like:
      '/openroadm-devices'
      (It fails specifically when the optimized code "getDataNodesUsingRegexQuickFind" is called.)

            rajesh.kumar Rajesh kumar
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: