[jboss-jira] [JBoss JIRA] Created: (JBRULES-2840) Package compilation should present an error or warning when a file inside a directory does not declare itself to be in the same package as the other resources in that directory

Alessandro Lazarotti (JIRA) jira-events at lists.jboss.org
Mon Dec 20 11:20:17 EST 2010


Package compilation should present an error or warning when a file inside a directory does not declare itself to be in the same package as the other resources in that directory
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: JBRULES-2840
                 URL: https://issues.jboss.org/browse/JBRULES-2840
             Project: Drools
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: drools-ant, drools-api
    Affects Versions: 5.1.0.FINAL
         Environment: Fedora 12, jdk 1.6
            Reporter: Alessandro Lazarotti
            Assignee: Mark Proctor


This is a request for an error/warning mechanism in the compiler task. This case presents itself when a person defines a package and makes a unintentional mistake by not defining all the files which are intended to be in the package to be part of the package. If familiarity with drools is low this issue can cause a lot of frustration from not being able to find the issue.

If a package is composed of more than one rules source file (i.e a drl + xls + rf) there is an unreported error where the files do not all declare themselves to be of the same package. The compiler will only build the package to include some of the files. 

Given 3 files in the same directory to be compiled using the drools-ant task

org.drools.contrib.DroolsCompilerAntTask

process.rf [package rsarules.quote]
start-process.drl [package rssrules.quote]
quote.xls [package rsarules.quote]

using

<target name="buildPackage" >
<compiler srcdir="${basedir}/src/test/resources/rules"
tofile="${basedir}/src/test/resources/rsa.rules.pkg"
classpathref="rsa.classpath"
binformat="package" >
<include name="*.xls"/>
<include name="*.drl"/>
<include name="*.rf"/>
</compiler>
</target>

In the above example if start-process.drl was read first the resultant package would only contain the start-process.drl rule. If on the other hand the compiler was to read any of the other two files first the package created would not contain start-process.drl. In both cases the resultant rules application would not function as was intended. This is clearly an error but the compiler should flag this.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list