[jboss-jira] [JBoss JIRA] Commented: (JBRULES-575) Shadow facts break when a fact Class has 2 properties (with a different name) of the same fact class

Geoffrey De Smet (JIRA) jira-events at jboss.com
Sun Dec 3 11:15:56 EST 2006


    [ http://jira.jboss.com/jira/browse/JBRULES-575?page=comments#action_12348105 ] 
            
Geoffrey De Smet commented on JBRULES-575:
------------------------------------------


Hmmmm, my integration test also worked:

    public void testShadowFactWith2PropertiesOfTheSameClass() throws Exception {
        // pre build the package
        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream(
                "test_ShadowFactWith2PropertiesOfTheSameClass.drl" ) ) );
        final Package pkg = builder.getPackage();

        // add the package to a rulebase
        final RuleBase ruleBase = getRuleBase();
        ruleBase.addPackage( pkg );

        final WorkingMemory workingMemory = ruleBase.newWorkingMemory();

        final List list = new ArrayList();
        workingMemory.setGlobal( "list",
                                 list );

        final Cheese stilton = new Cheese( "stilton", 5 );
        workingMemory.assertObject( stilton );
        final Cheese gouda = new Cheese( "gouda", 7 );
        workingMemory.assertObject( gouda );
        final CheeseCouple cheeseCouple = new CheeseCouple(stilton, gouda);
        workingMemory.assertObject( cheeseCouple );

        workingMemory.fireAllRules();

        assertEquals( new Integer( 7 ),
                      list.get( 0 ) );

    }

However, in Taseree, with the same trunk revision (current head) it still breaks...
I don't understand it.


To try yourself:
- do a "mvn install" on the drools trunk
- check taseree from https://svn.sourceforge.net/svnroot/taseree/trunk
- adjust /pom.xml so the drools dependencies (3.0.2 or 3.1.0-SNAPSHOT dependening if my pom.xml patch is applied on the drools trunk),
- mvn eclipse:eclipse idea:idea
- Run net.sf.taseree.samples.travelingtournament.app.TravelingTournamentApp (LessonScheduleApp currently doesn't work)


> Shadow facts break when a fact Class has 2 properties (with a different name) of the same fact class
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-575
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-575
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.1-m1
>            Reporter: Geoffrey De Smet
>         Assigned To: Mark Proctor
>            Priority: Critical
>
> See user mailing list: [trunk] Repetitive field name/signature in class
> ava.lang.ClassFormatError: Repetitive field name/signature in class file net/sf/taseree/samples/travelingtournament/domain/MatchShadowProxy
> Here's my Match class:
> public class Match extends AbstractPersistable implements Comparable<Match>, Solution {
>     private Team homeTeam;
>     private Team awayTeam;
>     private Day day;
>     // getters, setters, clone(), toString()
> }
> AbstractPersistable has a Long id with getters/setters
> I will make a testcase with Cheese and provide a testcase patch, but it seems the trunk's pom's don't do "mvn idea:idea" properly, like the branch did,
> so I 'll provide a pom.xml patch first :)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list