Source:
<code>public StatsDWriter( @JsonProperty("typeNames") ImmutableList<String> typeNames, @JsonProperty("booleanAsNumber") boolean booleanAsNumber, @JsonProperty("debug") Boolean debugEnabled, @JsonProperty("host") String host, @JsonProperty("port") Integer port, @JsonProperty("bucketType") String bucketType, @JsonProperty("rootPrefix") String rootPrefix, @JsonProperty(STRING_VALUE_AS_KEY) Boolean stringsValuesAsKey, @JsonProperty(STRING_VALUE_DEFAULT_COUNTER) Long stringValueDefaultCount, @JsonProperty("settings") Map<String, Object> settings, @JsonProperty("replacementForInvalidChar") String replacementForInvalidChar ) throws IOException { super(typeNames, booleanAsNumber, debugEnabled, settings); log.warn("StatsDWriter is deprecated. Please use StatsDWriterFactory instead."); channel = DatagramChannel.open(); sendBuffer = ByteBuffer.allocate((short) 1500); this.bucketType = firstNonNull(bucketType, (String) getSettings().get(BUCKET_TYPE), "c"); this.rootPrefix = firstNonNull(rootPrefix, (String) getSettings().get(ROOT_PREFIX), "servers"); this.stringsValuesAsKey = firstNonNull(stringsValuesAsKey, (Boolean) getSettings().get(STRING_VALUE_AS_KEY), false); this.stringValueDefaultCount = firstNonNull(stringValueDefaultCount, (Long) getSettings().get(STRING_VALUE_DEFAULT_COUNTER), 1L); if (host == null) { host = (String) getSettings().get(HOST); } if (port == null) { port = Settings.getIntegerSetting(getSettings(), PORT, null); } <START> this.replacementForInvalidChar = com.google.common.base.MoreObjects.firstNonNull(replacementForInvalidChar, "_"); <END> checkNotNull(host, "Host cannot be null"); checkNotNull(port, "Port cannot be null"); this.address = new InetSocketAddress(host, port); }</code><technical_language>import of MoreObjects more readable</technical_language>

Target:
public StatsDWriter( @JsonProperty("typeNames") ImmutableList<String> typeNames, @JsonProperty("booleanAsNumber") boolean booleanAsNumber, @JsonProperty("debug") Boolean debugEnabled, @JsonProperty("host") String host, @JsonProperty("port") Integer port, @JsonProperty("bucketType") String bucketType, @JsonProperty("rootPrefix") String rootPrefix, @JsonProperty(STRING_VALUE_AS_KEY) Boolean stringsValuesAsKey, @JsonProperty(STRING_VALUE_DEFAULT_COUNTER) Long stringValueDefaultCount, @JsonProperty("settings") Map<String, Object> settings, @JsonProperty("replacementForInvalidChar") String replacementForInvalidChar ) throws IOException { super(typeNames, booleanAsNumber, debugEnabled, settings); log.warn("StatsDWriter is deprecated. Please use StatsDWriterFactory instead."); channel = DatagramChannel.open(); sendBuffer = ByteBuffer.allocate((short) 1500); this.bucketType = firstNonNull(bucketType, (String) getSettings().get(BUCKET_TYPE), "c"); this.rootPrefix = firstNonNull(rootPrefix, (String) getSettings().get(ROOT_PREFIX), "servers"); this.stringsValuesAsKey = firstNonNull(stringsValuesAsKey, (Boolean) getSettings().get(STRING_VALUE_AS_KEY), false); this.stringValueDefaultCount = firstNonNull(stringValueDefaultCount, (Long) getSettings().get(STRING_VALUE_DEFAULT_COUNTER), 1L); if (host == null) { host = (String) getSettings().get(HOST); } if (port == null) { port = Settings.getIntegerSetting(getSettings(), PORT, null); } this.replacementForInvalidChar = MoreObjects.firstNonNull(replacementForInvalidChar, "_"); checkNotNull(host, "Host cannot be null"); checkNotNull(port, "Port cannot be null"); this.address = new InetSocketAddress(host, port); }