[JBoss JIRA] (DROOLS-388) Inconsistent behavior of "contains" operator
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/DROOLS-388?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on DROOLS-388:
------------------------------------------------
Rajesh Rajasekaran <rrajasek(a)redhat.com> changed the Status of [bug 1060033|https://bugzilla.redhat.com/show_bug.cgi?id=1060033] from VERIFIED to CLOSED
> Inconsistent behavior of "contains" operator
> --------------------------------------------
>
> Key: DROOLS-388
> URL: https://issues.jboss.org/browse/DROOLS-388
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.1.Final, 6.0.0.Final
> Reporter: Davide Sottara
> Assignee: Mario Fusco
> Priority: Minor
> Fix For: 6.1.0.Beta1
>
>
> The compiler accepts constraints such as
> {code}
> Person( fullName contains 'Jr' ) // should be fullName.contains('Jr')
> {code}
> Interestingly, MVEL evaluates it as the string operation "contains", but
> once the constraint is jitted it is again evaluated as a collection operator.
> That is, a rule such as:
> {code}
> when
> $s : String( this contains "foo" )
> then
> {code}
> with inputs "foo1" .. "fooN" effectively fires an unpredictable number of times before starting to fail silently
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 3 months
[JBoss JIRA] (DROOLS-364) ClasspathKieProject fails vfs: path for jar deployments and exploded ear
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/DROOLS-364?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on DROOLS-364:
------------------------------------------------
Rajesh Rajasekaran <rrajasek(a)redhat.com> changed the Status of [bug 1058254|https://bugzilla.redhat.com/show_bug.cgi?id=1058254] from VERIFIED to CLOSED
> ClasspathKieProject fails vfs: path for jar deployments and exploded ear
> ------------------------------------------------------------------------
>
> Key: DROOLS-364
> URL: https://issues.jboss.org/browse/DROOLS-364
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 6.0.0.Final
> Environment: JBoss AS 7.1.1
> Reporter: Nicolas-Xavier Vanderlinden
> Assignee: Mario Fusco
> Fix For: 6.1.0.Beta1
>
> Attachments: jbossas-deploy-reproducer.zip, windows-jboss-as-deploy-server.log
>
>
> Drools is not able to load kmodule.xml from an exploded ear.
> 17:24:45,116 WARN Unable to load pom.properties tried recursing down from\Project\Geline\jboss-as-7.1.1.Final\standalone\deployments\geline.ear\service-impl-1.4.0-SNAPcontent
> null
> 17:24:45,116 ERROR Unable to build index of kmodule.xml url=vfs:/E:/Project/Geline/jboss-as-7.1.1.Final/standalone/deployments/geline.ear/service-impl-1.4.0-SNAPSHOT.jar/META-INF/kmodule.xml
> null
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 3 months
[JBoss JIRA] (DROOLS-410) Drools invokes superclass static method
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/DROOLS-410?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on DROOLS-410:
------------------------------------------------
Rajesh Rajasekaran <rrajasek(a)redhat.com> changed the Status of [bug 1057550|https://bugzilla.redhat.com/show_bug.cgi?id=1057550] from VERIFIED to CLOSED
> Drools invokes superclass static method
> ---------------------------------------
>
> Key: DROOLS-410
> URL: https://issues.jboss.org/browse/DROOLS-410
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: Michaël Mathieu
> Assignee: Mario Fusco
> Fix For: 6.1.0.Beta1
>
>
> For a very simple rule, with same parameter, the result is sometimes different.
> Drools invokes superclass static method.
> {code}
> package test;
> public class ARef {
> private String ref;
> protected ARef(String ref) {
> this.ref = ref;
> }
> public static ARef valueOf(String ref) {
> System.out.println("ARef> " + ref);
> return new ARef(ref);
> }
> @Override
> public String toString() {
> return ref;
> }
> @Override
> public int hashCode() {
> final int prime = 31;
> int result = 1;
> result = prime * result + ((ref == null) ? 0 : ref.hashCode());
> return result;
> }
> @Override
> public boolean equals(Object obj) {
> if (this == obj) return true;
> if (obj == null) return false;
> if (getClass() != obj.getClass()) return false;
> ARef other = (ARef) obj;
> if (ref == null) {
> if (other.ref != null) return false;
> } else if (!ref.equals(other.ref)) return false;
> return true;
> }
> }
> {code}
> {code}
> package test;
> public class BRef extends ARef {
> private BRef(String ref) {
> super(ref);
> }
> public static BRef valueOf(String ref) {
> System.out.println("BRef> " + ref);
> return new BRef(ref);
> }
> }
> {code}
> {code}
> package test;
> public class Criteria {
> private BRef ref;
> private boolean ok = false;
> public Criteria(BRef ref) {
> this.ref = ref;
> }
> public BRef getRef() {
> return ref;
> }
> public boolean isOk() {
> return ok;
> }
> public void setOk() {
> this.ok = true;
> }
> }
> {code}
> {code}
> package test;
> import java.io.StringReader;
> import org.drools.RuleBase;
> import org.drools.RuleBaseFactory;
> import org.drools.StatelessSession;
> import org.drools.compiler.PackageBuilder;
> import org.drools.rule.Package;
> public class Test {
> private static final String DRL = "package test\r\n" + "dialect \"mvel\"\r\n" + "import test.*;\r\n" + "rule \"myRule\"\r\n" + "when\r\n"
> + " criteria:Criteria(ref == BRef.valueOf(\"toto\"))\r\n" + "then\r\n" + " criteria.setOk();\r\n" + "end";
> public static void main(String[] args) {
> System.out.println(DRL);
> try {
> PackageBuilder builder = new PackageBuilder();
> builder.addPackageFromDrl(new StringReader(DRL));
> Package pkg = builder.getPackage();
> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> ruleBase.addPackage(pkg);
> for (int i = 0; i < 1000; i++) {
> Criteria criteria = new Criteria(BRef.valueOf("toto"));
> StatelessSession session = ruleBase.newStatelessSession();
> session.execute(criteria);
> System.out.println("[" + i + "] " + criteria.isOk());
> }
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> {code}
> Output:
> {code}
> package test
> dialect "mvel"
> import test.*;
> rule "myRule"
> when
> criteria:Criteria(ref == BRef.valueOf("toto"))
> then
> criteria.setOk();
> end
> BRef> toto
> BRef> toto
> BRef> toto
> [0] true
> BRef> toto
> BRef> toto
> [1] true
> BRef> toto
> BRef> toto
> [2] true
> ...
> BRef> toto
> ARef> toto
> [109] false
> BRef> toto
> ARef> toto
> [110] false
> ...
> BRef> toto
> ARef> toto
> [998] false
> BRef> toto
> ARef> toto
> [999] false
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 3 months