Buggy code:
public class EQMessageAgent extends Agent { private String insertJSON = "{\n\t\"command\":<seq2seq4repair_space>\"INSERT_MODULE\",\n\t\"modules\":<seq2seq4repair_space>[{\n\t\t\"manufacturer\":<seq2seq4repair_space>\"HU\",\n\t\t\"typeNumber\":<seq2seq4repair_space>\"delta_robot_type_B\",\n\t\t\"serialNumber\":<seq2seq4repair_space>\"1\"\n\t},<seq2seq4repair_space>{\n\t\t\"manufacturer\":<seq2seq4repair_space>\"HU\",\n\t\t\"typeNumber\":<seq2seq4repair_space>\"gripper_type_A\",\n\t\t\"serialNumber\":<seq2seq4repair_space>\"1\"\n\t},<seq2seq4repair_space>]\n}" ; private String deleteJSON = "{\n\t\"command\":<seq2seq4repair_space>\"DELETE_MODULE\",\n\t\"modules\":<seq2seq4repair_space>[{\n\t\t\"manufacturer\":<seq2seq4repair_space>\"HU\",\n\t\t\"typeNumber\":<seq2seq4repair_space>\"delta_robot_type_B\",\n\t\t\"serialNumber\":<seq2seq4repair_space>\"1\"\n\t},<seq2seq4repair_space>{\n\t\t\"manufacturer\":<seq2seq4repair_space>\"HU\",\n\t\t\"typeNumber\":<seq2seq4repair_space>\"gripper_type_A\",\n\t\t\"serialNumber\":<seq2seq4repair_space>\"1\"\n\t},<seq2seq4repair_space>]\n}" ; private String getAllStates = "{\"command\":<seq2seq4repair_space>\"GET_ALL_POSIBLE_STATES\"}" ; private String getAllModes = "{\"command\":<seq2seq4repair_space>\"GET_ALL_POSIBLE_MODES\"}" ; private String getState = "{\"command\":<seq2seq4repair_space>\"GET_CURRENT_EQUIPLET_STATE\"}" ; private String getSchedule = "{\"command\":<seq2seq4repair_space>\"GET_SCHEDULE\"}" ; private String getMode = "{\"command\":<seq2seq4repair_space>\"GET_CURRENT_MAST_MODE\"}" ; private String registerMastState = "{\"command\":<seq2seq4repair_space>\"ON_EQUIPLET_STATE_CHANGED\",<seq2seq4repair_space>\"action\":<seq2seq4repair_space>\"REGISTER_LISTENER\"}" ; private static final long serialVersionUID = 1L ; public void setup ( ) { this . addBehaviour ( new CyclicBehaviour ( ) { private static final long serialVersionUID = 1L ; public void action ( ) { ACLMessage msg = this . myAgent . receive ( ) ; if ( msg != null ) { Logger . log ( ( ( ( ( ( ( ( msg . getSender ( ) . getLocalName ( ) ) + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ( this . myAgent . getLocalName ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( msg . getContent ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( ACLMessage . getPerformative ( msg . getPerformative ( ) ) ) ) ) ; } } } ) ; <START_BUG> boolean testMastStateChange = true ; <END_BUG> boolean getModuleList = false ; boolean getAllStateTest = false ; boolean scheduleTest = false ; boolean addRemoveModules = false ; if ( testMastStateChange ) { sleep ( 15000 ) ; sendOnChangeRequest ( registerMastState ) ; sendGetData ( getState ) ; sleep ( 5000 ) ; sendCommand ( "{\"command\":<seq2seq4repair_space>\"CHANGE_EQUIPLET_MACHINE_STATE\",<seq2seq4repair_space>\"state\":<seq2seq4repair_space>\"SAFE\"}" ) ; sleep ( 3500 ) ; sendGetData ( getState ) ; sleep ( 3000 ) ; sendCommand ( "{\"command\":<seq2seq4repair_space>\"CHANGE_EQUIPLET_MACHINE_STATE\",<seq2seq4repair_space>\"state\":<seq2seq4repair_space>\"OFFLINE\"}" ) ; } if ( getModuleList ) { sendCommand ( insertJSON ) ; sleep ( 5000 ) ; sendGetData ( "{\"command\":<seq2seq4repair_space>\"GET_ALL_MODULES\"}" ) ; sleep ( 5000 ) ; sendCommand ( deleteJSON ) ; sleep ( 5000 ) ; sendGetData ( "{\"command\":<seq2seq4repair_space>\"GET_ALL_MODULES\"}" ) ; } if ( getAllStateTest ) { sendGetData ( getAllStates ) ; sleep ( 5000 ) ; sendGetData ( getAllModes ) ; sleep ( 5000 ) ; sendGetData ( getMode ) ; sleep ( 5000 ) ; } if ( scheduleTest ) { try { addScheduleJob ( Parser . parseScheduleRequest ( new ArrayList < MAS . product . ProductionStep > ( ) , new Tick ( 50 ) ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } sleep ( 5000 ) ; sendGetData ( getSchedule ) ; sleep ( 5000 ) ; } if ( addRemoveModules ) { sendCommand ( "{\"command\":<seq2seq4repair_space>\"CHANGE_EQUIPLET_MACHINE_STATE\",<seq2seq4repair_space>\"state\":<seq2seq4repair_space>\"SAFE\"}" ) ; sendCommand ( "{\"command\":<seq2seq4repair_space>\"CHANGE_EQUIPLET_MACHINE_STATE\",<seq2seq4repair_space>\"state\":<seq2seq4repair_space>\"NORMAL\"}" ) ; sleep ( 5000 ) ; sendCommand ( insertJSON ) ; sleep ( 5000 ) ; sendCommand ( "{\"command\":<seq2seq4repair_space>\"CHANGE_EQUIPLET_MACHINE_STATE\",<seq2seq4repair_space>\"state\":<seq2seq4repair_space>\"SAFE\"}" ) ; sleep ( 5000 ) ; sendCommand ( insertJSON ) ; sleep ( 5000 ) ; sendCommand ( deleteJSON ) ; } } public void takeDown ( ) { } public void sendCommand ( String data ) { } public void sendGetData ( String data ) { } public void sendOnChangeRequest ( String data ) { } public AID [ ] searchDF ( String service ) { } public void addScheduleJob ( String data ) { } public void sleep ( int ms ) { } }

Fix:
boolean testMastStateChange = false ;