openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1158) Incorrect handling of long values in AbstractResult
Date Fri, 03 Jul 2009 20:18:47 GMT
Incorrect handling of long values in AbstractResult
---------------------------------------------------

                 Key: OPENJPA-1158
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1158
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 2.0.0
            Reporter: Craig Russell
            Assignee: Craig Russell
            Priority: Minor


This code is in org.apache.openjpa.jdbc.sql.AbstractResult.

   public long getLong(Object obj)
       throws SQLException {
       return getLongInternal(translate(obj, null), null);
   }

   public long getLong(Column col, Joins joins)
       throws SQLException {
       return getLongInternal(translate(col, joins), joins);
   }

   protected long getLongInternal(Object obj, Joins joins)
       throws SQLException {
       Number val = (Number) checkNull(getObjectInternal(obj,
           JavaTypes.INT, null, joins));
       return (val == null) ? 0 : val.intValue();
   }

It seems like it's an obvious bug; using intValue and JavaTypes.INT in getLongInternal should
use longValue and JavaTypes.LONG.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message