[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2034) Potential ClassCastException in catch block in NullableType
Max Rydahl Andersen (JIRA)
noreply at atlassian.com
Mon Aug 28 17:24:24 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2034?page=comments#action_24176 ]
Max Rydahl Andersen commented on HHH-2034:
------------------------------------------
well the types should safely assume that their value is correct; but i can also see your point with respect to tracking down the true cause (even thouhgh the classcastexception is actually very correct ;)
> Potential ClassCastException in catch block in NullableType
> -----------------------------------------------------------
>
> Key: HHH-2034
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2034
> Project: Hibernate3
> Type: Improvement
> Components: core
> Versions: 3.1.3
> Environment: Hibernate 3.1.3
> Reporter: Galen Palmer
> Priority: Minor
>
> Original Estimate: 1 hour
> Remaining: 1 hour
>
> It is possible to throw an exception from within the catch block of NullableType.nullSafeSet() since the toString(value) method calls in many cases (e.g. StringType) simply result in a cast of return (String)value. This may mask the underlying problem for the users.
> A proposed solution would be to replace the call in the catch blog of toString(value) with a reference to value. For example:
> line 87:
> log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + re.getMessage() );
> and line 91:
> log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + se.getMessage() );
> This change would prevent the catch block from throwing the exception.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list