Program: 143482
Project: 143482
Buggy source:
/** 
 * @param message
 */
public void handleMessage(final JSONObject obj){
  startHandlingEvent();
  if (client != null)   J2DBGlobals.setServiceProvider(client);
  try {
    currentWindowName=obj.optString("String_Node_Str");
    String event=obj.getString("String_Node_Str");
switch (event) {
case "String_Node_Str":
{
        String formName=obj.getString("String_Node_Str");
        IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
        if (form instanceof WebGridFormUI && obj.has("String_Node_Str"))         ((WebGridFormUI)form).setCurrentPage(obj.getInt("String_Node_Str"));
        Map<String,Map<String,Object>> properties=form.getAllProperties();
        Map<String,Map<String,Map<String,Object>>> formData=new HashMap<String,Map<String,Map<String,Object>>>();
        formData.put(formName,properties);
        sendChanges(formData);
        break;
      }
case "String_Node_Str":
{
      pushChanges(obj,false);
      break;
    }
case "String_Node_Str":
{
    pushChanges(obj,true);
    break;
  }
case "String_Node_Str":
{
  client.invokeLater(new Runnable(){
    @Override public void run(){
      try {
        String formName=obj.getString("String_Node_Str");
        JSONArray jsargs=obj.getJSONArray("String_Node_Str");
        IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
        WebComponent webComponent=form.getWebComponent(obj.getString("String_Node_Str"));
        String eventType=obj.getString("String_Node_Str");
        Object[] args=new Object[jsargs == null ? 0 : jsargs.length()];
        for (int i=0; jsargs != null && i < jsargs.length(); i++) {
          args[i]=jsargs.get(i);
        }
        String error=null;
        Object result=null;
        if (form instanceof WebGridFormUI && obj.has("String_Node_Str") && !((WebGridFormUI)form).setEditingRowByPkHash(obj.getString("String_Node_Str"))) {
          error="String_Node_Str" + obj.getString("String_Node_Str");
        }
 else {
          pushChanges(obj);
          try {
            result=webComponent.execute(eventType,args);
          }
 catch (          Exception e) {
            Debug.error(e);
            error=e.getMessage();
          }
        }
        if (obj.has("String_Node_Str")) {
          getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),error == null ? result : error,error == null);
        }
      }
 catch (      JSONException|IOException e) {
        Debug.error(e);
      }
    }
  }
);
  break;
}
case "String_Node_Str":
{
IWebFormController form=parseForm(obj);
if (form != null) {
  ((WebFormController)form).setReadOnly(obj.getBoolean("String_Node_Str"));
}
break;
}
case "String_Node_Str":
{
IWebFormController form=parseForm(obj);
if (form != null) {
((WebFormController)form).setComponentEnabled(obj.getBoolean("String_Node_Str"));
}
break;
}
case "String_Node_Str":
{
client.invokeLater(new Runnable(){
@Override public void run(){
try {
  IWebFormController form=parseForm(obj);
  List<Runnable> invokeLaterRunnables=new ArrayList<Runnable>();
  boolean isVisible=obj.getBoolean("String_Node_Str");
  boolean ok=form.notifyVisible(isVisible,invokeLaterRunnables);
  if (ok && obj.has("String_Node_Str") && !obj.isNull("String_Node_Str")) {
    IWebFormController parentForm=client.getFormManager().getForm(obj.getString("String_Node_Str"));
    WebComponent containerComponent=parentForm.getFormUI().getWebComponent(obj.getString("String_Node_Str"));
    if (containerComponent != null) {
      containerComponent.updateVisibleForm(form.getFormUI(),isVisible,obj.optInt("String_Node_Str"));
    }
    if (obj.has("String_Node_Str") && !obj.isNull("String_Node_Str")) {
      FoundSet parentFs=parentForm.getFormModel();
      IRecordInternal selectedRecord=(IRecordInternal)parentFs.getSelectedRecord();
      form.loadRecords(selectedRecord.getRelatedFoundSet(obj.getString("String_Node_Str")));
    }
  }
  Utils.invokeLater(client,invokeLaterRunnables);
  getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),Boolean.valueOf(ok),true);
}
 catch (Exception e) {
  Debug.error(e);
  try {
    getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),e.getMessage(),false);
  }
 catch (  IOException|JSONException e1) {
    Debug.error(e1);
  }
}
}
}
);
break;
}
case "String_Node_Str":
{
String formName=obj.getString("String_Node_Str");
IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
WebComponent webComponent=form.getWebComponent(obj.getString("String_Node_Str"));
Object property=webComponent.getProperty(obj.getString("String_Node_Str"));
LookupListModel lstModel=null;
if (property instanceof CustomValueList) {
lstModel=new LookupListModel(client,(CustomValueList)property);
webComponent.putProperty(obj.getString("String_Node_Str"),lstModel);
}
 else if (property instanceof LookupValueList) {
lstModel=new LookupListModel(client,(LookupValueList)property);
webComponent.putProperty(obj.getString("String_Node_Str"),lstModel);
}
 else if (property instanceof LookupListModel) {
lstModel=(LookupListModel)property;
}
if (lstModel != null) {
lstModel.fill(null,null,obj.getString("String_Node_Str"),false);
}
break;
}
}
}
 catch (Exception e) {
Debug.error(e);
}
 finally {
stopHandlingEvent();
J2DBGlobals.setServiceProvider(null);
}
}

Fixed version (ground truth):
/** 
 * @param message
 */
