Buggy code:
public abstract class SLPMessage { private static final int SLP_VERSION = 2 ; Locale locale ; byte funcID ; short xid ; InetAddress address ; int port ; boolean tcp ; boolean multicast ; public static final byte SRVRQST = 1 ; public static final byte SRVRPLY = 2 ; public static final byte SRVREG = 3 ; public static final byte SRVDEREG = 4 ; public static final byte SRVACK = 5 ; public static final byte ATTRRQST = 6 ; public static final byte ATTRRPLY = 7 ; public static final byte DAADVERT = 8 ; public static final byte SRVTYPERQST = 9 ; public static final byte SRVTYPERPLY = 10 ; public static final byte SAADVERT = 11 ; private static final String [ ] TYPES = new String [ ] { "NULL" , "SRVRQST" , "SRVPLY" , "SRVREG" , "SRVDEREG" , "SRVACK" , "ATTRRQST" , "ATTRRPLY" , "DAADVERT" , "SRVTYPERQST" , "SRVTYPERPLY" , "SAADVERT" } ; protected void writeHeader ( final DataOutputStream out , int msgSize ) throws IOException { } abstract void writeTo ( final DataOutputStream out ) throws IOException { } byte [ ] getBytes ( ) throws IOException { } static SLPMessage parse ( final InetAddress senderAddr , final int senderPort , final DataInputStream in , final boolean tcp ) throws ServiceLocationException , ProtocolException { try { final int version = in . readByte ( ) ; <START_BUG> if ( version == ( SLPMessage . SLP_VERSION ) ) { <END_BUG> in . readByte ( ) ; final int length = in . readShort ( ) ; byte [ ] drop = new byte [ length - 4 ] ; in . readFully ( drop ) ; platform . logWarning ( ( ( ( ( ( "Dropped<seq2seq4repair_space>SLPv" + version ) + "<seq2seq4repair_space>message<seq2seq4repair_space>from<seq2seq4repair_space>" ) + senderAddr ) + ":" ) + senderPort ) ) ; } final byte funcID = in . readByte ( ) ; final int length = SLPMessage . readInt ( in , 3 ) ; final byte flags = ( ( byte ) ( ( in . readShort ( ) ) > > 8 ) ) ; if ( ( ! tcp ) && ( ( flags & 128 ) != 0 ) ) { throw new ProtocolException ( ) ; } SLPMessage . readInt ( in , 3 ) ; final short xid = in . readShort ( ) ; final Locale locale = new Locale ( in . readUTF ( ) , "" ) ; final SLPMessage msg ; switch ( funcID ) { case SLPMessage . DAADVERT : msg = new DAAdvertisement ( in ) ; break ; case SLPMessage . SRVRQST : msg = new ServiceRequest ( in ) ; break ; case SLPMessage . SRVRPLY : msg = new ServiceReply ( in ) ; break ; case SLPMessage . ATTRRQST : msg = new AttributeRequest ( in ) ; break ; case SLPMessage . ATTRRPLY : msg = new AttributeReply ( in ) ; break ; case SLPMessage . SRVREG : msg = new ServiceRegistration ( in ) ; break ; case SLPMessage . SRVDEREG : msg = new ServiceDeregistration ( in ) ; break ; case SLPMessage . SRVACK : msg = new ServiceAcknowledgement ( in ) ; break ; case SLPMessage . SRVTYPERQST : msg = new ServiceTypeRequest ( in ) ; break ; case SLPMessage . SRVTYPERPLY : msg = new ServiceTypeReply ( in ) ; break ; default : throw new ServiceLocationException ( ServiceLocationException . PARSE_ERROR , ( ( "Message<seq2seq4repair_space>type<seq2seq4repair_space>" + ( SLPMessage . getType ( funcID ) ) ) + "<seq2seq4repair_space>not<seq2seq4repair_space>supported" ) ) ; } msg . address = senderAddr ; msg . port = senderPort ; msg . tcp = tcp ; msg . multicast = ( ( ( flags & 8192 ) > > 13 ) == 1 ) ? true : false ; msg . xid = xid ; msg . funcID = funcID ; msg . locale = locale ; if ( ( msg . getSize ( ) ) != length ) { platform . logError ( ( ( ( ( ( "Length<seq2seq4repair_space>of<seq2seq4repair_space>" + msg ) + "<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>" ) + length ) + ",<seq2seq4repair_space>read<seq2seq4repair_space>" ) + ( msg . getSize ( ) ) ) ) ; } return msg ; } catch ( ProtocolException pe ) { throw pe ; } catch ( IOException ioe ) { platform . logError ( "Network<seq2seq4repair_space>Error" , ioe ) ; throw new ServiceLocationException ( ServiceLocationException . NETWORK_ERROR , ioe . getMessage ( ) ) ; } } int getHeaderSize ( ) { } abstract int getSize ( ) { } public String toString ( ) { } static String getType ( final int type ) { } private static int readInt ( final DataInputStream input , final int len ) throws ServiceLocationException { } static String listToString ( final List list , final String delim ) { } static List stringToList ( final String str , final String delim ) { } protected List attributeStringToList ( String input ) throws ServiceLocationException { } protected List attributeStringToListLiberal ( String input ) { } }

Fix:
if ( version != ( SLPMessage . SLP_VERSION ) ) {