Source:
<code>public DatasetDTO generateSubObservationDataset( final String cropName, final Integer studyId, final Integer parentId, final DatasetGeneratorInput datasetGeneratorInput) { this.studyValidator.validate(studyId, true); final BindingResult bindingResult = new MapBindingResult(new HashMap<String, String>(), DatasetGeneratorInput.class.getName()); this.datasetValidator.validateDatasetBelongsToStudy(studyId, parentId); this.instanceValidator.validate(null, Sets.newHashSet(datasetGeneratorInput.getInstanceIds())); this.datasetGeneratorInputValidator.validateBasicData(cropName, studyId, parentId, datasetGeneratorInput, bindingResult); if (bindingResult.hasErrors()) { throw new ApiRequestValidationException(bindingResult.getAllErrors()); } this.datasetGeneratorInputValidator.validateDatasetTypeIsImplemented(datasetGeneratorInput.getDatasetTypeId(), bindingResult); if (bindingResult.hasErrors()) { throw new NotSupportedException(bindingResult.getAllErrors().get(0)); } this.datasetGeneratorInputValidator.validateDatasetName(datasetGeneratorInput, bindingResult); if (bindingResult.hasErrors()) { <START> throw new ConflictException(bindingResult.getAllErrors()); <END> } this.datasetGeneratorInputValidator.validateDataConflicts(studyId, datasetGeneratorInput, bindingResult); if (bindingResult.hasErrors()) { throw new ConflictException(bindingResult.getAllErrors()); } final org.generationcp.middleware.domain.dms.DatasetDTO datasetDTO = this.middlewareDatasetService .generateSubObservationDataset(studyId, datasetGeneratorInput.getDatasetName(), datasetGeneratorInput.getDatasetTypeId(), Arrays.asList(datasetGeneratorInput.getInstanceIds()), datasetGeneratorInput.getSequenceVariableId(), datasetGeneratorInput.getNumberOfSubObservationUnits(), parentId); final ModelMapper mapper = new ModelMapper(); mapper.getConfiguration().setPropertyCondition(Conditions.isNotNull()); return mapper.map(datasetDTO, DatasetDTO.class); }</code><technical_language>return Conflict, ApiRequestValidationException. So, this pattern validation part of validateBasicData in DatasetGeneratorInputValidator. remove new function validateDatasetName include code part of validateBasicData, private rename function validateDatasetNamePattern</technical_language>

Target:
public DatasetDTO generateSubObservationDataset( final String cropName, final Integer studyId, final Integer parentId, final DatasetGeneratorInput datasetGeneratorInput) { this.studyValidator.validate(studyId, true); final BindingResult bindingResult = new MapBindingResult(new HashMap<String, String>(), DatasetGeneratorInput.class.getName()); this.datasetValidator.validateDatasetBelongsToStudy(studyId, parentId); this.instanceValidator.validate(null, Sets.newHashSet(datasetGeneratorInput.getInstanceIds())); this.datasetGeneratorInputValidator.validateBasicData(cropName, studyId, parentId, datasetGeneratorInput, bindingResult); if (bindingResult.hasErrors()) { throw new ApiRequestValidationException(bindingResult.getAllErrors()); } this.datasetGeneratorInputValidator.validateDatasetTypeIsImplemented(datasetGeneratorInput.getDatasetTypeId(), bindingResult); if (bindingResult.hasErrors()) { throw new NotSupportedException(bindingResult.getAllErrors().get(0)); } this.datasetGeneratorInputValidator.validateDataConflicts(studyId, datasetGeneratorInput, bindingResult); if (bindingResult.hasErrors()) { throw new ConflictException(bindingResult.getAllErrors()); } final org.generationcp.middleware.domain.dms.DatasetDTO datasetDTO = this.middlewareDatasetService .generateSubObservationDataset(studyId, datasetGeneratorInput.getDatasetName(), datasetGeneratorInput.getDatasetTypeId(), Arrays.asList(datasetGeneratorInput.getInstanceIds()), datasetGeneratorInput.getSequenceVariableId(), datasetGeneratorInput.getNumberOfSubObservationUnits(), parentId); final ModelMapper mapper = new ModelMapper(); mapper.getConfiguration().setPropertyCondition(Conditions.isNotNull()); return mapper.map(datasetDTO, DatasetDTO.class); }