Source:
<code>public LibraryPropertiesDialogViewModel(BasePanel panel, DialogService dialogService, PreferencesService preferencesService) { this.dialogService = dialogService; MetaData metaData = panel.getBibDatabaseContext().getMetaData(); DatabaseLocation location = panel.getBibDatabaseContext().getLocation(); boolean isShared = (location == DatabaseLocation.SHARED); encodingDisableProperty.setValue(isShared); protectDisableProperty.setValue(isShared); directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() .withInitialDirectory(preferencesService.getWorkingDir()).build(); Optional<Charset> charset = metaData.getEncoding(); selectedEncodingPropety.setValue(charset.orElse(preferencesService.getDefaultEncoding())); Optional<String> fileD = metaData.getDefaultFileDirectory(); fileD.ifPresent(path -> generalFileDirectoryProperty.setValue(path.trim())); Optional<String> fileDI = metaData.getUserFileDirectory(preferencesService.getUser()); fileDI.ifPresent(userSpecificFileDirectoryProperty::setValue); Optional<Path> fileDL = metaData.getLaTexFileDirectory(preferencesService.getUser()); <START> Optional<String> laTexFile = Optional.ofNullable(fileDL.toString()); <END> laTexFile.ifPresent(laTexFileDirectoryProperty::setValue); oldUserSpecificFileDir = generalFileDirectoryProperty.getValue(); oldGeneralFileDir = userSpecificFileDirectoryProperty.getValue(); oldLaTexFileDir = laTexFileDirectoryProperty.getValue(); libraryProtectedProperty.setValue(metaData.isProtected()); oldLibraryProtected = libraryProtectedProperty.getValue(); }</code><technical_language>This work intended: fileDL is optional toString returns Optional[value]. Instead, metadata.getLatexFileDirectory(...) .map(Path::toString) .ifPresent(laTexFileDirectoryProperty::setValue)</technical_language>

Target:
public LibraryPropertiesDialogViewModel(BasePanel panel, DialogService dialogService, PreferencesService preferencesService) { this.dialogService = dialogService; MetaData metaData = panel.getBibDatabaseContext().getMetaData(); DatabaseLocation location = panel.getBibDatabaseContext().getLocation(); boolean isShared = (location == DatabaseLocation.SHARED); encodingDisableProperty.setValue(isShared); protectDisableProperty.setValue(isShared); directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() .withInitialDirectory(preferencesService.getWorkingDir()).build(); Optional<Charset> charset = metaData.getEncoding(); selectedEncodingPropety.setValue(charset.orElse(preferencesService.getDefaultEncoding())); Optional<String> fileD = metaData.getDefaultFileDirectory(); fileD.ifPresent(path -> generalFileDirectoryProperty.setValue(path.trim())); Optional<String> fileDI = metaData.getUserFileDirectory(preferencesService.getUser()); fileDI.ifPresent(userSpecificFileDirectoryProperty::setValue); metaData.getLaTexFileDirectory(preferencesService.getUser()).map(Path::toString).ifPresent(laTexFileDirectoryProperty::setValue); oldUserSpecificFileDir = generalFileDirectoryProperty.getValue(); oldGeneralFileDir = userSpecificFileDirectoryProperty.getValue(); oldLaTexFileDir = laTexFileDirectoryProperty.getValue(); libraryProtectedProperty.setValue(metaData.isProtected()); oldLibraryProtected = libraryProtectedProperty.getValue(); }