[hibernate-issues] [JIRA] (HHH-14137) Empty String Check Performance Improvement

Benjamin Maurer (JIRA) jira at hibernate.atlassian.net
Tue Aug 4 15:53:10 EDT 2020


Benjamin Maurer ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5f1862af1084620015f82ef2 ) *commented* on HHH-14137 ( https://hibernate.atlassian.net/browse/HHH-14137?atlOrigin=eyJpIjoiODZhOWU3ZDI0N2U0NGIyMDk2M2IzYTEyZTgzYTVmNWUiLCJwIjoiaiJ9 )

Re: Empty String Check Performance Improvement ( https://hibernate.atlassian.net/browse/HHH-14137?atlOrigin=eyJpIjoiODZhOWU3ZDI0N2U0NGIyMDk2M2IzYTEyZTgzYTVmNWUiLCJwIjoiaiJ9 )

> 
> 
> 
> I'm going to investigate the Spring code as well and probably will open an
> additional PR for Spring Framework.
> 
> 

Ah, no need to bother. It was simply my oversight. The docs state it clearly:

> 
> 
> 
> *Note: If the object is typed to* String upfront, prefer hasLength(String)
> or hasText(String) instead.
> 
> 

See https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/StringUtils.html#isEmpty-java.lang.Object-

And hasLenght is equivalent to your nonNullAndIsEmpty

( https://hibernate.atlassian.net/browse/HHH-14137#add-comment?atlOrigin=eyJpIjoiODZhOWU3ZDI0N2U0NGIyMDk2M2IzYTEyZTgzYTVmNWUiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14137#add-comment?atlOrigin=eyJpIjoiODZhOWU3ZDI0N2U0NGIyMDk2M2IzYTEyZTgzYTVmNWUiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100141- sha1:8f92423 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200804/ffd6e2e7/attachment.html 


More information about the hibernate-issues mailing list