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

Naming a Java Class the Same as a Package Causes Compile Errors

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 5.1.0.FINAL
    • drools-compiler
    • None
    • Hide

      1) Create a rule file under the package service.offer that imports the package service.* and service.offer.*

      2) Create a java class under the service package called Offer.java.

      The following error occurs while attempting to add the rule file to the knowledge base :

      /service/offer/Rule_MyTestRule_0.java (2:153) : The import service.offer cannot be resolved

      Renaming the Offer class to something else seems to resolve the issue.

      Show
      1) Create a rule file under the package service.offer that imports the package service.* and service.offer.* 2) Create a java class under the service package called Offer.java. The following error occurs while attempting to add the rule file to the knowledge base : /service/offer/Rule_MyTestRule_0.java (2:153) : The import service.offer cannot be resolved Renaming the Offer class to something else seems to resolve the issue.

    Description

      Creating a class with the same name as a package which is imported in a drools rule file causes compilation errors.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            m.fowler Matt Fowler (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty