Source:
<code>public static AssociationKeyMetadata getInverseAssociationKeyMetadata(OgmEntityPersister mainSidePersister, int propertyIndex) { Type propertyType = mainSidePersister.getPropertyTypes()[propertyIndex]; SessionFactoryImplementor factory = mainSidePersister.getFactory(); if ( !propertyType.isAssociationType() ) { return null; } Joinable mainSideJoinable = ( (AssociationType) propertyType ).getAssociatedJoinable( factory ); OgmEntityPersister inverseSidePersister = null; if ( mainSideJoinable.isCollection() ) { inverseSidePersister = (OgmEntityPersister) ( (OgmCollectionPersister) mainSideJoinable ).getElementPersister(); } else { inverseSidePersister = (OgmEntityPersister) mainSideJoinable; mainSideJoinable = mainSidePersister; } String mainSideProperty = mainSidePersister.getPropertyNames()[propertyIndex]; AssociationKeyMetadata inverseOneToOneMetadata = mainSidePersister.getInverseOneToOneAssociationKeyMetadata( mainSideProperty ); if ( inverseOneToOneMetadata != null ) { return inverseOneToOneMetadata; } for ( String candidateProperty : inverseSidePersister.getPropertyNames() ) { Type type = inverseSidePersister.getPropertyType( candidateProperty ); if ( type.isCollectionType() ) { OgmCollectionPersister inverseCollectionPersister = getPersister( factory, (CollectionType) type ); String mappedByProperty = inverseCollectionPersister.getMappedByProperty(); <START> if ( isEmpty( mappedByProperty ) ) { <END> if ( isCollectionMatching( mainSideJoinable, inverseCollectionPersister ) ) { return inverseCollectionPersister.getAssociationKeyMetadata(); } } else if ( mappedByProperty.equals( mainSideProperty ) ) { if ( isCollectionMatching( mainSideJoinable, inverseCollectionPersister ) ) { return inverseCollectionPersister.getAssociationKeyMetadata(); } } } } return null; }</code><technical_language>prefer a if / else if instead of a in if</technical_language>

Target:
public static AssociationKeyMetadata getInverseAssociationKeyMetadata(OgmEntityPersister mainSidePersister, int propertyIndex) { Type propertyType = mainSidePersister.getPropertyTypes()[propertyIndex]; SessionFactoryImplementor factory = mainSidePersister.getFactory(); if ( !propertyType.isAssociationType() ) { return null; } Joinable mainSideJoinable = ( (AssociationType) propertyType ).getAssociatedJoinable( factory ); OgmEntityPersister inverseSidePersister = null; if ( mainSideJoinable.isCollection() ) { inverseSidePersister = (OgmEntityPersister) ( (OgmCollectionPersister) mainSideJoinable ).getElementPersister(); } else { inverseSidePersister = (OgmEntityPersister) mainSideJoinable; mainSideJoinable = mainSidePersister; } String mainSideProperty = mainSidePersister.getPropertyNames()[propertyIndex]; AssociationKeyMetadata inverseOneToOneMetadata = mainSidePersister.getInverseOneToOneAssociationKeyMetadata( mainSideProperty ); if ( inverseOneToOneMetadata != null ) { return inverseOneToOneMetadata; } for ( String candidateProperty : inverseSidePersister.getPropertyNames() ) { Type type = inverseSidePersister.getPropertyType( candidateProperty ); if ( type.isCollectionType() ) { OgmCollectionPersister inverseCollectionPersister = getPersister( factory, (CollectionType) type ); String mappedByProperty = inverseCollectionPersister.getMappedByProperty(); if ( mainSideProperty.equals( mappedByProperty ) ) { if ( isCollectionMatching( mainSideJoinable, inverseCollectionPersister ) ) { return inverseCollectionPersister.getAssociationKeyMetadata(); } } } } return null; }