Program: 155327
Project: 155327
Buggy source:
/** 
 * http://www.xmlrpc.com/metaWeblogApi http://mindsharestrategy.com/wp-xmlrpc-metaweblog/ http://www.perkiset.org/forum/perl/metaweblognewpost_to_wordpress_blog_xmlrpcphp-t1307.0.html http://joysofprogramming.com/wordpress-xmlrpc-metaweblog-newpost/ http://life.mysiteonline.org/archives/161-Automatic-Post-Creation-with-Wordpress,-PHP,-and-XML-RPC.html
 * @param post to create
 * @return the created post
 * @throws WordpressXmlRpcException
 */
public WordpressPost post(WordpressPost post) throws WordpressXmlRpcException {
  Vector<Object> params=new Vector<Object>();
  if (post.getPostId() == null) {
    params.add(wordpressConnection.getBlogId());
  }
 else {
    params.add(post.getPostId());
  }
  params.add(wordpressConnection.getUsername());
  params.add(wordpressConnection.getPassword());
  Hashtable<String,Object> map=new Hashtable<String,Object>();
  if (post.getTitle() != null) {
    map.put("String_Node_Str",post.getTitle());
  }
  if (post.getCategoryNames() != null) {
    map.put("String_Node_Str",new Vector<String>(post.getCategoryNames()));
  }
  if (post.getBody() != null) {
    map.put("String_Node_Str",post.getBody());
  }
  if (post.getTagNames() != null) {
    map.put("String_Node_Str",new Vector<String>(post.getTagNames()));
  }
  if (post.getAuthorId() != null) {
    map.put("String_Node_Str",post.getAuthorId());
  }
  if (post.getPostSlug() != null) {
    map.put("String_Node_Str",post.getPostSlug());
  }
  params.add(map);
  params.add(!post.isDraft());
  if (post.getPostId() == null) {
    Object ret=invoke(CREATE_POST_METHOD_NAME,params);
    int postId=Integer.parseInt(ret.toString());
    post.setPostId(postId);
  }
 else {
    Boolean ret=invoke(UPDATE_POST_METHOD_NAME,params);
    if (!ret) {
      throw new WordpressXmlRpcException("String_Node_Str");
    }
  }
  return findPostById(post.getPostId());
}

Fixed version (ground truth):
/** 
 * http://www.xmlrpc.com/metaWeblogApi http://mindsharestrategy.com/wp-xmlrpc-metaweblog/ http://www.perkiset.org/forum/perl/metaweblognewpost_to_wordpress_blog_xmlrpcphp-t1307.0.html http://joysofprogramming.com/wordpress-xmlrpc-metaweblog-newpost/ http://life.mysiteonline.org/archives/161-Automatic-Post-Creation-with-Wordpress,-PHP,-and-XML-RPC.html
 * @param post to create
 * @return the created post
 * @throws WordpressXmlRpcException
 */
public WordpressPost post(WordpressPost post) throws WordpressXmlRpcException {
  Vector<Object> params=new Vector<Object>();
  if (post.getPostId() == null) {
    params.add(wordpressConnection.getBlogId());
  }
 else {
    params.add(post.getPostId());
  }
  params.add(wordpressConnection.getUsername());
  params.add(wordpressConnection.getPassword());
  Hashtable<String,Object> map=new Hashtable<String,Object>();
  map.put("String_Node_Str",post.getTitle());
  map.put("String_Node_Str",post.getBody());
  map.put("String_Node_Str",post.getAuthorId());
  map.put("String_Node_Str",post.getPostSlug());
  if (post.getCategoryNames() != null) {
    map.put("String_Node_Str",new Vector<String>(post.getCategoryNames()));
  }
 else {
    map.put("String_Node_Str",new Vector<String>());
  }
  if (post.getTagNames() != null) {
    map.put("String_Node_Str",new Vector<String>(post.getTagNames()));
  }
 else {
    map.put("String_Node_Str",new Vector<String>());
  }
  params.add(map);
  params.add(!post.isDraft());
  if (post.getPostId() == null) {
    Object ret=invoke(CREATE_POST_METHOD_NAME,params);
    int postId=Integer.parseInt(ret.toString());
    post.setPostId(postId);
  }
 else {
    Boolean ret=invoke(UPDATE_POST_METHOD_NAME,params);
    if (!ret) {
      throw new WordpressXmlRpcException("String_Node_Str");
    }
  }
  return findPostById(post.getPostId());
}