Bug 748714

Summary: Parser replaces class names in declared fact types
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Tomas Schlosser <tschloss>
Component: BRE (Expert, Fusion)Assignee: Nobody <nobody>
Status: VERIFIED --- QA Contact: Lukáš Petrovický <lpetrovi>
Severity: low Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: lpetrovi, mproctor
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Simple reproducer none

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.