nus-yam/ex-repair huggingface dataset:
Program: 145511
Project: 145511
Buggy source:
private void showHint(Point aPoint){
  if (aPoint != null) {
    try {
      Point2D.Double cartPt=map.getPane().awtScreen2Cartesian(aPoint);
      Point2D.Double goePt=map.getPane().cartesian2Geo(cartPt);
      com.vividsolutions.jts.geom.Point pt=GisUtilities.createPoint(goePt);
      List<SelectionEntry> geoms=map.nonSelectableHit(pt);
      if (geoms != null && geoms.size() > 0) {
        String hintText=map.beforeToolTipShow(geoms.get(0).getRow(),geoms.get(0).getEntity());
        if (hintText != null && !hintText.isEmpty()) {
          hint.setToolTipText(hintText);
          map.getPane().add(hint,pt,0);
          map.getPane().repaint();
        }
      }
 else {
        map.getPane().remove(hint);
        map.getPane().repaint();
      }
    }
 catch (    Exception ex) {
      Logger.getLogger(MouseCursorer.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}

Fixed version (ground truth):
private void showHint(Point aPoint){
  if (aPoint != null) {
    try {
      Point2D.Double cartPt=map.getPane().awtScreen2Cartesian(aPoint);
      Point2D.Double goePt=map.getPane().cartesian2Geo(cartPt);
      com.vividsolutions.jts.geom.Point pt=GeometryUtils.createPoint(goePt);
      List<SelectionEntry> geoms=map.nonSelectableHit(pt);
      if (geoms != null && geoms.size() > 0) {
        String hintText=map.beforeToolTipShow(geoms.get(0).getRow(),geoms.get(0).getEntity());
        if (hintText != null && !hintText.isEmpty()) {
          hint.setToolTipText(hintText);
          map.getPane().add(hint,pt,0);
          map.getPane().repaint();
        }
      }
 else {
        map.getPane().remove(hint);
        map.getPane().repaint();
      }
    }
 catch (    Exception ex) {
      Logger.getLogger(MouseCursorer.class.getName()).log(Level.SEVERE,null,ex);
    }
  }
}
Program: 145512
Project: 145512
Buggy source:
@Override protected boolean isBeginDragValid() throws Exception {
  Point2D.Double cartesianPt=pane.awtScreen2Cartesian(mouseDown);
  Point2D.Double geoPt=pane.cartesian2Geo(cartesianPt);
  return !map.selectedPointHitted(GisUtilities.createPoint(geoPt));
}

Fixed version (ground truth):
@Override protected boolean isBeginDragValid() throws Exception {
  Point2D.Double cartesianPt=pane.awtScreen2Cartesian(mouseDown);
  Point2D.Double geoPt=pane.cartesian2Geo(cartesianPt);
  return !map.selectedPointHitted(GeometryUtils.createPoint(geoPt));
}
Program: 145513
Project: 145513
Buggy source:
public void updatePreferences(){
  try {
    Preferences connectionsPref=Preferences.userRoot().node(ClientFactory.CONNECTIONS_SETTINGS_NODE);
    connectionsPref.removeNode();
    connectionsPref=Preferences.userRoot().node(ClientFactory.CONNECTIONS_SETTINGS_NODE);
    for (int i=0; i < connectionsListModel.getSize(); i++) {
      ConnectionSettings settings=(ConnectionSettings)connectionsListModel.getElementAt(i);
      if (settings.isEditable()) {
        String strIndex=String.valueOf(i);
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_TITLE_SETTING,settings.getName() != null ? settings.getName() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_URL_SETTING,settings.getUrl() != null ? settings.getUrl() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_USER_SETTING,settings.getUser() != null ? settings.getUser() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_PASSWORD_SETTING,settings.getPassword() != null ? settings.getPassword() : "String_Node_Str");
      }
    }
  }
 catch (  BackingStoreException ex) {
    exSupport.exceptionThrown(ex);
  }
}

Fixed version (ground truth):
public void updatePreferences(){
  try {
    Preferences connectionsPref=Preferences.userRoot().node(ClientFactory.CONNECTIONS_SETTINGS_NODE);
    connectionsPref.removeNode();
    connectionsPref=Preferences.userRoot().node(ClientFactory.CONNECTIONS_SETTINGS_NODE);
    int defaultSettingsIndex=-1;
    for (int i=0; i < connectionsListModel.getSize(); i++) {
      ConnectionSettings settings=(ConnectionSettings)connectionsListModel.getElementAt(i);
      if (settings == ClientFactory.getDefaultSettings()) {
        defaultSettingsIndex=i;
      }
      if (settings.isEditable()) {
        String strIndex=String.valueOf(i);
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_TITLE_SETTING,settings.getName() != null ? settings.getName() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_URL_SETTING,settings.getUrl() != null ? settings.getUrl() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_USER_SETTING,settings.getUser() != null ? settings.getUser() : "String_Node_Str");
        connectionsPref.node(strIndex).put(ClientFactory.CONNECTION_PASSWORD_SETTING,settings.getPassword() != null ? settings.getPassword() : "String_Node_Str");
      }
    }
    if (defaultSettingsIndex != -1) {
      Preferences.userRoot().node(SETTINGS_NODE).putInt(DEFAULT_CONNECTION_INDEX_SETTING,defaultSettingsIndex);
    }
  }
 catch (  BackingStoreException ex) {
    exSupport.exceptionThrown(ex);
  }
}
Program: 145514
Project: 145514
Buggy source:
private void updateCredentialsControls(){
  ConnectionSettings selectedSettings=(ConnectionSettings)lstConnections.getSelectedValue();
  if (selectedSettings != null) {
    tfUserName.setText(selectedSettings.getUser());
    tfPassword.setText(selectedSettings.getPassword());
  }
  if (tfUserName.getText() != null && !tfUserName.getText().isEmpty()) {
    tfPassword.requestFocus();
  }
}

Fixed version (ground truth):
private void updateCredentialsControls(){
  ConnectionSettings selectedSettings=(ConnectionSettings)lstConnections.getSelectedValue();
  if (selectedSettings != null) {
    tfUserName.setText(selectedSettings.getUser());
    tfPassword.setText(selectedSettings.getPassword());
  }
  if (tfUserName.getText() != null && !tfUserName.getText().isEmpty()) {
    tfPassword.requestFocus();
  }
  if (tfPassword.getPassword() != null && tfPassword.getPassword().length > 0) {
    checkRememberPassword.setSelected(true);
  }
}
Program: 145515
Project: 145515
Buggy source:
public static void readSettings() throws Exception {
  settings=null;
  defaultSettings=null;
  int defaultConnectionIndex=Preferences.userRoot().node(SETTINGS_NODE).getInt(DEFAULT_CONNECTION_INDEX_SETTING,0);
  if (defaultConnectionIndex < 0) {
    defaultConnectionIndex=0;
  }
  Map<String,ConnectionSettings> settingsMap=new TreeMap<>();
  Preferences userConnectionsPrefs=Preferences.userRoot().node(CONNECTIONS_SETTINGS_NODE);
  settingsNodeToSettings(userConnectionsPrefs,settingsMap,true);
  if (settingsMap.isEmpty()) {
    Preferences defaultConnectionsPrefs=Preferences.systemRoot().node(CONNECTIONS_SETTINGS_NODE);
    try {
      settingsNodeToSettings(defaultConnectionsPrefs,settingsMap,false);
    }
 catch (    Exception ex) {
      Logger.getLogger(ClientFactory.class.getName()).log(Level.SEVERE,ex.getMessage(),ex);
    }
  }
  settings=new ConnectionSettings[settingsMap.size()];
  int i=0;
  for (  String connNodeName : settingsMap.keySet()) {
    settings[i++]=settingsMap.get(connNodeName);
  }
  if (settings.length > 0) {
    if (defaultConnectionIndex >= settings.length) {
      defaultConnectionIndex=settings.length - 1;
    }
    if (defaultConnectionIndex < 0) {
      defaultConnectionIndex=0;
    }
    defaultSettings=settings[defaultConnectionIndex];
  }
 else {
    defaultSettings=null;
  }
}

Fixed version (ground truth):
public static void readSettings() throws Exception {
  settings=null;
  defaultSettings=null;
  int defaultConnectionIndex=Preferences.userRoot().node(SETTINGS_NODE).getInt(DEFAULT_CONNECTION_INDEX_SETTING,0);
  if (defaultConnectionIndex < 0) {
    defaultConnectionIndex=0;
  }
  Map<Integer,ConnectionSettings> settingsMap=new TreeMap<>();
  Preferences userConnectionsPrefs=Preferences.userRoot().node(CONNECTIONS_SETTINGS_NODE);
  settingsNodeToSettings(userConnectionsPrefs,settingsMap,true);
  if (settingsMap.isEmpty()) {
    Preferences defaultConnectionsPrefs=Preferences.systemRoot().node(CONNECTIONS_SETTINGS_NODE);
    try {
      settingsNodeToSettings(defaultConnectionsPrefs,settingsMap,false);
    }
 catch (    Exception ex) {
      Logger.getLogger(ClientFactory.class.getName()).log(Level.SEVERE,ex.getMessage(),ex);
    }
  }
  settings=new ConnectionSettings[settingsMap.size()];
  int i=0;
  for (  Integer connNodeName : settingsMap.keySet()) {
    settings[i++]=settingsMap.get(connNodeName);
  }
  if (settings.length > 0) {
    if (defaultConnectionIndex >= settings.length) {
      defaultConnectionIndex=settings.length - 1;
    }
    if (defaultConnectionIndex < 0) {
      defaultConnectionIndex=0;
    }
    defaultSettings=settings[defaultConnectionIndex];
  }
 else {
    defaultSettings=null;
  }
}
Program: 145516
Project: 145516
Buggy source:
private static void settingsNodeToSettings(Preferences connectionsPrefs,Map<String,ConnectionSettings> settingsMap,boolean aEditable) throws Exception {
  String[] settingsNodesNames=connectionsPrefs.childrenNames();
  for (int i=0; i < settingsNodesNames.length; i++) {
    Preferences connectionPrefs=connectionsPrefs.node(settingsNodesNames[i]);
    String connUrl=connectionPrefs.get(ClientFactory.CONNECTION_URL_SETTING,"String_Node_Str");
    connUrl=connUrl.replaceAll("String_Node_Str","String_Node_Str");
    ConnectionSettings connectionsettings=new PlatypusConnectionSettings();
    settingsMap.put(settingsNodesNames[i],connectionsettings);
    connectionsettings.setUrl(connUrl);
    connectionsettings.setName(connectionPrefs.get(ClientFactory.CONNECTION_TITLE_SETTING,"String_Node_Str"));
    connectionsettings.setUser(connectionPrefs.get(ClientFactory.CONNECTION_USER_SETTING,"String_Node_Str"));
    connectionsettings.setPassword(connectionPrefs.get(ClientFactory.CONNECTION_PASSWORD_SETTING,"String_Node_Str"));
    connectionsettings.setEditable(aEditable);
  }
}

Fixed version (ground truth):
private static void settingsNodeToSettings(Preferences connectionsPrefs,Map<Integer,ConnectionSettings> settingsMap,boolean aEditable) throws Exception {
  String[] settingsNodesNames=connectionsPrefs.childrenNames();
  for (int i=0; i < settingsNodesNames.length; i++) {
    Preferences connectionPrefs=connectionsPrefs.node(settingsNodesNames[i]);
    String connUrl=connectionPrefs.get(ClientFactory.CONNECTION_URL_SETTING,"String_Node_Str");
    connUrl=connUrl.replaceAll("String_Node_Str","String_Node_Str");
    ConnectionSettings connectionsettings=new PlatypusConnectionSettings();
    settingsMap.put(Integer.valueOf(settingsNodesNames[i]),connectionsettings);
    connectionsettings.setUrl(connUrl);
    connectionsettings.setName(connectionPrefs.get(ClientFactory.CONNECTION_TITLE_SETTING,"String_Node_Str"));
    connectionsettings.setUser(connectionPrefs.get(ClientFactory.CONNECTION_USER_SETTING,"String_Node_Str"));
    connectionsettings.setPassword(connectionPrefs.get(ClientFactory.CONNECTION_PASSWORD_SETTING,"String_Node_Str"));
    connectionsettings.setEditable(aEditable);
  }
}
Program: 145517
Project: 145517
Buggy source:
public static void startDebugging(DebuggerEnvironment env) throws Exception {
  Breakpoint[] breaks=DebuggerManager.getDebuggerManager().getBreakpoints();
  for (  Breakpoint breakPoint : breaks) {
    if (breakPoint instanceof PlatypusBreakpoint) {
      PlatypusBreakpoint pBreak=(PlatypusBreakpoint)breakPoint;
      pBreak.remoteAdd(env.mBreakpoints);
    }
  }
  env.mDebuggerListener.debuggingStarted=true;
  env.mDebuggerListener.running=true;
}

Fixed version (ground truth):
public static void startDebugging(DebuggerEnvironment env) throws Exception {
  Breakpoint[] breaks=DebuggerManager.getDebuggerManager().getBreakpoints();
  for (  Breakpoint breakPoint : breaks) {
    if (breakPoint instanceof PlatypusBreakpoint) {
      PlatypusBreakpoint pBreak=(PlatypusBreakpoint)breakPoint;
      pBreak.remoteAdd(env.mBreakpoints);
    }
  }
  env.mDebuggerListener.debuggingStarted=true;
  env.mDebugger.continueRun();
  env.mDebuggerListener.running=true;
}
Program: 145518
Project: 145518
Buggy source:
protected void organizeLeft(){
  BorderLayoutData layoutData=new BorderLayoutData(dividerLocation);
  layoutData.setCollapsible(oneTouchExpandable);
  layoutData.setCollapseMini(oneTouchExpandable);
  layoutData.setCollapseHidden(oneTouchExpandable);
  layoutData.setSplit(true);
  setWestWidget(null);
  setNorthWidget(null);
  if (leftComponent != null) {
    ContentPanel cp=new ContentPanel();
    cp.setCollapsible(true);
    cp.setHideCollapseTool(true);
    cp.setHeaderVisible(false);
    cp.setBorders(false);
    cp.setBodyBorder(false);
    cp.getBody().getStyle().setBackgroundColor("String_Node_Str");
    cp.addResizeHandler(new ResizeHandler(){
      @Override public void onResize(      ResizeEvent event){
        if (orientation == HORIZONTAL_SPLIT)         dividerLocation=event.getWidth();
 else         dividerLocation=event.getHeight();
      }
    }
);
    if (orientation == HORIZONTAL_SPLIT) {
      layoutData.setMargins(new Margins(0,dividerSize,0,0));
      setWestWidget(cp,layoutData);
    }
 else {
      layoutData.setMargins(new Margins(0,0,dividerSize,0));
      setNorthWidget(cp,layoutData);
    }
    cp.addBeforeCollapseHandler(collapseHandler);
    cp.addBeforeExpandHandler(collapseHandler);
    leftComponent.getElement().getStyle().setOverflow(Style.Overflow.HIDDEN);
    cp.setWidget(leftComponent);
  }
  if (isAttached()) {
    Scheduler.get().scheduleDeferred(new ScheduledCommand(){
      @Override public void execute(){
        forceLayout();
      }
    }
);
  }
}

Fixed version (ground truth):
protected void organizeLeft(){
  BorderLayoutData layoutData=new BorderLayoutData(dividerLocation);
  layoutData.setCollapsible(oneTouchExpandable);
  layoutData.setCollapseMini(oneTouchExpandable);
  layoutData.setCollapseHidden(oneTouchExpandable);
  layoutData.setSplit(true);
  setWestWidget(null);
  setNorthWidget(null);
  if (leftComponent != null) {
    ContentPanel cp=new ContentPanel();
    cp.setCollapsible(true);
    cp.setHideCollapseTool(true);
    cp.setHeaderVisible(false);
    cp.setBorders(false);
    cp.setBodyBorder(false);
    cp.getBody().getStyle().setBackgroundColor("String_Node_Str");
    cp.addResizeHandler(new ResizeHandler(){
      @Override public void onResize(      ResizeEvent event){
        if (orientation == HORIZONTAL_SPLIT)         dividerLocation=event.getWidth();
 else         dividerLocation=event.getHeight();
      }
    }
);
    if (orientation == HORIZONTAL_SPLIT) {
      layoutData.setMargins(new Margins(0,dividerSize,0,0));
      setWestWidget(cp,layoutData);
    }
 else {
      layoutData.setMargins(new Margins(0,0,dividerSize,0));
      setNorthWidget(cp,layoutData);
    }
    if (cp.isRendered()) {
      cp.addBeforeCollapseHandler(collapseHandler);
      cp.addBeforeExpandHandler(collapseHandler);
    }
    leftComponent.getElement().getStyle().setOverflow(Style.Overflow.HIDDEN);
    cp.setWidget(leftComponent);
  }
  if (isAttached()) {
    Scheduler.get().scheduleDeferred(new ScheduledCommand(){
      @Override public void execute(){
        forceLayout();
      }
    }
);
  }
}
Program: 145519
Project: 145519
Buggy source:
@Override public void onBeforeExpand(BeforeExpandEvent event){
}

Fixed version (ground truth):
@Override public void onBeforeExpand(BeforeExpandEvent event){
  event.setCancelled(true);
  onExpand((ContentPanel)event.getSource());
}
Program: 145520
Project: 145520
Buggy source:
@Override public void onBeforeCollapse(BeforeCollapseEvent event){
}

Fixed version (ground truth):
@Override public void onBeforeCollapse(BeforeCollapseEvent event){
  event.setCancelled(true);
  onCollapse((ContentPanel)event.getSource());
}
Program: 145521
Project: 145521
Buggy source:
public synchronized ScriptRunner get(String aModuleId) throws Exception {
  ScriptRunner runner=cache.get(aModuleId);
  if (runner != null && !app.getClient().getAppCache().isActual(runner.getApplicationElementId(),runner.getTxtContentLength(),runner.getTxtCrc32())) {
    runner=null;
    cache.remove(aModuleId);
    app.getClient().getAppCache().remove(aModuleId);
  }
  if (runner == null) {
    runner=new ScriptRunner(aModuleId,app.getClient(),ScriptRunner.initializePlatypusStandardLibScope(),app,app,new Object[]{});
    cache.put(aModuleId,runner);
  }
  return runner;
}

Fixed version (ground truth):
public synchronized ScriptRunner get(String aModuleId) throws Exception {
  ScriptRunner runner=cache.get(aModuleId);
  if (runner != null && !app.getClient().getAppCache().isActual(runner.getApplicationElementId(),runner.getTxtContentLength(),runner.getTxtCrc32())) {
    runner=null;
    cache.remove(aModuleId);
    app.getClient().getAppCache().remove(aModuleId);
  }
  if (runner == null) {
    runner=new ScriptRunner(aModuleId,app.getClient(),ScriptRunner.initializePlatypusStandardLibScope(),app,app,new Object[]{});
    runner.setPrototype(ScriptRunnerPrototype.getInstance());
    runner.execute();
    cache.put(aModuleId,runner);
  }
  return runner;
}
Program: 145522
Project: 145522
Buggy source:
@Override protected void resolveRelation(Relation<E> aRelation,Model<E,P,C,Q> aModel) throws Exception {
  super.resolveRelation(aRelation,aModel);
  if (aRelation instanceof ReferenceRelation<?>) {
    if (aRelation.getLeftField() != null && !aRelation.getLeftField().isFk()) {
      aRelation.setLeftField(null);
    }
    if (aRelation.getRightField() != null && !aRelation.getRightField().isPk()) {
      aRelation.setRightField(null);
    }
    if (aRelation.getLeftField() != null && aRelation.getLeftField().isFk() && aRelation.getRightField() != null && aRelation.getRightField().isPk()) {
      String leftTableName=aRelation.getLeftField().getFk().getReferee().getTable();
      String leftFieldName=aRelation.getLeftField().getFk().getReferee().getField();
      String rightTableName=aRelation.getRightField().getTableName();
      String rightFieldName=aRelation.getRightField().getName();
      boolean tablesSame=(leftTableName == null ? rightTableName == null : leftTableName.equalsIgnoreCase(rightTableName));
      boolean fieldsSame=(leftFieldName == null ? rightFieldName == null : leftFieldName.equalsIgnoreCase(rightFieldName));
      if (!tablesSame || !fieldsSame) {
        aRelation.setLeftField(null);
        aRelation.setRightField(null);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void resolveRelation(Relation<E> aRelation,Model<E,P,C,Q> aModel) throws Exception {
  super.resolveRelation(aRelation,aModel);
  if (aRelation instanceof ReferenceRelation<?>) {
    if (aRelation.getLeftField() != null && !aRelation.getLeftField().isFk()) {
      aRelation.setLeftField(null);
    }
    if (aRelation.getRightField() != null && !aRelation.getRightField().isPk()) {
      aRelation.setRightField(null);
    }
    if (aRelation.getLeftField() != null && aRelation.getLeftField().isFk() && aRelation.getRightField() != null && aRelation.getRightField().isPk()) {
      String leftTableName=aRelation.getLeftField().getFk().getReferee().getTable();
      String leftFieldName=aRelation.getLeftField().getFk().getReferee().getField();
      String rightTableName=aRelation.getRightField().getTableName();
      String rightFieldName=aRelation.getRightField().getOriginalName();
      boolean tablesSame=(leftTableName == null ? rightTableName == null : leftTableName.equalsIgnoreCase(rightTableName));
      boolean fieldsSame=(leftFieldName == null ? rightFieldName == null : leftFieldName.equalsIgnoreCase(rightFieldName));
      if (!tablesSame || !fieldsSame) {
        aRelation.setLeftField(null);
        aRelation.setRightField(null);
      }
    }
  }
}
Program: 145523
Project: 145523
Buggy source:
@Override public Model<E,P,C,Q> copy() throws Exception {
  Model<E,P,C,Q> copied=super.copy();
  for (  ReferenceRelation<E> relation : referenceRelations) {
    ReferenceRelation<E> rcopied=(ReferenceRelation<E>)relation.copy();
    resolveRelation(rcopied,copied);
    ((ApplicationModel<E,P,C,Q>)copied).getReferenceRelations().add(rcopied);
  }
  return copied;
}

Fixed version (ground truth):
@Override public Model<E,P,C,Q> copy() throws Exception {
  Model<E,P,C,Q> copied=super.copy();
  for (  ReferenceRelation<E> relation : referenceRelations) {
    ReferenceRelation<E> rcopied=(ReferenceRelation<E>)relation.copy();
    resolveRelation(rcopied,copied);
    ((ApplicationModel<E,P,C,Q>)copied).getReferenceRelations().add(rcopied);
  }
  ((ApplicationModel<E,P,C,Q>)copied).checkReferenceRelationsIntegrity();
  return copied;
}
Program: 145524
Project: 145524
Buggy source:
@Override public Object run(Context cx) throws Exception {
  Map<String,Collection<String>> lvalidators=new HashMap<>();
  lvalidators.putAll(validators);
  Collection<String> flowAsValidator=lvalidators.get(aDatasourceId);
  if (flowAsValidator == null || flowAsValidator.isEmpty()) {
    lvalidators.put(aDatasourceId,Arrays.asList(new String[]{aDatasourceId}));
  }
  for (  String validatorName : lvalidators.keySet()) {
    Collection<String> datasources=lvalidators.get(validatorName);
    if (datasources == null || datasources.isEmpty() || datasources.contains(aDatasourceId)) {
      ScriptRunner validator=createModule(cx,validatorName);
      if (validator != null) {
        Object oValidate=validator.get("String_Node_Str",validator);
        if (oValidate instanceof Function) {
          Function fValidate=(Function)oValidate;
          Object oResult=fValidate.call(cx,validator.getParentScope(),validator,new Object[]{Context.javaToJS(aLog.toArray(),validator.getParentScope()),aDatasourceId,aSessionId});
          if (oResult != null && oResult != Context.getUndefinedValue() && Boolean.FALSE.equals(Context.toBoolean(oResult))) {
            break;
          }
        }
 else {
          if (validators.containsKey(validatorName)) {
            Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
          }
        }
      }
 else {
        Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public FlowProvider run(Context cx) throws Exception {
  ScriptRunner dataFeeder=createModule(cx,aEntityId);
  if (dataFeeder != null) {
    return new PlatypusScriptedFlowProvider(ScriptedDatabasesClient.this,aExpectedFields,(ScriptRunner)dataFeeder,aSessionId);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + aEntityId + "String_Node_Str");
  }
}
Program: 145525
Project: 145525
Buggy source:
/** 
 * WARNING!!! This method executes a method with system permissions! You should think twice befoce calling it i your code.
 * @param aModuleName
 * @param aMethodName
 * @param aArgs
 * @return
 * @throws Exception
 */
public Object executeServerModuleMethod(String aModuleName,String aMethodName,Object[] aArgs) throws Exception {
  ServerScriptRunner module=getSessionManager().getSystemSession().getModule(aModuleName);
  if (module == null) {
    module=new ServerScriptRunner(this,getSessionManager().getSystemSession(),aModuleName,ScriptRunner.initializePlatypusStandardLibScope(),this,this,new Object[]{});
  }
  module.execute();
  Session oldSession=getSessionManager().getCurrentSession();
  try {
    getSessionManager().setCurrentSession(getSessionManager().getSystemSession());
    return module.executeMethod(aMethodName,aArgs);
  }
  finally {
    getSessionManager().setCurrentSession(oldSession);
  }
}

Fixed version (ground truth):
/** 
 * WARNING!!! This method executes a method with system permissions! You should think twice befoce calling it i your code.
 * @param aModuleName
 * @param aMethodName
 * @param aArgs
 * @return
 * @throws Exception
 */
public Object executeServerModuleMethod(String aModuleName,String aMethodName,Object[] aArgs) throws Exception {
  ServerScriptRunner module=getSessionManager().getSystemSession().getModule(aModuleName);
  Session oldSession=getSessionManager().getCurrentSession();
  try {
    getSessionManager().setCurrentSession(getSessionManager().getSystemSession());
    if (module == null) {
      module=new ServerScriptRunner(this,getSessionManager().getSystemSession(),aModuleName,ScriptRunner.initializePlatypusStandardLibScope(),this,this,new Object[]{});
    }
    module.execute();
    return module.executeMethod(aMethodName,aArgs);
  }
  finally {
    getSessionManager().setCurrentSession(oldSession);
  }
}
Program: 145526
Project: 145526
Buggy source:
public synchronized ServerScriptRunner get(String aModuleId) throws Exception {
  ServerScriptRunner runner=cache.get(aModuleId);
  if (runner != null && !serverCore.getDatabasesClient().getAppCache().isActual(runner.getApplicationElementId(),runner.getTxtContentLength(),runner.getTxtCrc32())) {
    runner=null;
    cache.remove(aModuleId);
    serverCore.getDatabasesClient().getAppCache().remove(aModuleId);
  }
  if (runner == null) {
    runner=new ServerScriptRunner(serverCore,serverCore.getSessionManager().getSystemSession(),aModuleId,ScriptRunner.initializePlatypusStandardLibScope(),serverCore,serverCore,new Object[]{});
    cache.put(aModuleId,runner);
  }
  return runner;
}

Fixed version (ground truth):
public synchronized ServerScriptRunner get(String aModuleId) throws Exception {
  ServerScriptRunner runner=cache.get(aModuleId);
  if (runner != null && !serverCore.getDatabasesClient().getAppCache().isActual(runner.getApplicationElementId(),runner.getTxtContentLength(),runner.getTxtCrc32())) {
    runner=null;
    cache.remove(aModuleId);
    serverCore.getDatabasesClient().getAppCache().remove(aModuleId);
  }
  if (runner == null) {
    runner=new ServerScriptRunner(serverCore,serverCore.getSessionManager().getSystemSession(),aModuleId,ScriptRunner.initializePlatypusStandardLibScope(),serverCore,serverCore,new Object[]{});
    runner.setPrototype(ServerScriptRunnerPrototype.getInstance());
    runner.execute();
    cache.put(aModuleId,runner);
  }
  return runner;
}
Program: 145528
Project: 145528
Buggy source:
public void onReadyStateChange(XMLHttpRequest xhr){
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
    xhr.clearOnReadyStateChange();
    String errorMsg=XMLHttpRequest2.getBrowserSpecificFailure(req);
    if (errorMsg != null) {
      Throwable exception=new RuntimeException(errorMsg);
      Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,exception);
      try {
        if (onFailure != null)         onFailure.run(xhr);
      }
 catch (      Exception ex) {
        Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
 else {
      try {
        if (xhr.getStatus() == Response.SC_OK) {
          if (onSuccess != null)           onSuccess.run(xhr);
        }
 else {
          if (onFailure != null)           onFailure.run(xhr);
        }
      }
 catch (      Exception ex) {
        Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
}

Fixed version (ground truth):
public void onReadyStateChange(XMLHttpRequest xhr){
  if (xhr.getReadyState() == XMLHttpRequest.DONE) {
    xhr.clearOnReadyStateChange();
    String errorMsg=XMLHttpRequest2.getBrowserSpecificFailure(xhr);
    if (errorMsg != null) {
      Throwable exception=new RuntimeException(errorMsg);
      Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,exception);
      try {
        if (onFailure != null)         onFailure.run(xhr);
      }
 catch (      Exception ex) {
        Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
 else {
      try {
        if (xhr.getStatus() == Response.SC_OK) {
          if (onSuccess != null)           onSuccess.run(xhr);
        }
 else {
          if (onFailure != null)           onFailure.run(xhr);
        }
      }
 catch (      Exception ex) {
        Logger.getLogger(AppClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
}
Program: 145529
Project: 145529
Buggy source:
@Override public CompletionTask createTask(int queryType,JTextComponent component){
  if (queryType == CompletionProvider.COMPLETION_QUERY_TYPE || queryType == CompletionProvider.TOOLTIP_QUERY_TYPE || queryType == CompletionProvider.DOCUMENTATION_QUERY_TYPE) {
    return createCompletionTask(component);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public CompletionTask createTask(int queryType,JTextComponent component){
  return createCompletionTask(component);
}
Program: 145530
Project: 145530
Buggy source:
private DataSource constructDataSource(DbConnectionSettings aSettings) throws Exception {
  try {
    Context initContext=new InitialContext();
    DataSource ds;
    try {
      ds=(DataSource)initContext.lookup(aSettings.getUrl());
    }
 catch (    javax.naming.NamingException ex) {
      Context envContext=(Context)initContext.lookup("String_Node_Str");
      ds=(DataSource)envContext.lookup(aSettings.getUrl());
    }
    return ds;
  }
 catch (  Exception ex) {
    return new PlatypusNativeDataSource(aSettings.getMaxConnections(),aSettings.getMaxStatements(),aSettings.getResourceTimeout(),aSettings.getUrl(),aSettings.getUser(),aSettings.getPassword(),aSettings.getSchema());
  }
}

Fixed version (ground truth):
private DataSource constructDataSource(DbConnectionSettings aSettings) throws Exception {
  try {
    Context initContext=new InitialContext();
    DataSource ds;
    try {
      ds=(DataSource)initContext.lookup(aSettings.getUrl());
    }
 catch (    javax.naming.NamingException ex) {
      Context envContext=(Context)initContext.lookup("String_Node_Str");
      ds=(DataSource)envContext.lookup(aSettings.getUrl());
    }
    return ds;
  }
 catch (  Exception ex) {
    return new PlatypusNativeDataSource(aSettings.getMaxConnections(),aSettings.getMaxStatements(),aSettings.getResourceTimeout(),aSettings.getUrl(),aSettings.getUser(),aSettings.getPassword());
  }
}
Program: 145531
Project: 145531
Buggy source:
public PlatypusNativeDataSource(int aMaxConnections,int aMaxStatements,int aResourceTimeout,String aUrl,String aUser,String aPassword,String aSchema) throws Exception {
  super(aMaxConnections,aResourceTimeout);
  url=aUrl;
  maxStatements=aMaxStatements;
  resourceTimeout=aResourceTimeout;
  props.put("String_Node_Str",aUser);
  props.put("String_Node_Str",aPassword);
  props.put("String_Node_Str",aSchema);
}

Fixed version (ground truth):
public PlatypusNativeDataSource(int aMaxConnections,int aMaxStatements,int aResourceTimeout,String aUrl,String aUser,String aPassword) throws Exception {
  super(aMaxConnections,aResourceTimeout);
  url=aUrl;
  maxStatements=aMaxStatements;
  resourceTimeout=aResourceTimeout;
  props.put("String_Node_Str",aUser);
  props.put("String_Node_Str",aPassword);
}
Program: 145532
Project: 145532
Buggy source:
private void applySqlScript(File sqlScriptFile) throws Exception {
  DbConnectionSettings.registerDrivers(DbConnectionSettings.readDrivers().values());
  Properties props=new Properties();
  props.put("String_Node_Str",settings.getDbSettings().getUser());
  props.put("String_Node_Str",settings.getDbSettings().getPassword());
  props.put("String_Node_Str",settings.getDbSettings().getSchema());
  try (Connection connection=DriverManager.getConnection(settings.getDbSettings().getUrl(),props)){
    SqlDriver.applyScript(FileUtils.readString(sqlScriptFile,PlatypusFiles.DEFAULT_ENCODING),connection);
  }
 }

Fixed version (ground truth):
private void applySqlScript(File sqlScriptFile) throws Exception {
  DbConnectionSettings.registerDrivers(DbConnectionSettings.readDrivers().values());
  Properties props=new Properties();
  props.put("String_Node_Str",settings.getDbSettings().getUser());
  props.put("String_Node_Str",settings.getDbSettings().getPassword());
  try (Connection connection=DriverManager.getConnection(settings.getDbSettings().getUrl(),props)){
    SqlDriver.applyScript(FileUtils.readString(sqlScriptFile,PlatypusFiles.DEFAULT_ENCODING),connection);
  }
 }
Program: 145533
Project: 145533
Buggy source:
public static String makeTestConnectionDescription(Properties props) throws SQLException {
  String url="String_Node_Str";
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  return url;
}

Fixed version (ground truth):
public static String makeTestConnectionDescription(Properties props) throws SQLException {
  String url="String_Node_Str";
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  return url;
}
Program: 145534
Project: 145534
Buggy source:
protected void onDataChange(M parent){
  getStore().fireEvent(new StoreDataChangeEvent<M>());
}

Fixed version (ground truth):
@Override protected void onDataChange(M parent){
  super.onDataChange(parent);
  getStore().fireEvent(new StoreDataChangeEvent<M>());
}
Program: 145535
Project: 145535
Buggy source:
@Override public void setOnSelect(Function aHandler){
  selectFunction=aHandler;
}

Fixed version (ground truth):
@Override public void setOnSelect(Function aHandler) throws Exception {
  selectFunction=aHandler;
  createFieldExtraEditingControls();
}
Program: 145536
Project: 145536
Buggy source:
public void setOnSelect(Function aValue);

Fixed version (ground truth):
public void setOnSelect(Function aValue) throws Exception ;
Program: 145537
Project: 145537
Buggy source:
@ScriptFunction public void setOnSelect(Function aValue) throws Exception {
  delegate.setOnSelect(aValue);
}

Fixed version (ground truth):
@ScriptFunction public void setOnSelect(Function aValue) throws Exception {
  delegate.setOnSelect(aValue);
  delegate.revalidate();
  delegate.repaint();
}
Program: 145539
Project: 145539
Buggy source:
public static ArgumentType getArgumentType(Object value){
  if (value instanceof Scriptable) {
    return ArgumentType.OBJECT;
  }
 else {
    for (    ArgumentType at : values()) {
      if (at.getClazz().isInstance(value)) {
        return at;
      }
    }
    return null;
  }
}

Fixed version (ground truth):
public static ArgumentType getArgumentType(Object value){
  if (value instanceof Scriptable || value instanceof Rowset) {
    return ArgumentType.OBJECT;
  }
 else {
    for (    ArgumentType at : values()) {
      if (at.getClazz().isInstance(value)) {
        return at;
      }
    }
    return null;
  }
}
Program: 145542
Project: 145542
Buggy source:
@Override public void run(){
  try {
    Object result=platypusClient.executeServerModuleMethod(moduleName,methodName,Arrays.copyOf(args,args.length - 1));
    Context cx=Context.getCurrentContext();
    boolean wasContext=cx != null;
    if (!wasContext) {
      cx=ScriptUtils.enterContext();
    }
    try {
      callback.call(cx,StubFunction.this,StubFunction.this,new Object[]{result});
    }
  finally {
      if (!wasContext) {
        Context.exit();
      }
    }
  }
 catch (  Exception ex) {
    Logger.getLogger(ServerScriptProxy.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Object result=platypusClient.executeServerModuleMethod(moduleName,methodName,args);
    Context cx=Context.getCurrentContext();
    boolean wasContext=cx != null;
    if (!wasContext) {
      cx=ScriptUtils.enterContext();
    }
    try {
      successCallback.call(cx,StubFunction.this,StubFunction.this,new Object[]{result});
    }
  finally {
      if (!wasContext) {
        Context.exit();
      }
    }
  }
 catch (  Exception ex) {
    if (failureCallback != null) {
      Context cx=Context.getCurrentContext();
      boolean wasContext=cx != null;
      if (!wasContext) {
        cx=ScriptUtils.enterContext();
      }
      try {
        failureCallback.call(cx,StubFunction.this,StubFunction.this,new Object[]{ex.getMessage()});
      }
  finally {
        if (!wasContext) {
          Context.exit();
        }
      }
    }
    Logger.getLogger(ServerScriptProxy.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 145543
Project: 145543
Buggy source:
public void setMinimizable(boolean aValue){
  minimizable=aValue;
  if (window != null && !window.isModal())   window.setMinimizable(minimizable);
}

Fixed version (ground truth):
public void setMinimizable(boolean aValue){
  minimizable=aValue;
  if (window != null)   window.setMinimizable(minimizable);
}
Program: 145544
Project: 145544
Buggy source:
/** 
 * Performs some mutations of a xml content dom. Adds dependencies. Stripes put <source/>tag and so on.
 * @param aAppElement Appelement, whoose content dom to mutated.
 * @return
 * @throws Exception 
 */
protected Filtered filter(ApplicationElement aAppElement) throws Exception {
}

Fixed version (ground truth):
/** 
 * Performs some mutations of a xml content dom. Adds dependencies. Stripes put <source/>tag and so on.
 * @param aAppElement Appelement, whoose content dom to mutated.
 * @return
 * @throws Exception
 */
protected Filtered filter(ApplicationElement aAppElement) throws Exception {
}
Program: 145545
Project: 145545
Buggy source:
private String[][] getGridView(boolean selectedOnly,boolean isData){
  TableModel view=getDeepModel();
  if (view != null) {
    int minRow=0;
    int maxRow=view.getRowCount();
    int columnCount=view.getColumnCount();
    String[][] res=new String[maxRow][columnCount];
    ListSelectionModel rowSelecter=getRowsSelectionModel();
    for (int row=minRow; row < maxRow; row++) {
      if (selectedOnly) {
        if (rowSelecter.isSelectedIndex(row)) {
          res[row]=transformRow(row,selectedOnly,isData);
        }
      }
 else {
        res[row]=transformRow(row,selectedOnly,isData);
      }
    }
    return res;
  }
 else {
    return new String[0][0];
  }
}

Fixed version (ground truth):
private String[][] getGridView(boolean selectedOnly,boolean isData){
  TableModel cellsModel=getDeepModel();
  if (cellsModel != null) {
    int minRow=0;
    int maxRow=cellsModel.getRowCount();
    int columnCount=cellsModel.getColumnCount();
    String[][] res=new String[maxRow][columnCount];
    ListSelectionModel rowSelecter=getRowsSelectionModel();
    for (int viewRow=minRow; viewRow < maxRow; viewRow++) {
      if (selectedOnly) {
        if (rowSelecter.isSelectedIndex(viewRow)) {
          res[viewRow]=transformRow(rowSorter.convertRowIndexToModel(viewRow),selectedOnly,isData);
        }
      }
 else {
        res[viewRow]=transformRow(rowSorter.convertRowIndexToModel(viewRow),selectedOnly,isData);
      }
    }
    return res;
  }
 else {
    return new String[0][0];
  }
}
Program: 145546
Project: 145546
Buggy source:
public static int getWidgetHeight(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetHeight();
}

Fixed version (ground truth):
public static int getWidgetHeight(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof FieldSet) {
    element=aWidget.getParent().getElement();
  }
 else   if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetHeight();
}
Program: 145547
Project: 145547
Buggy source:
public static int getWidgetWidth(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetWidth();
}

Fixed version (ground truth):
public static int getWidgetWidth(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof FieldSet) {
    element=aWidget.getParent().getElement();
  }
 else   if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetWidth();
}
Program: 145548
Project: 145548
Buggy source:
public static int getWidgetTop(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetTop();
}

Fixed version (ground truth):
public static int getWidgetTop(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof FieldSet) {
    element=aWidget.getParent().getElement();
  }
 else   if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetTop();
}
Program: 145549
Project: 145549
Buggy source:
public static int getWidgetLeft(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof SimpleContainer && aWidget.getParent().getParent() instanceof FieldSet) {
    aWidget=aWidget.getParent().getParent();
  }
  if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetLeft();
}

Fixed version (ground truth):
public static int getWidgetLeft(Widget aWidget){
  Element element=aWidget.getElement();
  if (aWidget.getParent() instanceof FieldSet) {
    element=aWidget.getParent().getElement();
  }
 else   if (aWidget.getParent() instanceof BorderLayoutContainer && aWidget.getParent().getParent() instanceof LayoutPanel) {
    element=aWidget.getParent().getElement().getParentElement();
  }
  return element.getOffsetLeft();
}
Program: 145550
Project: 145550
Buggy source:
private void selectCell(int aRow,int aCol){
  grid.getSelectionModel().select(aRow,false);
}

Fixed version (ground truth):
private void selectCell(int aRow,int aCol){
  if (grid.getSelectionModel() instanceof PlatypusCellSelectionModel<?>) {
    PlatypusCellSelectionModel<Row> cellsSelection=(PlatypusCellSelectionModel<Row>)grid.getSelectionModel();
    cellsSelection.selectCell(aRow,aCol,true);
  }
 else {
    grid.getSelectionModel().select(aRow,false);
  }
}
Program: 145551
Project: 145551
Buggy source:
public PlatypusFieldSet(int aPadding){
  super.setWidget(content);
  getElement().getStyle().setPadding(aPadding,Style.Unit.PX);
  leftPadding=aPadding;
  topPadding=aPadding;
  rightPadding=aPadding;
  bottomPadding=aPadding;
  legend=getElement().child("String_Node_Str");
  XElement legendSpan=legend.child("String_Node_Str");
  XElement legendDiv=legend.child("String_Node_Str");
  legend.removeChildren();
  Element div=DOM.createDiv();
  div.appendChild(legendDiv);
  div.appendChild(legendSpan);
  Style divstyle=div.getStyle();
  divstyle.setProperty("String_Node_Str","String_Node_Str");
  divstyle.setProperty("String_Node_Str","String_Node_Str");
  legend.appendChild(div);
  legendStyle=legend.getStyle();
  getElement().getStyle().setMargin(0,Style.Unit.PX);
}

Fixed version (ground truth):
public PlatypusFieldSet(FieldSetAppearance appearance){
  super(appearance);
  legend=getElement().child("String_Node_Str");
  legendStyle=legend.getStyle();
  XElement content=appearance.getContainerTarget(getElement());
  content.makePositionable(true);
  content.getStyle().setTop(0,Unit.PX);
}
Program: 145552
Project: 145552
Buggy source:
@Override protected void onResize(int width,int height){
  int dW=getElement().getWidth(false) - getElement().getWidth(true);
  int dH=getElement().getHeight(false) - getElement().getHeight(true);
  super.onResize(width,height);
  content.setPixelSize(width - leftPadding - rightPadding,height - dH / 2 - topPadding - CONTENT_SHIFT_HEIGHT);
  legendWidth=width - dW - dW;
  setLegendWidth();
}

Fixed version (ground truth):
@Override protected void onResize(int width,int height){
  super.onResize(width,height);
  getContainerTarget().setHeight(height,true);
  int dW=getElement().getWidth(false) - getElement().getWidth(true);
  legendWidth=width - 2 * dW;
  applyLegendWidth();
}
Program: 145553
Project: 145553
Buggy source:
@Override public void setHeadingText(String heading){
  super.setHeadingText(heading);
  setLegendWidth();
}

Fixed version (ground truth):
@Override public void setHeadingText(String heading){
  super.setHeadingText(heading);
  applyLegendWidth();
}
Program: 145554
Project: 145554
Buggy source:
@Override public void setWidget(IsWidget isWidget){
  setWidget(asWidgetOrNull(isWidget));
}

Fixed version (ground truth):
@Override public void setWidget(Widget w){
  handlers.removeHandler();
  super.setWidget(w);
  if (w instanceof Component) {
    handlers.add(((Component)w).addHideHandler(new HideHandler(){
      @Override public void onHide(      HideEvent event){
        PlatypusFieldSet.this.hide();
      }
    }
));
    handlers.add(((Component)w).addShowHandler(new ShowHandler(){
      @Override public void onShow(      ShowEvent event){
        PlatypusFieldSet.this.show();
      }
    }
));
    handlers.add(((Component)w).addEnableHandler(new EnableHandler(){
      @Override public void onEnable(      EnableEvent event){
        PlatypusFieldSet.this.enable();
      }
    }
));
    handlers.add(((Component)w).addDisableHandler(new DisableHandler(){
      @Override public void onDisable(      DisableEvent event){
        PlatypusFieldSet.this.disable();
      }
    }
));
  }
}
Program: 145555
Project: 145555
Buggy source:
public void ajustWidth(Widget aChild,int aValue){
  if (aChild != null) {
    aChild.setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
  }
}

Fixed version (ground truth):
public void ajustWidth(Widget aChild,int aValue){
  if (aChild != null) {
    if (aChild.getParent() instanceof PlatypusFieldSet)     aChild.getParent().setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
 else     aChild.setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
  }
}
Program: 145556
Project: 145556
Buggy source:
public void ajustHeight(Widget aChild,int aValue){
  if (aChild != null) {
    aChild.setPixelSize(Sizer.getWidgetWidth(aChild),aValue);
  }
}

Fixed version (ground truth):
public void ajustHeight(Widget aChild,int aValue){
  if (aChild != null) {
    if (aChild.getParent() instanceof PlatypusFieldSet)     aChild.getParent().setPixelSize(Sizer.getWidgetWidth(aChild),aValue);
 else     aChild.setPixelSize(Sizer.getWidgetWidth(aChild),aValue);
  }
}
Program: 145557
Project: 145557
Buggy source:
public void ajustWidth(Widget aChild,int aValue){
  if (aChild != null) {
    aChild.setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
    ajustSize();
  }
}

Fixed version (ground truth):
public void ajustWidth(Widget aChild,int aValue){
  if (aChild != null) {
    if (aChild.getParent() instanceof PlatypusFieldSet)     aChild.getParent().setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
 else     aChild.setPixelSize(aValue,Sizer.getWidgetHeight(aChild));
    ajustSize();
  }
}
Program: 145558
Project: 145558
Buggy source:
/** 
 * Takes into account inner structure of MarginLayoutContainer and possible FieldSet wrappers.
 * @param aChild
 * @return
 */
protected Component lookupLayoutedChild(Widget aChild){
  MarginConstraints anchors=(MarginConstraints)((Component)aChild.getParent()).getData(MARGIN_LAYOUT_DATA);
  if (anchors == null)   return (Component)aChild.getParent().getParent().getParent();
 else   return (Component)aChild.getParent();
}

Fixed version (ground truth):
/** 
 * Takes into account inner structure of MarginLayoutContainer and possible FieldSet wrappers.
 * @param aChild
 * @return
 */
protected Component lookupLayoutedChild(Widget aChild){
  if (aChild.getParent() instanceof PlatypusFieldSet)   aChild=aChild.getParent();
  return (Component)aChild.getParent();
}