[jboss-jira] [JBoss JIRA] Assigned: (JBRULES-2466) Exception in hash code calculation for character attributes in alpha hashing optimization
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Tue May 17 00:51:01 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-2466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Proctor reassigned JBRULES-2466:
-------------------------------------
Assignee: Mark Proctor (was: Edson Tirelli)
> Exception in hash code calculation for character attributes in alpha hashing optimization
> -----------------------------------------------------------------------------------------
>
> Key: JBRULES-2466
> URL: https://issues.jboss.org/browse/JBRULES-2466
> Project: Drools
> Issue Type: Sub-task
> Security Level: Public(Everyone can see)
> Components: drools-core (expert)
> Affects Versions: 5.1.0.M1
> Reporter: Olexandr Demura
> Assignee: Mark Proctor
> Fix For: 5.2.0.CR1
>
>
> JBRULES-1348 introduces a bug in interaction between CompositeObjectSinkAdapter$HashKey and BaseObjectClassFieldReader
> be following code change
> - } else if ( vtype.isIntegerNumber() ) {
> + } else if ( vtype.isIntegerNumber() || vtype.isChar() ) {
> this.type = LONG;
> if ( !isNull ) {
> this.lvalue = extractor.getLongValue( null, value );
> because BaseObjectClassFieldReader.getLongValue() doesn't handle properties of Character type,
> and RuntimeDroolsException is thrown with message "Conversion to double not supported from java.lang.Character".
> In case BaseObjectClassFieldReader.getLongValue() returns ((Character) value).charValue() instead of throwing exception,
> exception in the following form will be thrown be CompositeObjectSinkAdapter$HashKey
> on equality check if other HashKey gained type OBJECT instead of LONG:
> java.lang.NumberFormatException: For input string: "R"
> at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Long.parseLong(Long.java:403)
> at java.lang.Long.parseLong(Long.java:461)
> at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.getLongValue(CompositeObjectSinkAdapter.java:628)
> at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.equals(CompositeObjectSinkAdapter.java:692)
> at org.drools.util.AbstractHashTable$EqualityEquals.equal(AbstractHashTable.java:446)
> at org.drools.util.ObjectHashMap.get(ObjectHashMap.java:90)
> at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:326)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list