Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dmn engine
    • Labels:
      None
    • Sprint:
      2018 Week 33-35
    • Story Points:
      1
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Given

              final DMNModel dmnModel = runtime.getModel("<wrong>", "<wrong>");
              // please notice an end-user of the API might not having checked the result of the previous call is not a null.
              DMNContext emptyContext = DMNFactory.newContext();
              DMNResult dmnResult = runtime.evaluateAll(dmnModel, emptyContext);
      

      This would fail with:

      java.lang.NullPointerException
      	at org.kie.dmn.core.impl.DMNRuntimeImpl.performRuntimeTypeCheck(DMNRuntimeImpl.java:622)
      	at org.kie.dmn.core.impl.DMNRuntimeImpl.evaluateAll(DMNRuntimeImpl.java:118)
      	at org.kie.dmn.core.DMNRuntimeTypeCheckTest.testMisleadingNPEbyAPIusage(DMNRuntimeTypeCheckTest.java:199)
      ...
      

      which is not very helpful for the end-user of API to understand he inadvertently passed a null model to the DMNRuntime.evaluateAll method.

      With the proposed change:

      java.lang.NullPointerException: Kie DMN API parameter 'model' cannot be null.
        at java.util.Objects.requireNonNull(Objects.java:290)
        at org.kie.dmn.core.impl.DMNRuntimeImpl.evaluateAll(DMNRuntimeImpl.java:123)
        at org.kie.dmn.core.DMNRuntimeTypeCheckTest.testMisleadingNPEbyAPIusage(DMNRuntimeTypeCheckTest.java:199)
      ...
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tari_manga Matteo Mortari
                Reporter:
                tari_manga Matteo Mortari
                Tester:
                Tibor Zimanyi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: