[
http://jira.jboss.com/jira/browse/JBRULES-537?page=all ]
Mark Proctor closed JBRULES-537.
--------------------------------
Fix Version/s: 3.1-m1
Resolution: Done
BigDecimalFactory and BigIntegerFactory don't compile with java
1.5 source
--------------------------------------------------------------------------
Key: JBRULES-537
URL:
http://jira.jboss.com/jira/browse/JBRULES-537
Project: JBoss Rules
Issue Type: Task
Security Level: Public(Everyone can see)
Components: All
Affects Versions: 3.1-m1
Reporter: Geoffrey De Smet
Assigned To: Mark Proctor
Priority: Minor
Fix For: 3.1-m1
Original Estimate: 10 minutes
Remaining Estimate: 10 minutes
jbossrules\drools-core\src\main\java\org\drools\base\evaluators\BigIntegerFactory.java
and BigIntegerFactory.java
won't compile in 1.5 source because BigDecimal isn't a 100% backwards compatible
from java 1.5 to 1.4,
due to them generifying it.
The fix is easy: just add some casts, the JVM does this at runtime anyway.
For example:
final BigDecimal comp = (BigDecimal) extractor.getValue( object1 );
return comp.compareTo( object2.getValue() ) < 0;
This code turns red in java source=1.5 in IntelliJ IDEA (and in Eclipse I would expect
the same?)
Turn it into:
...
return comp.compareTo( (BigDecimal) object2.getValue() ) < 0;
I didn't create a patch as it's fast to fix: just copy-paste (BigDecimal) in the
2 classes's use of the compareTo method.
--
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