[jboss-jira] [JBoss JIRA] (JBRULES-3610) Adding an l to make an int a long does not run when doing multiplication.
John Lundberg (JIRA)
jira-events at lists.jboss.org
Fri Sep 14 09:55:33 EDT 2012
[ https://issues.jboss.org/browse/JBRULES-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718677#comment-12718677 ]
John Lundberg commented on JBRULES-3610:
----------------------------------------
Here is a sample rule file that i have been having the issue on:
rule "PRO_TEST_PRODUCT"
when
rules : SubscriptionRulesBean( );
then
log.debug("Firing PROU50GB2YR subscription generation rule.");
rules.setDurationCode("YEAR");
rules.setDurationLength(2);
rules.setSingleUse(false);
rules.setPrepay(true);
rules.setMaxPaymentErrorCount(7);
rules.setGraceInMillis((long) (30 * 24 * 60 * 60 * 1000.0));
rules.setContinuationDays(new Integer(14));
rules.setRenewProductReferenceId("PROU50GB2YR");
end
Instead of adding an l to make the setGraceInMillis I had to make it a double and cast as a long.
> Adding an l to make an int a long does not run when doing multiplication.
> -------------------------------------------------------------------------
>
> Key: JBRULES-3610
> URL: https://issues.jboss.org/browse/JBRULES-3610
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core
> Affects Versions: 5.4.0.Final
> Environment: MacBook Air OSX 10.7.4 in Java 1.6
> Reporter: John Lundberg
> Assignee: Mark Proctor
>
> I am trying to do some multiplication in a drool.
> long grace = 30l/*days*/ * 24 * 60 * 60 * 1000;
> But, when it runs I get the error: 'Operator ";" expected' I can however do.
> long grace1 = 30;
> long grace2 = 24;
> long grace3 = 60;
> long grace4 = 1000;
> long grace = grace1 * grace2 * grace3 * grace3 * grace4;
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list