From: Gavin K. <ga...@ap...> - 2002-10-25 11:46:16
|
Wow, what an absolutely ancient bug!! Its in the very first CVS revision. Easy to see how it could slip through, though. I doubt many people have properties of type java.lang.Character.... You get some kind of prize for that. ----- Original Message ----- From: "Max Rydahl Andersen" <ma...@eo...> To: <hib...@li...> Sent: Friday, October 25, 2002 7:17 PM Subject: [Hibernate] Bug in CharacterType... > Hi! > > The following code is found in CharacterType: > public Object get(ResultSet rs, String name) throws SQLException { > > return new Character(rs.getString(name).charAt(0)); > > } > > > > Shouldn't this be something like the following to avoid a possible null > value ?!: > > public Object get(ResultSet rs, String name) throws SQLException { > > String s = rs.getString(name); > > if(s!=null) { > > return new Character(s.charAt(0)); > > } else { > > return null; > > } > > } > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |