Buggy code:
@ Distributable public final class DnsMonitor extends AbstractServiceMonitor { private static final Logger LOG = LoggerFactory . getLogger ( DnsMonitor . class ) ; private static final int DEFAULT_PORT = 53 ; private static final int DEFAULT_RETRY = 0 ; private static final int DEFAULT_TIMEOUT = 5000 ; private static final int [ ] DEFAULT_FATAL_RESP_CODES = new int [ ] { 2 } ; private static final int DEFAULT_MIN_ANSWERS = 0 ; private static final int DEFAULT_MAX_ANSWERS = Integer . MAX_VALUE ; @ Override public PollStatus poll ( MonitoredService svc , Map < String , Object > parameters ) { } private PollStatus pollDNS ( final TimeoutTracker timeoutTracker , final int port , final InetAddress address , final String lookup , final List < Integer > fatalCodes , int minAnswers , int maxAnswers ) { final String addr = InetAddressUtils . str ( address ) ; for ( timeoutTracker . reset ( ) ; timeoutTracker . shouldRetry ( ) ; timeoutTracker . nextAttempt ( ) ) { try { final Name name = Name . fromString ( lookup , root ) ; final SimpleResolver resolver = new SimpleResolver ( ) ; resolver . setAddress ( new InetSocketAddress ( addr , port ) ) ; resolver . setLocalAddress ( ( ( InetSocketAddress ) ( null ) ) ) ; double timeout = ( timeoutTracker . getSoTimeout ( ) ) // 1000 ; resolver . setTimeout ( ( timeout < 1 ? 1 : ( ( int ) ( timeout ) ) ) ) ; final Record question = Record . newRecord ( name , A , IN ) ; final Message query = Message . newQuery ( question ) ; PollStatus status ; timeoutTracker . startAttempt ( ) ; final Message response = resolver . send ( query ) ; double responseTime = timeoutTracker . elapsedTimeInMillis ( ) ; final Integer rcode = response . getHeader ( ) . getRcode ( ) ; DnsMonitor . LOG . debug ( "received<seq2seq4repair_space>response<seq2seq4repair_space>code:<seq2seq4repair_space>{}" , rcode ) ; if ( fatalCodes . contains ( rcode ) ) { status = PollStatus . unavailable ( ( "Received<seq2seq4repair_space>an<seq2seq4repair_space>invalid<seq2seq4repair_space>DNS<seq2seq4repair_space>response<seq2seq4repair_space>for<seq2seq4repair_space>address:<seq2seq4repair_space>" + addr ) ) ; DnsMonitor . LOG . debug ( status . getReason ( ) ) ; return status ; } else if ( ( minAnswers != ( DnsMonitor . DEFAULT_MIN_ANSWERS ) ) || ( maxAnswers != ( DnsMonitor . DEFAULT_MAX_ANSWERS ) ) ) { int numAnswers = response . getSectionArray ( ANSWER ) . length ; boolean tooFewAnswers = numAnswers < minAnswers ; boolean tooManyAnswers = numAnswers > maxAnswers ; if ( tooFewAnswers ) { status = PollStatus . unavailable ( ( ( ( ( "Response<seq2seq4repair_space>contained<seq2seq4repair_space>only<seq2seq4repair_space>" + numAnswers ) + "<seq2seq4repair_space>answer(s),<seq2seq4repair_space>but<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>" ) + minAnswers ) + "<seq2seq4repair_space>answers(s)<seq2seq4repair_space>are<seq2seq4repair_space>needed." ) ) ; DnsMonitor . LOG . warn ( status . getReason ( ) ) ; return status ; } if ( tooManyAnswers ) { <START_BUG> status = PollStatus . unavailable ( ( ( ( ( "Response<seq2seq4repair_space>contained<seq2seq4repair_space>" + numAnswers ) + "<seq2seq4repair_space>answer(s),<seq2seq4repair_space>but<seq2seq4repair_space>" ) + minAnswers ) + "<seq2seq4repair_space>or<seq2seq4repair_space>fewer<seq2seq4repair_space>answers(s)<seq2seq4repair_space>are<seq2seq4repair_space>needed." ) ) ; <END_BUG> DnsMonitor . LOG . warn ( status . getReason ( ) ) ; return status ; } status = PollStatus . up ( responseTime ) ; DnsMonitor . LOG . debug ( "valid<seq2seq4repair_space>DNS<seq2seq4repair_space>response<seq2seq4repair_space>received<seq2seq4repair_space>with<seq2seq4repair_space>{}<seq2seq4repair_space>answer(s),<seq2seq4repair_space>responseTime<seq2seq4repair_space>=<seq2seq4repair_space>{}ms" , numAnswers , responseTime ) ; return status ; } else { status = PollStatus . up ( responseTime ) ; DnsMonitor . LOG . debug ( "valid<seq2seq4repair_space>DNS<seq2seq4repair_space>response<seq2seq4repair_space>received,<seq2seq4repair_space>responseTime<seq2seq4repair_space>=<seq2seq4repair_space>{}ms" , responseTime ) ; return status ; } } catch ( final InterruptedIOException e ) { } catch ( final NoRouteToHostException e ) { String reason1 = "No<seq2seq4repair_space>route<seq2seq4repair_space>to<seq2seq4repair_space>host<seq2seq4repair_space>exception<seq2seq4repair_space>for<seq2seq4repair_space>address:<seq2seq4repair_space>" + addr ; DnsMonitor . LOG . debug ( reason1 , e ) ; return PollStatus . unavailable ( reason1 ) ; } catch ( final ConnectException e ) { String reason1 = "Connection<seq2seq4repair_space>exception<seq2seq4repair_space>for<seq2seq4repair_space>address:<seq2seq4repair_space>" + addr ; DnsMonitor . LOG . debug ( reason1 , e ) ; return PollStatus . unavailable ( reason1 ) ; } catch ( final IOException e ) { String reason1 = ( ( "IOException<seq2seq4repair_space>while<seq2seq4repair_space>polling<seq2seq4repair_space>address:<seq2seq4repair_space>" + addr ) + "<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ; DnsMonitor . LOG . debug ( reason1 , e ) ; return PollStatus . unavailable ( reason1 ) ; } } String reason = "Never<seq2seq4repair_space>received<seq2seq4repair_space>valid<seq2seq4repair_space>DNS<seq2seq4repair_space>response<seq2seq4repair_space>for<seq2seq4repair_space>address:<seq2seq4repair_space>" + addr ; DnsMonitor . LOG . debug ( reason ) ; return PollStatus . unavailable ( reason ) ; } }

Fix:
status = PollStatus . unavailable ( ( ( ( ( "Response<seq2seq4repair_space>contained<seq2seq4repair_space>" + numAnswers ) + "<seq2seq4repair_space>answer(s),<seq2seq4repair_space>but<seq2seq4repair_space>" ) + maxAnswers ) + "<seq2seq4repair_space>or<seq2seq4repair_space>fewer<seq2seq4repair_space>answers(s)<seq2seq4repair_space>are<seq2seq4repair_space>needed." ) ) ;