[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2968) SimpleExpression.getTypedValues NullPointerException when ignoreCase and value==null

Roman Gutsenko (JIRA) noreply at atlassian.com
Fri Mar 2 07:42:48 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-2968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45790#comment-45790 ] 

Roman Gutsenko commented on HHH-2968:
-------------------------------------

I am totally understand your policy on test cases, but isn't it time already to fix five years old bug with presented working solution?

> SimpleExpression.getTypedValues NullPointerException when ignoreCase and value==null
> ------------------------------------------------------------------------------------
>
>                 Key: HHH-2968
>                 URL: https://hibernate.onjira.com/browse/HHH-2968
>             Project: Hibernate ORM
>          Issue Type: Bug
>    Affects Versions: 3.2.5
>            Reporter: Martijn Brinkers
>         Attachments: HHH-2968.patch
>
>
> If ignoreCase is true and value is null a NullPointerException is thrown because toString() is called without checking for null.
> 	public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
> 	throws HibernateException {
> 		Object icvalue = ignoreCase ? value.toString().toLowerCase() : value;
> 		return new TypedValue[] { criteriaQuery.getTypedValue(criteria, propertyName, icvalue) };
> 	}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list