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

Declarative types: Extending requires explicit import statement

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 5.2.0.Final
    • None

    Description

      Given Person class:-

      package com.guvnor.domain;
      
      import java.math.BigDecimal;
      
      public class Person {
      
          private BigDecimal salary;
      
          public BigDecimal getSalary() {
              return salary;
          }
      
          public void setSalary(BigDecimal salary) {
              this.salary = salary;
          }
      
      }
      

      The following compiles OK:-

      package com.sample
       
      import com.guvnor.domain.Person
      
      declare Person
      end
      

      However the following does not (without explicitly importing java.math.BigDecimal - which is a field type in Person):-

      package com.sample
       
      import com.guvnor.domain.Person
      import com.guvnor.domain.Address
      
      declare Person
      end
      
      declare Person2 extends Person
          flange : String
      end
      

      Error being "Unknown DroolsError class org.drools.compiler.TypeDeclarationError: Unable to find class 'BigDecimal' ".

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            manstis@redhat.com Michael Anstis
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty