Bug 748714 - Parser replaces class names in declared fact types
Summary: Parser replaces class names in declared fact types
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: Nobody
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-25 06:21 UTC by Tomas Schlosser
Modified: 2022-08-12 04:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When a class contained a class Person and a DRL fact type somePerson, attempting to use Person in a different package to declare another fact, Person would be replaced with somePerson. This was because PackageBuilder checked for declared names that ended with the same string. This has been resolved and PackageBuilder now checks for equality in declared names.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
Simple reproducer (1.85 KB, application/x-zip-compressed)
2011-10-25 06:21 UTC, Tomas Schlosser
no flags Details

Description Tomas Schlosser 2011-10-25 06:21:52 UTC
Created attachment 530009 [details]
Simple reproducer

Description of problem:
You have a POJO class Person and in DRL fact type SomePerson. If you try to use Person in different package to declare another fact the Parser replaces Person with SomePerson.

Version-Release number of selected component (if applicable):
BRMS-5.3.0-dev4

How reproducible:
Every time

Steps to Reproduce:
1. Run attached example
  
Actual results:
Rule Compilation error : [Rule name='create holder']
	org/jboss/qa/brms/importreplace/Rule_create_holder.java (7:433) : The constructor Holder(Person) is undefined

Expected results:
Finished...

Additional info:
If you put full name of the class, the problem is solved and if you declare facts in same file the problem is gone as well.

Comment 2 Edson Tirelli 2012-02-07 02:34:32 UTC
Bug fixed in branches 5.3.x and master:

https://github.com/droolsjbpm/drools/commit/67e864be305fa5638fbf9b903998ae165b8d5a60

Comment 3 Ryan Zhang 2012-02-15 09:11:49 UTC
Please verify the issue on 5.3 ER4.

Comment 4 Tomas Schlosser 2012-02-22 09:06:24 UTC
Verified.

Comment 6 lcarlon 2012-06-06 02:14:10 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When a class contained a class Person and a DRL fact type somePerson, attempting to use Person in a different package to declare another fact, Person would be replaced with somePerson. This was because PackageBuilder checked for declared names that ended with the same string. This has been resolved and PackageBuilder now checks for equality in declared names.


Note You need to log in before you can comment on or make changes to this bug.