Source:
<code>public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JsonProperty("transformSpec") TransformSpec transformSpec, @JacksonInject ObjectMapper jsonMapper ) { this.jsonMapper = Preconditions.checkNotNull(jsonMapper, "null ObjectMapper."); this.parser = parser; this.transformSpec = transformSpec == null ? TransformSpec.NONE : transformSpec; Preconditions.checkArgument(!Strings.isNullOrEmpty(dataSource), "dataSource cannot be null or empty. Please provide a dataSource."); Preconditions.checkArgument(!dataSource.contains("/"), "dataSource cannot contain the '/' character."); <START> Preconditions.checkArgument(!dataSource.contains("\t"), "dataSource cannot contain the '\\t' character."); <END> Preconditions.checkArgument(!dataSource.contains("\n"), "dataSource cannot contain the '\\n' character."); Preconditions.checkArgument(!dataSource.contains("\r"), "dataSource cannot contain the '\\r' character."); this.dataSource = dataSource; if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } if (aggregators != null && aggregators.length != 0) { Set<String> names = new HashSet<>(); for (AggregatorFactory factory : aggregators) { if (!names.add(factory.getName())) { throw new IAE("duplicate aggregators found with name [%s].", factory.getName()); } } } else if (this.granularitySpec.isRollup()) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } this.aggregators = aggregators == null ? new AggregatorFactory[]{} : aggregators; }</code><technical_language>Suggest extracting checks a static method DataSchema, call validateDatasourceName</technical_language>

Target:
public DataSchema( @JsonProperty("dataSource") String dataSource, @JsonProperty("parser") Map<String, Object> parser, @JsonProperty("metricsSpec") AggregatorFactory[] aggregators, @JsonProperty("granularitySpec") GranularitySpec granularitySpec, @JsonProperty("transformSpec") TransformSpec transformSpec, @JacksonInject ObjectMapper jsonMapper ) { this.jsonMapper = Preconditions.checkNotNull(jsonMapper, "null ObjectMapper."); this.parser = parser; this.transformSpec = transformSpec == null ? TransformSpec.NONE : transformSpec; validateDatasourceName(dataSource); this.dataSource = dataSource; if (granularitySpec == null) { log.warn("No granularitySpec has been specified. Using UniformGranularitySpec as default."); this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec; } if (aggregators != null && aggregators.length != 0) { Set<String> names = new HashSet<>(); for (AggregatorFactory factory : aggregators) { if (!names.add(factory.getName())) { throw new IAE("duplicate aggregators found with name [%s].", factory.getName()); } } } else if (this.granularitySpec.isRollup()) { log.warn("No metricsSpec has been specified. Are you sure this is what you want?"); } this.aggregators = aggregators == null ? new AggregatorFactory[]{} : aggregators; }