Source:
<code>protected void restoreWidgetValues() { super.restoreWidgetValues(); IDialogSettings settings = getDialogSettings(); if (settings != null) { if (getDefaultSourceFile() == null) { directoryFileSelector.setDirectorySelected(settings.getBoolean("isDirectory")); String file = settings.get("source.file"); if (Strings.isValid(file)) { directoryFileSelector.setText(file); } } String parser = settings.get("selected.parser"); if (Strings.isValid(parser)) { for (IArtifactExtractor item : importContributionManager.getExtractors()) { if (parser.equals(item.getClass().getSimpleName())) { parserSelectPanel.setArtifactExtractor(item); } } } if (getDefaultDestinationArtifact() == null) { String guid = settings.get("destination.artifact.guid"); String branchUuidStr = settings.get("destination.branch.uuid"); <START> if (Strings.isValid(guid, branchUuidStr)) { <END> try { Long bramchUuid = Long.valueOf(branchUuidStr); Artifact artifact = ArtifactQuery.getArtifactFromId(guid, BranchManager.getBranchByUuid(bramchUuid)); artifactSelectPanel.setDefaultItem(artifact); } catch (OseeCoreException ex) { OseeLog.logf(Activator.class, Level.SEVERE, "Unable to restore destination artifact- guid:[%s] branch uuid:[%d]", guid, branchUuidStr); } } } boolean toUpdate = settings.getBoolean("is.update.existing.selected"); updateExistingArtifacts.setSelection(toUpdate); deleteUnmatchedArtifacts.setEnabled(toUpdate); if (toUpdate) { try { ArtifactType artType = ArtifactTypeManager.getType(getArtifactType()); attributeTypeSelectPanel.setAllowedAttributeTypes(artType.getAttributeTypes(getDestinationArtifact().getFullBranch())); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } else { attributeTypeSelectPanel.setAllowedAttributeTypes(new ArrayList<IAttributeType>()); } } }</code><technical_language>add Strings.isNumeric ensure try convert invalid id</technical_language>

Target:
protected void restoreWidgetValues() { super.restoreWidgetValues(); IDialogSettings settings = getDialogSettings(); if (settings != null) { if (getDefaultSourceFile() == null) { directoryFileSelector.setDirectorySelected(settings.getBoolean("isDirectory")); String file = settings.get("source.file"); if (Strings.isValid(file)) { directoryFileSelector.setText(file); } } String parser = settings.get("selected.parser"); if (Strings.isValid(parser)) { for (IArtifactExtractor item : importContributionManager.getExtractors()) { if (parser.equals(item.getClass().getSimpleName())) { parserSelectPanel.setArtifactExtractor(item); } } } if (getDefaultDestinationArtifact() == null) { String guid = settings.get("destination.artifact.guid"); String branchUuidStr = settings.get("destination.branch.uuid"); if (GUID.isValid(guid) && Strings.isNumeric(branchUuidStr)) { try { Long bramchUuid = Long.valueOf(branchUuidStr); Artifact artifact = ArtifactQuery.getArtifactFromId(guid, BranchManager.getBranchByUuid(bramchUuid)); artifactSelectPanel.setDefaultItem(artifact); } catch (OseeCoreException ex) { OseeLog.logf(Activator.class, Level.SEVERE, "Unable to restore destination artifact- guid:[%s] branch uuid:[%d]", guid, branchUuidStr); } } } boolean toUpdate = settings.getBoolean("is.update.existing.selected"); updateExistingArtifacts.setSelection(toUpdate); deleteUnmatchedArtifacts.setEnabled(toUpdate); if (toUpdate) { try { ArtifactType artType = ArtifactTypeManager.getType(getArtifactType()); attributeTypeSelectPanel.setAllowedAttributeTypes(artType.getAttributeTypes(getDestinationArtifact().getFullBranch())); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } else { attributeTypeSelectPanel.setAllowedAttributeTypes(new ArrayList<IAttributeType>()); } } }