Program: 148879
Project: 148879
Buggy source:
public void parse(){
  if (zipBtn.getSelection()) {
    zipfile=zip.getText().getText();
    importFolder=System.getProperty("String_Node_Str") + "String_Node_Str";
    try {
      ZipToFile.unZipFile(zipfile,importFolder);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  if (folderBtn.getSelection()) {
    importFolder=folder.getText().getText();
  }
  try {
    FileReader reader=new FileReader(importFolder + "String_Node_Str");
    Exports exports=(Exports)Unmarshaller.unmarshal(Exports.class,reader);
    TreeParent reserverRoot=new TreeParent(serverRoot.getDisplayName(),null,TreeObject._SERVER_,serverRoot.getWsKey(),serverRoot.getWsObject());
    reserverRoot.setUser(serverRoot.getUser());
    TreeParent clusters=new TreeParent(EXtentisObjects.DataCluster.getDisplayName(),reserverRoot,TreeObject.DATA_CLUSTER,null,null);
    TreeParent models=new TreeParent(EXtentisObjects.DataMODEL.getDisplayName(),reserverRoot,TreeObject.DATA_MODEL,null,null);
    TreeParent menus=new TreeParent(EXtentisObjects.Menu.getDisplayName(),reserverRoot,TreeObject.MENU,null,null);
    TreeParent roles=new TreeParent(EXtentisObjects.Role.getDisplayName(),reserverRoot,TreeObject.ROLE,null,null);
    TreeParent routingrules=new TreeParent(EXtentisObjects.RoutingRule.getDisplayName(),reserverRoot,TreeObject.ROUTING_RULE,null,null);
    TreeParent storeprocedures=new TreeParent(EXtentisObjects.StoredProcedure.getDisplayName(),reserverRoot,TreeObject.STORED_PROCEDURE,null,null);
    TreeParent syncplans=new TreeParent(EXtentisObjects.SynchronizationPlan.getDisplayName(),reserverRoot,TreeObject.SYNCHRONIZATIONPLAN,null,null);
    TreeParent transformers=new TreeParent(EXtentisObjects.Transformer.getDisplayName(),reserverRoot,TreeObject.TRANSFORMER,null,null);
    TreeParent universes=new TreeParent(EXtentisObjects.Universe.getDisplayName(),reserverRoot,TreeObject.UNIVERSE,null,null);
    TreeParent views=new TreeParent(EXtentisObjects.View.getDisplayName(),reserverRoot,TreeObject.VIEW,null,null);
    reserverRoot.addChild(clusters);
    reserverRoot.addChild(models);
    reserverRoot.addChild(menus);
    reserverRoot.addChild(roles);
    reserverRoot.addChild(routingrules);
    reserverRoot.addChild(storeprocedures);
    reserverRoot.addChild(syncplans);
    reserverRoot.addChild(transformers);
    reserverRoot.addChild(universes);
    reserverRoot.addChild(views);
    boolean isOverrideAll=false;
    for (    TreeObject obj : exports.getItems()) {
      obj.setServerRoot(reserverRoot);
switch (obj.getType()) {
case TreeObject.DATA_CLUSTER:
        if (port.existsDataCluster(new WSExistsDataCluster(new WSDataClusterPK(obj.getDisplayName()))).is_true()) {
          if (!isOverrideAll) {
            int result=isOveride(obj.getDisplayName());
            if (result == IDialogConstants.CANCEL_ID) {
              return;
            }
            if (result == IDialogConstants.YES_TO_ALL_ID) {
              isOverrideAll=true;
            }
            if (result == IDialogConstants.NO_ID) {
              break;
            }
          }
        }
      clusters.addChild(obj);
    break;
case TreeObject.DATA_MODEL:
  if (port.existsDataModel(new WSExistsDataModel(new WSDataModelPK(obj.getDisplayName()))).is_true()) {
    if (!isOverrideAll) {
      int result=isOveride(obj.getDisplayName());
      if (result == IDialogConstants.CANCEL_ID) {
        return;
      }
      if (result == IDialogConstants.YES_TO_ALL_ID) {
        isOverrideAll=true;
      }
      if (result == IDialogConstants.NO_ID) {
        break;
      }
    }
  }
models.addChild(obj);
break;
case TreeObject.MENU:
if (port.existsMenu(new WSExistsMenu(new WSMenuPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
  return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
  isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
  break;
}
}
}
menus.addChild(obj);
break;
case TreeObject.ROLE:
if (port.existsRole(new WSExistsRole(new WSRolePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
roles.addChild(obj);
break;
case TreeObject.ROUTING_RULE:
if (port.existsRoutingRule(new WSExistsRoutingRule(new WSRoutingRulePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
routingrules.addChild(obj);
break;
case TreeObject.STORED_PROCEDURE:
if (port.existsStoredProcedure(new WSExistsStoredProcedure(new WSStoredProcedurePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
storeprocedures.addChild(obj);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
if (port.existsSynchronizationPlan(new WSExistsSynchronizationPlan(new WSSynchronizationPlanPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
syncplans.addChild(obj);
break;
case TreeObject.TRANSFORMER:
if (port.existsTransformer(new WSExistsTransformer(new WSTransformerPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
transformers.addChild(obj);
break;
case TreeObject.UNIVERSE:
if (port.existsUniverse(new WSExistsUniverse(new WSUniversePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
universes.addChild(obj);
break;
case TreeObject.VIEW:
if (port.existsView(new WSExistsView(new WSViewPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName());
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
views.addChild(obj);
break;
default :
if (obj.getItems().length > 0) {
for (int i=0; i < obj.getItems().length; i++) {
if (obj.getItems()[i].split("String_Node_Str")[1] != null) dataClusterContent.put(obj.getItems()[i].split("String_Node_Str")[1],obj.getItems());
}
}
}
}
treeViewer.setRoot(reserverRoot);
treeViewer.getViewer().setInput(view.getSite());
treeViewer.setCheckItems(Arrays.asList(exports.getItems()));
GridData gd=(GridData)treeViewer.getViewer().getControl().getLayoutData();
gd.heightHint=300;
treeViewer.getViewer().getControl().getParent().layout(true);
treeViewer.getViewer().getControl().getShell().layout(true);
}
 catch (Exception e) {
}
}

Fixed version (ground truth):
public void parse(){
  if (zipBtn.getSelection()) {
    zipfile=zip.getText().getText();
    importFolder=System.getProperty("String_Node_Str") + "String_Node_Str";
    try {
      ZipToFile.unZipFile(zipfile,importFolder);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  if (folderBtn.getSelection()) {
    importFolder=folder.getText().getText();
  }
  try {
    FileReader reader=new FileReader(importFolder + "String_Node_Str");
    Exports exports=(Exports)Unmarshaller.unmarshal(Exports.class,reader);
    TreeParent reserverRoot=new TreeParent(serverRoot.getDisplayName(),null,TreeObject._SERVER_,serverRoot.getWsKey(),serverRoot.getWsObject());
    reserverRoot.setUser(serverRoot.getUser());
    TreeParent clusters=new TreeParent(EXtentisObjects.DataCluster.getDisplayName(),reserverRoot,TreeObject.DATA_CLUSTER,null,null);
    TreeParent models=new TreeParent(EXtentisObjects.DataMODEL.getDisplayName(),reserverRoot,TreeObject.DATA_MODEL,null,null);
    TreeParent menus=new TreeParent(EXtentisObjects.Menu.getDisplayName(),reserverRoot,TreeObject.MENU,null,null);
    TreeParent roles=new TreeParent(EXtentisObjects.Role.getDisplayName(),reserverRoot,TreeObject.ROLE,null,null);
    TreeParent routingrules=new TreeParent(EXtentisObjects.RoutingRule.getDisplayName(),reserverRoot,TreeObject.ROUTING_RULE,null,null);
    TreeParent storeprocedures=new TreeParent(EXtentisObjects.StoredProcedure.getDisplayName(),reserverRoot,TreeObject.STORED_PROCEDURE,null,null);
    TreeParent syncplans=new TreeParent(EXtentisObjects.SynchronizationPlan.getDisplayName(),reserverRoot,TreeObject.SYNCHRONIZATIONPLAN,null,null);
    TreeParent transformers=new TreeParent(EXtentisObjects.Transformer.getDisplayName(),reserverRoot,TreeObject.TRANSFORMER,null,null);
    TreeParent universes=new TreeParent(EXtentisObjects.Universe.getDisplayName(),reserverRoot,TreeObject.UNIVERSE,null,null);
    TreeParent views=new TreeParent(EXtentisObjects.View.getDisplayName(),reserverRoot,TreeObject.VIEW,null,null);
    reserverRoot.addChild(clusters);
    reserverRoot.addChild(models);
    reserverRoot.addChild(menus);
    reserverRoot.addChild(roles);
    reserverRoot.addChild(routingrules);
    reserverRoot.addChild(storeprocedures);
    reserverRoot.addChild(syncplans);
    reserverRoot.addChild(transformers);
    reserverRoot.addChild(universes);
    reserverRoot.addChild(views);
    boolean isOverrideAll=false;
    for (    TreeObject obj : exports.getItems()) {
      obj.setServerRoot(reserverRoot);
switch (obj.getType()) {
case TreeObject.DATA_CLUSTER:
        if (port.existsDataCluster(new WSExistsDataCluster(new WSDataClusterPK(obj.getDisplayName()))).is_true()) {
          if (!isOverrideAll) {
            int result=isOveride(obj.getDisplayName(),TreeObject.DATACONTAINER);
            if (result == IDialogConstants.CANCEL_ID) {
              return;
            }
            if (result == IDialogConstants.YES_TO_ALL_ID) {
              isOverrideAll=true;
            }
            if (result == IDialogConstants.NO_ID) {
              break;
            }
          }
        }
      clusters.addChild(obj);
    break;
case TreeObject.DATA_MODEL:
  if (port.existsDataModel(new WSExistsDataModel(new WSDataModelPK(obj.getDisplayName()))).is_true()) {
    if (!isOverrideAll) {
      int result=isOveride(obj.getDisplayName(),TreeObject.DATAMODEL_);
      if (result == IDialogConstants.CANCEL_ID) {
        return;
      }
      if (result == IDialogConstants.YES_TO_ALL_ID) {
        isOverrideAll=true;
      }
      if (result == IDialogConstants.NO_ID) {
        break;
      }
    }
  }
models.addChild(obj);
break;
case TreeObject.MENU:
if (port.existsMenu(new WSExistsMenu(new WSMenuPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.MENU_);
if (result == IDialogConstants.CANCEL_ID) {
  return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
  isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
  break;
}
}
}
menus.addChild(obj);
break;
case TreeObject.ROLE:
if (port.existsRole(new WSExistsRole(new WSRolePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.ROLE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
roles.addChild(obj);
break;
case TreeObject.ROUTING_RULE:
if (port.existsRoutingRule(new WSExistsRoutingRule(new WSRoutingRulePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.ROUTINGRULE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
routingrules.addChild(obj);
break;
case TreeObject.STORED_PROCEDURE:
if (port.existsStoredProcedure(new WSExistsStoredProcedure(new WSStoredProcedurePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.STOREDPROCEDURE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
storeprocedures.addChild(obj);
break;
case TreeObject.SYNCHRONIZATIONPLAN:
if (port.existsSynchronizationPlan(new WSExistsSynchronizationPlan(new WSSynchronizationPlanPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.SYNCHRONIZATIONPLAN_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
syncplans.addChild(obj);
break;
case TreeObject.TRANSFORMER:
if (port.existsTransformer(new WSExistsTransformer(new WSTransformerPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.TRANSFORMER_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
transformers.addChild(obj);
break;
case TreeObject.UNIVERSE:
if (port.existsUniverse(new WSExistsUniverse(new WSUniversePK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.UNIVERSE_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
universes.addChild(obj);
break;
case TreeObject.VIEW:
if (port.existsView(new WSExistsView(new WSViewPK(obj.getDisplayName()))).is_true()) {
if (!isOverrideAll) {
int result=isOveride(obj.getDisplayName(),TreeObject.VIEW_);
if (result == IDialogConstants.CANCEL_ID) {
return;
}
if (result == IDialogConstants.YES_TO_ALL_ID) {
isOverrideAll=true;
}
if (result == IDialogConstants.NO_ID) {
break;
}
}
}
views.addChild(obj);
break;
default :
if (obj.getItems().length > 0) {
for (int i=0; i < obj.getItems().length; i++) {
if (obj.getItems()[i].split("String_Node_Str")[1] != null) dataClusterContent.put(obj.getItems()[i].split("String_Node_Str")[1],obj.getItems());
}
}
}
}
treeViewer.setRoot(reserverRoot);
treeViewer.getViewer().setInput(view.getSite());
treeViewer.setCheckItems(Arrays.asList(exports.getItems()));
GridData gd=(GridData)treeViewer.getViewer().getControl().getLayoutData();
gd.heightHint=300;
treeViewer.getViewer().getControl().getParent().layout(true);
treeViewer.getViewer().getControl().getShell().layout(true);
}
 catch (Exception e) {
}
}