[Demonstration 1]

[Buggy Method]
protected final Object intercept(Object target, String fieldName, Object value) {
    if (lazyFields != null && lazyFields.contains(fieldName) && initializedFields.contains(fieldName)) {
        if (session == null) {
            throw new LazyInitializationException("entity with lazy properties is not associated with a session");
        } else if (!session.isOpen() || !session.isConnected()) {
            throw new LazyInitializationException("session is not connected");
        }
        Object loadedValue = ((LazyPropertyInitializer) session.getFactory().getEntityPersister(entityName)).initializeLazyProperty(fieldName, target, session);
        initializedFields.add(fieldName);
        return loadedValue;
    } else {
        return value;
    }
}

[Buggy Hunk]
if ( lazyFields != null && lazyFields.contains( fieldName ) && initializedFields.contains( fieldName ) ) {

[Patch]
if ( lazyFields != null && lazyFields.contains( fieldName ) && !initializedFields.contains( fieldName ) ) {

[Demonstration 2]

[Buggy Method]
@Nullable
public String getLastAndroidId() {
    return preferences.getString(KEY_LAST_ANDROID_ID);
}

[Buggy Hunk]
public String getLastAndroidId() {

[Patch]
public synchronized String getLastAndroidId() {

[Demonstration 3]

[Buggy Method]
private static BasicTypeProducer resolveTypeProducer(MappingDocument mappingDocument, HibernateTypeSource typeSource) {
    final String typeName = typeSource.getName();
    if (StringHelper.isNotEmpty(typeName)) {
        final BasicTypeProducer registered = mappingDocument.getMetadataCollector().getBasicTypeProducerRegistry().resolve(typeSource.getName());
        if (registered != null) {
            return registered;
        }
    }
    return new BasicTypeProducerUnregisteredImpl(mappingDocument.getMetadataCollector().getTypeConfiguration());
}

[Buggy Hunk]
final BasicTypeProducer registered = mappingDocument.getMetadataCollector()

[Patch]
final BasicTypeProducer registered = mappingDocument.getMetadataCollector().getBootstrapContext()