public void handleMessage(final JSONObject obj){
  startHandlingEvent();
  if (client != null)   J2DBGlobals.setServiceProvider(client);
  try {
    currentWindowName=obj.optString("String_Node_Str");
    String event=obj.getString("String_Node_Str");
switch (event) {
case "String_Node_Str":
{
        String formName=obj.getString("String_Node_Str");
        IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
        if (form instanceof WebGridFormUI) {
          WebGridFormUI grid=(WebGridFormUI)form;
          if (obj.has("String_Node_Str"))           grid.setCurrentPage(obj.getInt("String_Node_Str"));
          if (obj.has("String_Node_Str"))           grid.setPageSize(obj.getInt("String_Node_Str"));
        }
        Map<String,Map<String,Object>> properties=form.getAllProperties();
        Map<String,Map<String,Map<String,Object>>> formData=new HashMap<String,Map<String,Map<String,Object>>>();
        formData.put(formName,properties);
        sendChanges(formData);
        break;
      }
case "String_Node_Str":
{
      pushChanges(obj,false);
      break;
    }
case "String_Node_Str":
{
    pushChanges(obj,true);
    break;
  }
case "String_Node_Str":
{
  client.invokeLater(new Runnable(){
    @Override public void run(){
      try {
        String formName=obj.getString("String_Node_Str");
        JSONArray jsargs=obj.getJSONArray("String_Node_Str");
        IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
        WebComponent webComponent=form.getWebComponent(obj.getString("String_Node_Str"));
        String eventType=obj.getString("String_Node_Str");
        Object[] args=new Object[jsargs == null ? 0 : jsargs.length()];
        for (int i=0; jsargs != null && i < jsargs.length(); i++) {
          args[i]=jsargs.get(i);
        }
        String error=null;
        Object result=null;
        if (form instanceof WebGridFormUI && obj.has("String_Node_Str") && !((WebGridFormUI)form).setEditingRowByPkHash(obj.getString("String_Node_Str"))) {
          error="String_Node_Str" + obj.getString("String_Node_Str");
        }
 else {
          pushChanges(obj);
          try {
            result=webComponent.execute(eventType,args);
          }
 catch (          Exception e) {
            Debug.error(e);
            error=e.getMessage();
          }
        }
        if (obj.has("String_Node_Str")) {
          getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),error == null ? result : error,error == null);
        }
      }
 catch (      JSONException|IOException e) {
        Debug.error(e);
      }
    }
  }
);
  break;
}
case "String_Node_Str":
{
IWebFormController form=parseForm(obj);
if (form != null) {
  ((WebFormController)form).setReadOnly(obj.getBoolean("String_Node_Str"));
}
break;
}
case "String_Node_Str":
{
IWebFormController form=parseForm(obj);
if (form != null) {
((WebFormController)form).setComponentEnabled(obj.getBoolean("String_Node_Str"));
}
break;
}
case "String_Node_Str":
{
client.invokeLater(new Runnable(){
@Override public void run(){
try {
  IWebFormController form=parseForm(obj);
  List<Runnable> invokeLaterRunnables=new ArrayList<Runnable>();
  boolean isVisible=obj.getBoolean("String_Node_Str");
  boolean ok=form.notifyVisible(isVisible,invokeLaterRunnables);
  if (ok && obj.has("String_Node_Str") && !obj.isNull("String_Node_Str")) {
    IWebFormController parentForm=client.getFormManager().getForm(obj.getString("String_Node_Str"));
    WebComponent containerComponent=parentForm.getFormUI().getWebComponent(obj.getString("String_Node_Str"));
    if (containerComponent != null) {
      containerComponent.updateVisibleForm(form.getFormUI(),isVisible,obj.optInt("String_Node_Str"));
    }
    if (obj.has("String_Node_Str") && !obj.isNull("String_Node_Str")) {
      FoundSet parentFs=parentForm.getFormModel();
      IRecordInternal selectedRecord=(IRecordInternal)parentFs.getSelectedRecord();
      form.loadRecords(selectedRecord.getRelatedFoundSet(obj.getString("String_Node_Str")));
    }
  }
  Utils.invokeLater(client,invokeLaterRunnables);
  getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),Boolean.valueOf(ok),true);
}
 catch (Exception e) {
  Debug.error(e);
  try {
    getActiveWebsocketEndpoint().sendResponse(obj.get("String_Node_Str"),e.getMessage(),false);
  }
 catch (  IOException|JSONException e1) {
    Debug.error(e1);
  }
}
}
}
);
break;
}
case "String_Node_Str":
{
String formName=obj.getString("String_Node_Str");
IWebFormUI form=client.getFormManager().getForm(formName).getFormUI();
WebComponent webComponent=form.getWebComponent(obj.getString("String_Node_Str"));
Object property=webComponent.getProperty(obj.getString("String_Node_Str"));
LookupListModel lstModel=null;
if (property instanceof CustomValueList) {
lstModel=new LookupListModel(client,(CustomValueList)property);
webComponent.putProperty(obj.getString("String_Node_Str"),lstModel);
}
 else if (property instanceof LookupValueList) {
lstModel=new LookupListModel(client,(LookupValueList)property);
webComponent.putProperty(obj.getString("String_Node_Str"),lstModel);
}
 else if (property instanceof LookupListModel) {
lstModel=(LookupListModel)property;
}
if (lstModel != null) {
lstModel.fill(null,null,obj.getString("String_Node_Str"),false);
}
break;
}
}
}
 catch (Exception e) {
Debug.error(e);
}
 finally {
stopHandlingEvent();
J2DBGlobals.setServiceProvider(null);
}
}