@@ -204,7 +204,7 @@ public void setStatus(Status status) {
204204 loadedState = null ;
205205 }
206206
207- final Status currentStatus = this . getStatus ();
207+ final Status currentStatus = getStatus ();
208208 if ( currentStatus != status ) {
209209 setCompressedValue ( PREVIOUS_STATUS , currentStatus );
210210 setCompressedValue ( STATUS , status );
@@ -264,10 +264,10 @@ public EntityPersister getPersister() {
264264 @ Override
265265 public EntityKey getEntityKey () {
266266 if ( cachedEntityKey == null ) {
267- if ( getId () == null ) {
267+ if ( id == null ) {
268268 throw new IllegalStateException ( "cannot generate an EntityKey when id is null." );
269269 }
270- cachedEntityKey = new EntityKey ( getId (), getPersister () );
270+ cachedEntityKey = new EntityKey ( id , persister );
271271 }
272272 return cachedEntityKey ;
273273 }
@@ -341,7 +341,8 @@ else if ( earlyInsert ) {
341341 return !isExistsInDatabase ();
342342 }
343343 else {
344- return session .getPersistenceContextInternal ().containsNullifiableEntityKey ( this ::getEntityKey );
344+ return session .getPersistenceContextInternal ()
345+ .containsNullifiableEntityKey ( this ::getEntityKey );
345346 }
346347 }
347348
@@ -350,8 +351,10 @@ public Object getLoadedValue(String propertyName) {
350351 if ( loadedState == null || propertyName == null ) {
351352 return null ;
352353 }
353- final int index = propertyIndex ( propertyName );
354- return index < 0 ? null : loadedState [index ];
354+ else {
355+ final int index = propertyIndex ( propertyName );
356+ return index < 0 ? null : loadedState [index ];
357+ }
355358 }
356359
357360 private int propertyIndex (String propertyName ) {
@@ -365,7 +368,6 @@ public void overwriteLoadedStateCollectionValue(String propertyName, PersistentC
365368 if ( getStatus () != READ_ONLY ) {
366369 assert propertyName != null ;
367370 assert loadedState != null ;
368-
369371 loadedState [ propertyIndex ( propertyName ) ] = collection ;
370372 }
371373 }
@@ -395,8 +397,8 @@ private boolean isNonDirtyViaCustomStrategy(Object entity) {
395397 final SessionImplementor session = (SessionImplementor ) getPersistenceContext ().getSession ();
396398 final CustomEntityDirtinessStrategy customEntityDirtinessStrategy =
397399 session .getFactory ().getCustomEntityDirtinessStrategy ();
398- return customEntityDirtinessStrategy .canDirtyCheck ( entity , getPersister () , session )
399- && !customEntityDirtinessStrategy .isDirty ( entity , getPersister () , session );
400+ return customEntityDirtinessStrategy .canDirtyCheck ( entity , persister , session )
401+ && !customEntityDirtinessStrategy .isDirty ( entity , persister , session );
400402 }
401403
402404 private boolean isNonDirtyViaTracker (Object entity ) {
@@ -437,9 +439,10 @@ public boolean isModifiableEntity() {
437439 @ Override
438440 public void forceLocked (Object entity , Object nextVersion ) {
439441 version = nextVersion ;
440- loadedState [ persister .getVersionProperty () ] = version ;
442+ final int versionProperty = persister .getVersionProperty ();
443+ loadedState [versionProperty ] = version ;
441444 setLockMode ( PESSIMISTIC_FORCE_INCREMENT );
442- persister .setValue ( entity , getPersister (). getVersionProperty () , nextVersion );
445+ persister .setValue ( entity , versionProperty , nextVersion );
443446 }
444447
445448 @ Override
@@ -497,7 +500,7 @@ public void setMaybeLazySet(@Nullable ImmutableBitSet maybeLazySet) {
497500 @ Override
498501 public String toString () {
499502 return "EntityEntry"
500- + infoString ( getPersister () .getEntityName (), id )
503+ + infoString ( persister .getEntityName (), id )
501504 + '(' + getStatus () + ')' ;
502505 }
503506
@@ -565,7 +568,7 @@ public <T extends EntityEntryExtraState> T getExtraState(Class<T> extraStateType
565568 if ( next == null ) {
566569 return null ;
567570 }
568- if ( extraStateType .isAssignableFrom ( next .getClass () ) ) {
571+ else if ( extraStateType .isAssignableFrom ( next .getClass () ) ) {
569572 return (T ) next ;
570573 }
571574 else {
0 commit comments