<commit_before>package org.nexusdata.core;

import java.util.HashSet;
import java.util.Set;


public class ChangedObjectsSet {

    private final Set<ManagedObject> insertedObjects;
    private final Set<ManagedObject> updatedObjects;
    private final Set<ManagedObject> deletedObjects;

    ChangedObjectsSet() {
        this(new HashSet<ManagedObject>(), new HashSet<ManagedObject>(), new HashSet<ManagedObject>());
    }

    ChangedObjectsSet(ChangedObjectsSet other) {
        this(new HashSet<ManagedObject>(other.getInsertedObjects()),
                new HashSet<ManagedObject>(other.getUpdatedObjects()),
                new HashSet<ManagedObject>(other.getDeletedObjects()));
    }

    ChangedObjectsSet(Set<ManagedObject> insertedObjects, Set<ManagedObject> updatedObjects, Set<ManagedObject> deletedObjects) {
        this.insertedObjects = insertedObjects;
        this.updatedObjects = updatedObjects;
        this.deletedObjects = deletedObjects;
    }

    void objectInserted(ManagedObject object) {
        if (!object.isDeleted()) {
            synchronized(insertedObjects) {
                insertedObjects.add(object);
            }
        }
        deletedObjects.remove(object);
    }

    void objectUpdated(ManagedObject object) {
        if (!insertedObjects.contains(object) && !deletedObjects.contains(object)) {
            updatedObjects.add(object);
        }
    }

    void objectDeleted(ManagedObject object, boolean trackDeletionEvenIfNew) {
        synchronized(insertedObjects) {
            insertedObjects.remove(object);
        }
        updatedObjects.remove(object);
        if (!object.isNew() || trackDeletionEvenIfNew) {
            deletedObjects.add(object);
        }
    }

    void clear() {
        synchronized(insertedObjects) {
            insertedObjects.clear();
        }
        deletedObjects.clear();
        updatedObjects.clear();
    }

    public Set<ManagedObject> getInsertedObjects() {
        return insertedObjects;
    }

    public Set<ManagedObject> getUpdatedObjects() {
        return updatedObjects;
    }

    public Set<ManagedObject> getDeletedObjects() {
        return deletedObjects;<commit_msg>removed incorrect fix in ChangedObjectsSet<commit_after>package org.nexusdata.core;

import java.util.HashSet;
import java.util.Set;


public class ChangedObjectsSet {

    private final Set<ManagedObject> insertedObjects;
    private final Set<ManagedObject> updatedObjects;
    private final Set<ManagedObject> deletedObjects;

    ChangedObjectsSet() {
        this(new HashSet<ManagedObject>(), new HashSet<ManagedObject>(), new HashSet<ManagedObject>());
    }

    ChangedObjectsSet(ChangedObjectsSet other) {
        this(new HashSet<ManagedObject>(other.getInsertedObjects()),
                new HashSet<ManagedObject>(other.getUpdatedObjects()),
                new HashSet<ManagedObject>(other.getDeletedObjects()));
    }

    ChangedObjectsSet(Set<ManagedObject> insertedObjects, Set<ManagedObject> updatedObjects, Set<ManagedObject> deletedObjects) {
        this.insertedObjects = insertedObjects;
        this.updatedObjects = updatedObjects;
        this.deletedObjects = deletedObjects;
    }

    void objectInserted(ManagedObject object) {
        if (!object.isDeleted()) {
            insertedObjects.add(object);
        }
        deletedObjects.remove(object);
    }

    void objectUpdated(ManagedObject object) {
        if (!insertedObjects.contains(object) && !deletedObjects.contains(object)) {
            updatedObjects.add(object);
        }
    }

    void objectDeleted(ManagedObject object, boolean trackDeletionEvenIfNew) {
        insertedObjects.remove(object);
        updatedObjects.remove(object);
        if (!object.isNew() || trackDeletionEvenIfNew) {
            deletedObjects.add(object);
        }
    }

    void clear() {
        insertedObjects.clear();
        deletedObjects.clear();
        updatedObjects.clear();
    }

    public Set<ManagedObject> getInsertedObjects() {
        return insertedObjects;
    }

    public Set<ManagedObject> getUpdatedObjects() {
        return updatedObjects;
    }

    public Set<ManagedObject> getDeletedObjects() {
        return deletedObjects;
{'fraction_non_alphanumeric': 0.09713338071547027, 'fraction_numerical': 0.0, 'mean_word_length': 3.067437379576108, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2892223', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1081, 'n_words': 192}