Dirk,
Can you please open a JIRA for me? It would be great if you can
attach a self contained example of the problem. I will look into it and fix.
Thank you
Edson
Dirk Bergstrom wrote:
I'm using trunk (revision 10170), and I'm getting an exception
when trying to
read errors after calling PackageBuilder.addPackageFromDrl(String, Reader). The
getErrors() method spits out this exception:
java.lang.ArrayStoreException
at java.lang.System.arraycopy(Native Method)
at java.util.ArrayList.toArray(ArrayList.java:304)
at org.drools.compiler.PackageBuilder.getErrors(PackageBuilder.java:380)
(The docs for toArray say that exception is thrown if one of the members of the
List is the wrong class for the supplied array.)
If I instead call printErrors, I get something more useful:
java.lang.ClassCastException: org.drools.lang.ExpanderException
at org.drools.compiler.PackageBuilder.printErrors(PackageBuilder.java:390)
It looks like someone is putting the wrong kind of exception in the error list.
This may be related to some bugs in DSL handling. I had to comment out all the
blank lines in my DSL file to get it to suppress some other errors, and if I
switch to PackageBuilder.addPackageFromDrl(String), the problem goes away.
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @
www.jboss.com