Prashant Guleria (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOGMzN2EzZDlm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16577?atlOrigin=eyJpIjoiOGMzN2...
) HHH-16577 (
https://hibernate.atlassian.net/browse/HHH-16577?atlOrigin=eyJpIjoiOGMzN2...
) Index Out of Bound Exception (
https://hibernate.atlassian.net/browse/HHH-16577?atlOrigin=eyJpIjoiOGMzN2...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Attachments:
image-20230510-070227 (6355fa57-062e-465a-961e-9ef79cc90026).png,
image-20230510-070227.png Components: hibernate-core Created: 10/May/2023 00:07 AM
Environment: Postgres 14 , JAVA 17, MAC OS and Linux OS, Hibenrate 6.1.17.Final with
Spring Boot 3.0.4 Labels: Lazy byte-code-enhancement bytecode core enhancement lazy
Priority: Major Reporter: Prashant Guleria (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In function {{protected Object handleRead(Object target, String attributeName, Object
value) }}
defined in class public class EnhancementAsProxyLazinessInterceptor extends
AbstractLazyLoadInterceptor , I am getting Index Out of bound exception.
If you see assignment as writtenValues = new Object [writtenFieldNames.size()] ;
In my case the size of writtenFieldNames is 1, But the size variable has value 23 which
comes from
final int size = entityPersister.getNumberOfAttributeMappings()
In entityPersister my field is present at index 1, but writtenValues can contain only 1
element at index 0. and throws out of bond exception.
if ( writtenFieldName.contains( entityPersister.getAttributeMapping( index
).getAttributeName() ) ) {
Index 1 out of bounds for length 1
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at
org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor.lambda$handleRead$0(EnhancementAsProxyLazinessInterceptor.java:152)
at
org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper.performWork(EnhancementHelper.java:206)
at
org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor.handleRead(EnhancementAsProxyLazinessInterceptor.java:102)
at
org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.readObject(AbstractInterceptor.java:152)
(
https://hibernate.atlassian.net/secure/attachment/50365/50365_image-20230...
)
(
https://hibernate.atlassian.net/browse/HHH-16577#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16577#add-comment?atlOrigin=ey...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:55ea0c5 )