Thread:
 NullPointerException with nullSafeGet 
 ashlux   07 Jul 2008, 15:38 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: ashlux (07 Jul 2008, 15:38) Replies: 0, Views: 404
Subject: NullPointerException with nullSafeGet
The method nullSafeGet appears to not be null-safe since
JGeometry.load(null) throws an Exception.  I think resultSet.wasNull()
should be checked sooner, like this:

    public Object nullSafeGet( ResultSet resultSet, String[] strings,
Object o) throws HibernateException, SQLException {
      STRUCT geometry = (STRUCT) resultSet.getObject( strings[0]);
      if (resultSet.wasNull()) { return null; }
      JGeometry jg = JGeometry.load( geometry);
      return new JGeometryType( jg);
    }

-Ash
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]