The reason it doesn't check list!=null is that find() is never supposed to
return a null list.... How did you make that happen?? Do you have a
stacktrace, etc?
> I've found a bug that causes a NPE in the Session.delete(String query)
> implementation: if you pass a query that return no objects you end up
> with an NPE. The incriminated code follows:
>
> SessionImpl.java (line 1178)
>
> public int delete(String query, Object[] values, Type[] types) throws
> HibernateException, SQLException {
>
> if ( log.isTraceEnabled() ) {
> log.trace( "delete: " + query );
> if (values.length!=0) log.trace( "parameters: " +
> StringHelper.toString(values) );
> }
>
> List list = find(query, values, types);
> int size = list.size();
> for ( int i=0; i<size; i++ ) delete( list.get(i) );
> return size;
> }
>
> The list.size() call fails if list is null... should look like:
>
> if(list != null) {
> int size = list.size();
> for ( int i=0; i<size; i++ ) delete( list.get(i) );
> return size;
> } else {
> return 0;
> }
>
> Bye
> Andrea
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> Access Your PC Securely with GoToMyPC. Try Free Now
> https://www.gotomypc.com/s/OSND/DD
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
This sf.net email is sponsored by:
Access Your PC Securely with GoToMyPC. Try Free Now
https://www.gotomypc.com/s/OSND/DD
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel