We're updating the issue view to help you get more done. 

Reduce throw of NumberFormatException in BaseQueryImpl

Description

There is a performance penalty with instantiating a new exception, when filling the stack trace. By running a benchmark we found that there a lot of java.lang.NumberFormatException being thrown and swallowed in hibernate. These were tracked down to org.hibernate.jpa.spi.BaseQueryImpl.toNumberOrNull(String parameterName)

In this particular case there are two things that can be done to reduce the number of exceptions:
1) Move the place where toNumberOrNull() is called in findParameterRegistration() so that it only gets called when needed.
2) Do a check if the chars are digits before attempting the conversion to int

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Luis Barreiro

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Minor