Program: 149083
Project: 149083
Buggy source:
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      StringBuffer desc=new StringBuffer();
      for (      String lan : labels.keySet()) {
        desc.append("String_Node_Str" + lan.toUpperCase() + "String_Node_Str"+ decl.getName()+ "String_Node_Str");
      }
      view.setDescription(desc.toString());
      wrap.setWsView(view);
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      WSDeleteView delView=new WSDeleteView();
      delView.setWsViewPK(viewPk);
      WSGetView getView=new WSGetView();
      getView.setWsViewPK(viewPk);
      try {
        port.getView(getView);
        port.deleteView(delView);
      }
 catch (      RemoteException ex) {
      }
      port.putView(wrap);
    }
  }
}

Fixed version (ground truth):
private void newBrowseItemView(String browseItem) throws RemoteException {
  for (  XSDElementDeclaration decl : declList) {
    String fullName=BROWSE_ITEMS + decl.getName();
    if (fullName.equals(browseItem)) {
      XtentisPort port=getXtentisPort();
      WSView view=new WSView();
      WSPutView wrap=new WSPutView();
      view.setName(browseItem);
      EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
      List<String> keys=new ArrayList<String>();
      for (      XSDIdentityConstraintDefinition idty : idtylist) {
        EList<XSDXPathDefinition> xpathList=idty.getFields();
        for (        XSDXPathDefinition path : xpathList) {
          String key=decl.getName();
          key+="String_Node_Str" + path.getValue();
          keys.add(key);
        }
      }
      view.setSearchableBusinessElements(keys.toArray(new String[]{}));
      view.setViewableBusinessElements(keys.toArray(new String[]{}));
      StringBuffer desc=new StringBuffer();
      for (      String lan : labels.keySet()) {
        desc.append("String_Node_Str" + lan.toUpperCase() + "String_Node_Str"+ labels.get(lan)+ "String_Node_Str");
      }
      view.setDescription(desc.toString());
      wrap.setWsView(view);
      WSViewPK viewPk=new WSViewPK();
      viewPk.setPk(browseItem);
      WSDeleteView delView=new WSDeleteView();
      delView.setWsViewPK(viewPk);
      WSGetView getView=new WSGetView();
      getView.setWsViewPK(viewPk);
      try {
        port.getView(getView);
        port.deleteView(delView);
      }
 catch (      RemoteException ex) {
      }
      port.putView(wrap);
    }
  }
}