Source:
<code>public void validate(String modelProperty, Object value, ProjectDataModel model) throws FieldValidationException { <START> if ("sequence.name".equals(modelProperty)) { <END> CommonFieldValidator.validateArtifactName(value); if (value != null) { String resource = value.toString(); SequenceModel sqModel = (SequenceModel) model; if (sqModel != null) { IContainer resLocation = sqModel.getSequenceSaveLocation(); if (resLocation != null) { IProject project = resLocation.getProject(); ESBProjectArtifact esbProjectArtifact = new ESBProjectArtifact(); try { esbProjectArtifact.fromFile(project.getFile("artifact.xml").getLocation().toFile()); } catch (Exception e) { throw new FieldValidationException(ARTIFACT_XML_FILE_CORRUPTED_ERROR); } List<ESBArtifact> allArtifacts = esbProjectArtifact.getAllESBArtifacts(); for (ESBArtifact artifact : allArtifacts) { if (resource.equals(artifact.getName())) { throw new FieldValidationException(ARTIFACT_NAME_ALREADY_EXISTS_ERROR); } } } } } } else if (modelProperty.equals("import.file")) { CommonFieldValidator.validateImportFile(value); } else if (modelProperty.equals("save.file")) { IResource resource = (IResource)value; if(null== resource || !resource.exists()) throw new FieldValidationException(PROJECT_OR_PATH_DOESNT_EXISTS_ERROR); } else if(modelProperty.equals("reg.browse")){ SequenceModel seqModel = (SequenceModel) model; if(seqModel.isSaveAsDynamic()){ if(null==value || value.toString().trim().isEmpty()){ throw new FieldValidationException(REGISTRY_PATH_EMPTY_ERROR); } } } else if(modelProperty.equals("available.sequences")){ SequenceModel seqModel = (SequenceModel) model; if(null!=seqModel.getAvailableSeqList() && seqModel.getAvailableSeqList().size()>0){ if(null==seqModel.getSelectedSeqList() || seqModel.getSelectedSeqList().size() <=0){ throw new FieldValidationException(SELECT_ATLEAST_ONE_ARTIFACT_ERROR); } } } }</code><technical_language>externalize "sequence.name" constant</technical_language>

Target:
public void validate(String modelProperty, Object value, ProjectDataModel model) throws FieldValidationException { if (MODEL_PROPERTY_SEQUENCE_NAME.equals(modelProperty)) { CommonFieldValidator.validateArtifactName(value); if (value != null) { String resource = value.toString(); SequenceModel sqModel = (SequenceModel) model; if (sqModel != null) { IContainer resLocation = sqModel.getSequenceSaveLocation(); if (resLocation != null) { IProject project = resLocation.getProject(); ESBProjectArtifact esbProjectArtifact = new ESBProjectArtifact(); try { esbProjectArtifact.fromFile(project.getFile(ARTIFACT_XML_FILE_NAME).getLocation().toFile()); } catch (Exception e) { throw new FieldValidationException(ARTIFACT_XML_FILE_CORRUPTED_ERROR); } List<ESBArtifact> allArtifacts = esbProjectArtifact.getAllESBArtifacts(); for (ESBArtifact artifact : allArtifacts) { if (resource.equals(artifact.getName())) { throw new FieldValidationException(ARTIFACT_NAME_ALREADY_EXISTS_ERROR); } } } } } } else if (modelProperty.equals("import.file")) { CommonFieldValidator.validateImportFile(value); } else if (modelProperty.equals("save.file")) { IResource resource = (IResource)value; if(null== resource || !resource.exists()) throw new FieldValidationException(PROJECT_OR_PATH_DOESNT_EXISTS_ERROR); } else if(modelProperty.equals("reg.browse")){ SequenceModel seqModel = (SequenceModel) model; if(seqModel.isSaveAsDynamic()){ if(null==value || value.toString().trim().isEmpty()){ throw new FieldValidationException(REGISTRY_PATH_EMPTY_ERROR); } } } else if(modelProperty.equals("available.sequences")){ SequenceModel seqModel = (SequenceModel) model; if(null!=seqModel.getAvailableSeqList() && seqModel.getAvailableSeqList().size()>0){ if(null==seqModel.getSelectedSeqList() || seqModel.getSelectedSeqList().size() <=0){ throw new FieldValidationException(SELECT_ATLEAST_ONE_ARTIFACT_ERROR); } } } }