Buggy code:
public class Controller extends Thread { private View view ; private Connection connection ; private InetAddress multicastIAddress ; private int localIAddress = 0 ; public static int multicastAddress = Controller . IPtoInt ( "224.0.0.2" ) ; private Router router = new Router ( this ) ; private Update update ; private boolean settingUp = true ; private String initString ; private SeqAckTable seqAckTable = new SeqAckTable ( this ) ; private InetAddress localInetAddress ; public InetAddress getMulticastIAddress ( ) { } public int getLocalIAddress ( ) { } private String clientName = "Anonymous" ; public Controller ( View view ) { } public InetAddress getLocalInetAddress ( ) { } private void setupIP ( ) { } private static int IPtoInt ( String ipaddress ) { } public Map < Integer , Map < Integer , Integer > > getForwardingTable ( ) { } private SecureRandom random = new SecureRandom ( ) ; public String randomString ( ) { } public boolean getSettingUp ( ) { } public String getInitString ( ) { } public void run ( ) { } public void sendMessage ( String client , String message ) { } public void sendPacket ( String client , JRTVPacket packet ) { } public void sendPacket ( int client , JRTVPacket packet ) { } public void retransmit ( JRTVPacket packet ) { } public void retransmit ( JRTVPacket packet , int destination ) { } private void sendAck ( JRTVPacket packet ) { } public void broadcastPacket ( JRTVPacket packet ) { } public void broadcastMessage ( String message ) { } public Router getRouter ( ) { } public void receiveFromView ( String client , String message ) { } public void handleMessage ( DatagramPacket message ) { JRTVPacket packet = new JRTVPacket ( message . getData ( ) ) ; if ( ( packet . getSource ( ) ) != ( localIAddress ) ) { <START_BUG> if ( ( ( packet . getNextHop ( ) ) == ( localIAddress ) ) && ( ( packet . getDestination ( ) ) != ( localIAddress ) ) ) { <END_BUG> retransmit ( packet ) ; } else { if ( ( ( packet . getDestination ( ) ) == ( localIAddress ) ) || ( ( packet . getDestination ( ) ) == ( Controller . multicastAddress ) ) ) { if ( packet . isNormal ( ) ) { sendAck ( packet ) ; } if ( ! ( seqAckTable . isReceivedSeqNr ( packet . getSource ( ) , packet . getSeqnr ( ) ) ) ) { seqAckTable . addReceivedSeqNr ( packet . getSource ( ) , packet . getSeqnr ( ) ) ; if ( packet . isNormal ( ) ) { handleNormal ( packet ) ; } else if ( packet . isUpdate ( ) ) { handleUpdate ( packet ) ; } else if ( packet . isSyn ( ) ) { handleSyn ( packet ) ; } else if ( packet . isFin ( ) ) { handleFin ( packet ) ; } else if ( packet . isAck ( ) ) { handleAck ( packet ) ; } else { if ( packet . getMessage ( ) . equals ( "ACK" ) ) { seqAckTable . registerAckPacket ( packet ) ; } } } } } } } public void addRecipientToView ( String recipient ) { } public void removeRecipientToView ( String recipient ) { } public void handleNormal ( JRTVPacket p ) { } public String getNameBySource ( int source ) { } public void handleUpdate ( JRTVPacket p ) { } public void handleSyn ( JRTVPacket p ) { } public void handleFin ( JRTVPacket p ) { } public void handleAck ( JRTVPacket p ) { } public void setClientName ( String clientName ) { } public String getClientName ( ) { } public InetAddress getMulticastAddress ( ) { } }

Fix:
if ( ( ( ( packet . getNextHop ( ) ) == ( localIAddress ) ) && ( ( packet . getDestination ( ) ) != ( localIAddress ) ) ) && ( ( packet . getDestination ( ) ) != ( Controller . multicastAddress ) ) ) {