[jboss-jira] [JBoss JIRA] (DROOLS-439) Package builder unable to find declared array class
RH Bugzilla Integration (JIRA)
issues at jboss.org
Tue Apr 15 07:54:36 EDT 2014
[ https://issues.jboss.org/browse/DROOLS-439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12961969#comment-12961969 ]
RH Bugzilla Integration commented on DROOLS-439:
------------------------------------------------
Ryan Zhang <rzhang at redhat.com> changed the Status of [bug 1079950|https://bugzilla.redhat.com/show_bug.cgi?id=1079950] from MODIFIED to ON_QA
> Package builder unable to find declared array class
> ---------------------------------------------------
>
> Key: DROOLS-439
> URL: https://issues.jboss.org/browse/DROOLS-439
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.1.Final
> Reporter: Mark Sullivan
> Assignee: Mario Fusco
>
> When declaring a fact type with an array field, where the array type is declared in the same package, for example:
> {code}
> declare Owner
> name : String
> end
> declare Pet
> owners : Owner[]
> end
> {code}
> The following build error occurs:
> {code}
> [Message [id=1, level=ERROR, path=pets.drl, line=5, column=0
> text=Unable to find class 'Owner']]
> {code}
> This error doesn't always occur when an array field is declared. It's dependent on the order in which each fact type is processed.
> PackageBuilder attempts to order fact types for processing based on the declared super type and attribute types.
> The following loop in *PackageBuilder.sortByHierarchy()* processes each field looking for field type dependencies:
> {code}
> for (TypeFieldDescr field : tdescr.getFields().values()) {
> QualifiedName typeName = new QualifiedName(field.getPattern().getObjectType());
> if (!hasCircularDependency(name, typeName, taxonomy)) {
> supers.add(typeName);
> }
> }
> {code}
> However I don't think it correctly spots the dependency when the field type is an array.
> This issue can be worked around by declaring an unused field of the same type as the array:
> {code}
> declare Owner
> name : String
> end
> declare Pet
> owners : Owner[]
> _unused: Owner
> end
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list