Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6864

Log CompilationProblemErrorResult rather than NPE in case of Declared type compilation error

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • 7.66.0.Final
    • executable model
    • None
    • 2022 Week 11-13 (from Mar 14)
    • NEW
    • NEW

    Description

      This rule fails with compile errors because of missing BigDecimal import. The problem is that it fails with NullPointerException without actual compilation error messages.

          @Test
          public void testDeclaredTypeInsert() {
              String str =
                      "package mypkg;\n" +
                           "import " + Person.class.getCanonicalName() + ";\n" +
                           "declare Tuple\n" +
                           "account: String\n" +
                           "value: BigDecimal\n" +
                           "end\n" +
                           "rule R1 when\n" +
                           "  $s : String(this == \"Start\")\n" +
                           "then\n" +
                           "  insert(new Tuple();\n" +
                           "end\n" +
                           "rule R2 when\n" +
                           "  $t : Tuple()\n" +
                           "then\n" +
                           "end\n";
      

      ModelBuilderImpl.storeGeneratedPojosInPackages() can be improved to log CompilationProblemErrorResult in ModelBuilderImpl.results.

      Attachments

        Activity

          People

            rhn-support-tkobayas Toshiya Kobayashi
            rhn-support-tkobayas Toshiya Kobayashi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: