Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3057

Misleading error message for missing constructor

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      If an undeclared constructor is called in a consequence, a very strange error message is produced:

      • error text is "Failed to compileShared" ("Shared" is not used by the app)
      • The message part meant ot identify the location of the error is misleanding, e.g.,
        Near : {... p3.setName( "Paul" ); ....}

        with the marker ("^") pointing to "Paul".

      public static class Person {
      private String name;

      public Person(String name)

      { this.name = name; }

      public String getField1() { return field1; }

      public void setName( String name ) { this.name = name; }

      public String getName()

      { return name; }

      }

      @Test
      public void testExistsIterativeModifyBug()

      { String str = ""; str += "package org.simple "; str += "import Person "; str += "rule xxx "; str += "when "; str += "then "; str += " Person = new Person() "; str += "end "; KnowledgeBase kbase = loadKnowledgeBaseFromString( str ); assertFalse( kBuilder.hasErrors() ); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); ksession.fireAllRules(); ksession.dispose(); }

            etirelli@redhat.com Edson Tirelli
            laune Wolfgang Laun (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Archived: