public void endUpdate() { if (temporarySuppliers != null && !temporarySuppliers.isEmpty()) { // The isEmpty() check ensures only updates are applied since startUpdate()/endUpdate() can be called if there are no changes present. // Otherwise, if no updates are made, existing factories will be overwritten by the empty collection. suppliers = sortTemporaryFactories(temporarySuppliers); temporarySuppliers = null; } state = FactoryState.UPDATED; }
public void endUpdate() { if (temporarySuppliers != null && !temporarySuppliers.isEmpty()) { // The isEmpty() check ensures only updates are applied since startUpdate()/endUpdate() can be called if there are no changes present. // Otherwise, if no updates are made, existing factories will be overwritten by the empty collection. suppliers = sortTemporaryFactories(temporarySuppliers); temporarySuppliers = null; } state = FactoryState.UPDATED; }