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

Unable to find class when extending a bean with a declared class as a field

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

    XMLWordPrintable

Details

    • Hide

      try to compile this DRL:

      package com.sample;

      import com.sample.Bean;

      declare Bean
      end

      declare MyDeclaredClass
      myField: java.lang.String
      end

      declare MyExtendedClass extends Bean
      anotherField: MyDeclaredClass;
      end

      being Bean a POJO.

      Show
      try to compile this DRL: package com.sample; import com.sample.Bean; declare Bean end declare MyDeclaredClass myField: java.lang.String end declare MyExtendedClass extends Bean anotherField: MyDeclaredClass; end being Bean a POJO.

    Description

      If you declare a Class in a DRL and try to declare a new Class extending a Bean having your first declared class as an attribute the compiler complains it cannot find the declared class. However if you remove the "extends" keyword the the class is found without problems.

      I attach a testcase to reproduce the bug.

      Attachments

        1. Bean.java
          0.2 kB
        2. DroolsTest.java
          2 kB
        3. Sample.drl
          0.2 kB

        Activity

          People

            mproctor@redhat.com Mark Proctor
            carlossierra Carlos Sierra (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty