Program: 149040
Project: 149040
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();
      if (decl.getAnnotation() != null)       labels=new XSDAnnotationsStructure(decl.getAnnotation()).getLabels();
      if (labels == null || labels.size() == 0)       labels.put("String_Node_Str",decl.getName());
      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);
    }
  }
}

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();
      LinkedHashMap<String,String> labels=new LinkedHashMap<String,String>();
      if (decl.getAnnotation() != null)       labels=new XSDAnnotationsStructure(decl.getAnnotation()).getLabels();
      if (labels.size() == 0)       labels.put("String_Node_Str",decl.getName());
      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);
    }
  }
}