[jboss-jira] [JBoss JIRA] (DROOLS-1215) import function(s) with collision on declared Pojo field names odd behavior and no warning

Matteo Mortari (JIRA) issues at jboss.org
Tue Jun 21 09:18:00 EDT 2016


Matteo Mortari created DROOLS-1215:
--------------------------------------

             Summary: import function(s) with collision on declared Pojo field names odd behavior and no warning
                 Key: DROOLS-1215
                 URL: https://issues.jboss.org/browse/DROOLS-1215
             Project: Drools
          Issue Type: Bug
          Components: core engine
    Affects Versions: 6.4.0.Final
            Reporter: Matteo Mortari
            Assignee: Mario Fusco


Hello,
not sure (yet) what is causing this odd behavior, but considering the following rule-base in the attached reproducer, evolved from the usual kie example archetype:
{code}
global java.util.Set controlSet;

rule "will execute per each Measurement having ID color"
no-loop
when
	WantToKeep( condition == "color" )
	Measurement( id == "color", $colorVal : val )
then
	controlSet.add($colorVal);
end

declare WantToKeep
	condition : String
end

rule "kickstart"
salience 999
when
	eval( true ) 
then
	insert(new WantToKeep( "color" ));
end
{code}

This works as expected until adding the following import statement:
{code}
import function org.jooq.impl.DSL.*;
{code}

and then the test will fail.

I suspect because some "functions"/static method exists on {{org.jooq.impl.DSL}} with name "condition" which is colliding with the declared Pojo field name "condition", but I can't understand why this supposed collision happens as in the LHS I'm looking for the field not a method invocation with the {{condition()}} form.

I'm willing to investigate more on this later, for the time being I thought worthy at least to raise this JIRA record for tracking.

I will attach reproducer and workaround in the appropriate sections.

Thank you,
Ciao,
MM



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list