src/main/java/seedu/address/MainApp.java
private Model initModelManager(Storage storage, UserPrefs userPrefs) {
        Optional<ReadOnlyAddressBook> addressBookOptional;
        ReadOnlyAddressBook initialData;
        try {
            addressBookOptional = storage.readAddressBook();
            if (!addressBookOptional.isPresent()) {
                logger.info("Data file not found. Will be starting with a sample AddressBook");
            }
            initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
        } catch (DataConversionException e) {
            logger.warning("Data file not in the correct format. Will be starting with an empty AddressBook");
            initialData = new AddressBook();
        } catch (IOException e) {
            logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook");
            initialData = new AddressBook();
        }

        logger.info("Updating and saving Status field of parcels in the storage based on today's date.");
        try {
            storage.saveAddressBook(initialData);
        } catch (IOException e) {
            logger.warning("Problem while saving to file. Updating of status is skipped");
        }

        return new ModelManager(initialData, userPrefs);
    }
/**
     * Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}. <br>
     * The data from the sample address book will be used instead if {@code storage}'s address book is not found,
     * or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
     */
Returns a  ModelManager with the data from  storage's address book and  userPrefs. 
The data from the sample address book will be used instead if  storage's address book is not found,
or an empty address book will be used instead if errors occur when reading  storage's address book.
Returns a ModelManager with the data from storage ' s address book and userPrefs . The data from the sample address book will be used instead if storage ' s address book is not found or an empty address book will be used instead if errors occur when reading storage ' s address book .
private Model initModelManager(Storage storage, UserPrefs userPrefs) {
        Optional<ReadOnlyAddressBook> addressBookOptional;
        ReadOnlyAddressBook initialData;
        try {
            addressBookOptional = storage.readAddressBook();
            if (!addressBookOptional.isPresent()) {
                logger.info("Data file not found. Will be starting with a sample AddressBook");
            }
            initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
        } catch (DataConversionException e) {
            logger.warning("Data file not in the correct format. Will be starting with an empty AddressBook");
            initialData = new AddressBook();
        } catch (IOException e) {
            logger.warning("Problem while reading from the file. Will be starting with an empty AddressBook");
            initialData = new AddressBook();
        }
        logger.info("Updating and saving Status field of parcels in the storage based on today's date.");
        try {
            storage.saveAddressBook(initialData);
        } catch (IOException e) {
            logger.warning("Problem while saving to file. Updating of status is skipped");
        }
        return new ModelManager(initialData, userPrefs);
    }
private Model initModelManager ( Storage storage , UserPrefs userPrefs ) { Optional < ReadOnlyAddressBook > addressBookOptional ; ReadOnlyAddressBook initialData ; try { addressBookOptional = storage . readAddressBook ( ) ; if ( ! addressBookOptional . isPresent ( ) ) { logger . info ( "Data file not found. Will be starting with a sample AddressBook" ) ; } initialData = addressBookOptional . orElseGet ( SampleDataUtil :: getSampleAddressBook ) ; } catch ( DataConversionException e ) { logger . warning ( "Data file not in the correct format. Will be starting with an empty AddressBook" ) ; initialData = new AddressBook ( ) ; } catch ( IOException e ) { logger . warning ( "Problem while reading from the file. Will be starting with an empty AddressBook" ) ; initialData = new AddressBook ( ) ; } logger . info ( "Updating and saving Status field of parcels in the storage based on today's date." ) ; try { storage . saveAddressBook ( initialData ) ; } catch ( IOException e ) { logger . warning ( "Problem while saving to file. Updating of status is skipped" ) ; } return new ModelManager ( initialData , userPrefs ) ; }
Returns a {@code ModelManager} with the data from {@code storage}'s address book and {@code userPrefs}.
Returns a { @code ModelManager } with the data from { @code storage } ' s address book and { @code userPrefs } .