Buggy code:
public class ShelfAgent extends Agent { public static String shelfDir = "conf//shelves//shelf" ; private static final long serialVersionUID = 1L ; private HashMap < String , Integer > inventory ; protected Pose position ; protected DFAgentDescription dfd ; protected String uid ; @ SuppressWarnings ( "unchecked" ) protected void setup ( ) { } protected void takeDown ( ) { } public void updateInventory ( final String piece , final int amount ) { } public boolean checkPieceInInventory ( String piece , int amount ) { } @ SuppressWarnings ( "rawtypes" ) public boolean checkWholeInventory ( HashMap < String , Integer > order ) { } @ SuppressWarnings ( "rawtypes" ) public int checkAvailabilityPercentage ( HashMap < String , Integer > order ) { } @ SuppressWarnings ( "rawtypes" ) public void updateWholeInventory ( final HashMap < String , Integer > order ) { } @ SuppressWarnings ( "rawtypes" ) public void updateRequestedInventory ( final HashMap < String , Integer > order ) { } public void initInventory ( String inventoryType ) { } private class OrderRequestServer extends CyclicBehaviour { private static final long serialVersionUID = 1L ; @ SuppressWarnings ( "unchecked" ) public void action ( ) { MessageTemplate template = MessageTemplate . MatchPerformative ( CFP ) ; ACLMessage message = myAgent . receive ( template ) ; if ( message != null ) { System . out . println ( ( ( myAgent . getLocalName ( ) ) + ":<seq2seq4repair_space>Order<seq2seq4repair_space>request<seq2seq4repair_space>received" ) ) ; deregisterService ( ) ; HashMap < String , Integer > mappy ; try { mappy = ( ( HashMap < String , Integer > ) ( message . getContentObject ( ) ) ) ; ACLMessage reply = message . createReply ( ) ; reply . setPerformative ( CFP ) ; int availablePieces = checkAvailabilityPercentage ( mappy ) ; if ( availablePieces > 0 ) { String sAvailablePieces = String . valueOf ( availablePieces ) ; System . out . println ( ( ( myAgent . getLocalName ( ) ) + ":<seq2seq4repair_space>All<seq2seq4repair_space>pieces<seq2seq4repair_space>are<seq2seq4repair_space>available.<seq2seq4repair_space>Sending<seq2seq4repair_space>position..." ) ) ; reply . setPerformative ( PROPOSE ) ; reply . setLanguage ( sAvailablePieces ) ; double [ ] myPosition = position . poseToArray ( ) ; reply . setContentObject ( myPosition ) ; myAgent . send ( reply ) ; try { Thread . sleep ( 10000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } MessageTemplate informTemplate = MessageTemplate . MatchPerformative ( INFORM ) ; ACLMessage informMessage = myAgent . receive ( informTemplate ) ; if ( informMessage != null ) { if ( informMessage . getContent ( ) . matches ( "REREGISTER" ) ) { registerService ( ) ; } else if ( informMessage . getContent ( ) . matches ( "UPDATE-REREGISTER-BE-HAPPY" ) ) { updateRequestedInventory ( mappy ) ; registerService ( ) ; } else if ( informMessage . getContent ( ) . matches ( "YOU-ARE-THE-ONE" ) ) { System . out . println ( "RecibÃ­<seq2seq4repair_space>mensajito<seq2seq4repair_space>que<seq2seq4repair_space>quiere<seq2seq4repair_space>Argen" ) ; String sName = informMessage . getLanguage ( ) ; AID orderID = new AID ( sName , AID . ISGUID ) ; ACLMessage notify = new ACLMessage ( ACLMessage . INFORM ) ; notify . setOntology ( "Check<seq2seq4repair_space>Part<seq2seq4repair_space>List" ) ; notify . addReceiver ( orderID ) ; notify . setContentObject ( inventory ) ; send ( notify ) ; } } else { addBehaviour ( new ShelfAgent . cyclicMessageWaiter ( myAgent , mappy ) ) ; } } else { registerService ( ) ; reply . setPerformative ( REFUSE ) ; reply . setContent ( "Not<seq2seq4repair_space>enough<seq2seq4repair_space>pieces<seq2seq4repair_space>available" ) ; System . out . println ( ( ( myAgent . getLocalName ( ) ) + ":<seq2seq4repair_space>Insufficient<seq2seq4repair_space>pieces" ) ) ; myAgent . send ( reply ) ; } } catch ( UnreadableException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } else { block ( ) ; } } public void registerService ( ) { } public void deregisterService ( ) { } } private class cyclicMessageWaiter extends SimpleBehaviour { private static final long serialVersionUID = 1L ; protected HashMap < String , Integer > order = new HashMap < String , Integer > ( ) ; public cyclicMessageWaiter ( Agent a , HashMap < String , Integer > mappy ) { } public void action ( ) { boolean terminationFlag = false ; while ( ! terminationFlag ) { MessageTemplate informTemplate = MessageTemplate . MatchPerformative ( INFORM ) ; ACLMessage informMessage = myAgent . receive ( informTemplate ) ; if ( informMessage != null ) { if ( informMessage . getContent ( ) . matches ( "REREGISTER" ) ) { terminationFlag = true ; registerService ( ) ; } else if ( informMessage . getContent ( ) . matches ( "UPDATE-REREGISTER-BE-HAPPY" ) ) { updateRequestedInventory ( this . order ) ; terminationFlag = true ; registerService ( ) ; } else if ( informMessage . getContent ( ) . matches ( "YOU-ARE-THE-ONE" ) ) { System . out . println ( "RecibÃ­<seq2seq4repair_space>mensajito<seq2seq4repair_space>que<seq2seq4repair_space>quiere<seq2seq4repair_space>Argen" ) ; try { String sName = informMessage . getLanguage ( ) ; AID orderID = new AID ( sName , AID . ISGUID ) ; <START_BUG> ACLMessage notify = new ACLMessage ( ACLMessage . INFORM ) ; <END_BUG> notify . setOntology ( "Check<seq2seq4repair_space>Part<seq2seq4repair_space>List" ) ; notify . addReceiver ( orderID ) ; notify . setContentObject ( inventory ) ; send ( notify ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } else { block ( ) ; } } } public void registerService ( ) { } @ Override public boolean done ( ) { } } }

Fix:
ACLMessage notify = new ACLMessage ( ACLMessage . REQUEST ) ;