Program: 15213
Project: 15213
Buggy source:
/** 
 * Call method with optional parameters
 * @param method name of method to call
 * @param params parameters to pass to method (may be null if method has no parameters)
 * @return deserialized method return value
 * @throws XMLRPCException
 */
@SuppressWarnings("String_Node_Str") private Object callXMLRPC(String method,Object[] params) throws XMLRPCException {
  try {
    File tempFile=null;
    if (method.equals("String_Node_Str")) {
      String tempFileName="String_Node_Str" + System.currentTimeMillis();
      tempFile=File.createTempFile(tempFileName,null);
      if (!tempFile.exists() && !tempFile.mkdirs()) {
        throw new XMLRPCException("String_Node_Str");
      }
      FileWriter fileWriter=new FileWriter(tempFile);
      serializer.setOutput(fileWriter);
      serializer.startDocument(null,null);
      serializer.startTag(null,TAG_METHOD_CALL);
      serializer.startTag(null,TAG_METHOD_NAME).text(method).endTag(null,TAG_METHOD_NAME);
      if (params != null && params.length != 0) {
        serializer.startTag(null,TAG_PARAMS);
        for (int i=0; i < params.length; i++) {
          serializer.startTag(null,TAG_PARAM).startTag(null,XMLRPCSerializer.TAG_VALUE);
          XMLRPCSerializer.serialize(serializer,params[i],false);
          serializer.endTag(null,XMLRPCSerializer.TAG_VALUE).endTag(null,TAG_PARAM);
        }
        serializer.endTag(null,TAG_PARAMS);
      }
      serializer.endTag(null,TAG_METHOD_CALL);
      serializer.endDocument();
      fileWriter.flush();
      fileWriter.close();
      FileEntity fEntity=new FileEntity(tempFile,"String_Node_Str");
      fEntity.setContentType("String_Node_Str");
      postMethod.setEntity(fEntity);
    }
 else {
      StringWriter bodyWriter=new StringWriter();
      serializer.setOutput(bodyWriter);
      serializer.startDocument(null,null);
      serializer.startTag(null,TAG_METHOD_CALL);
      serializer.startTag(null,TAG_METHOD_NAME).text(method).endTag(null,TAG_METHOD_NAME);
      if (params != null && params.length != 0) {
        serializer.startTag(null,TAG_PARAMS);
        for (int i=0; i < params.length; i++) {
          serializer.startTag(null,TAG_PARAM).startTag(null,XMLRPCSerializer.TAG_VALUE);
          if (method.equals("String_Node_Str") || method.equals("String_Node_Str")) {
            XMLRPCSerializer.serialize(serializer,params[i],true);
          }
 else {
            XMLRPCSerializer.serialize(serializer,params[i],false);
          }
          serializer.endTag(null,XMLRPCSerializer.TAG_VALUE).endTag(null,TAG_PARAM);
        }
        serializer.endTag(null,TAG_PARAMS);
      }
      serializer.endTag(null,TAG_METHOD_CALL);
      serializer.endDocument();
      HttpEntity entity=new StringEntity(bodyWriter.toString());
      postMethod.setEntity(entity);
    }
    client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,40000);
    client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,40000);
    postMethod.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,40000);
    postMethod.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,40000);
    HttpResponse response=client.execute(postMethod);
    Log.i("String_Node_Str","String_Node_Str" + response.getStatusLine());
    int statusCode=response.getStatusLine().getStatusCode();
    if ((method.equals("String_Node_Str"))) {
      tempFile.delete();
    }
    if (statusCode != HttpStatus.SC_OK) {
      throw new XMLRPCException("String_Node_Str" + statusCode + "String_Node_Str"+ response.getStatusLine().getReasonPhrase());
    }
    XmlPullParser pullParser=XmlPullParserFactory.newInstance().newPullParser();
    HttpEntity entity=response.getEntity();
    PushbackInputStream is=new PushbackInputStream(entity.getContent());
    int bomCheck=is.read();
    int stopper=0;
    while (bomCheck != 60 && stopper < 20) {
      bomCheck=is.read();
      stopper++;
    }
    is.unread(bomCheck);
    pullParser.setInput(is,"String_Node_Str");
    pullParser.nextTag();
    pullParser.require(XmlPullParser.START_TAG,null,TAG_METHOD_RESPONSE);
    pullParser.nextTag();
    String tag=pullParser.getName();
    if (tag.equals(TAG_PARAMS)) {
      pullParser.nextTag();
      pullParser.require(XmlPullParser.START_TAG,null,TAG_PARAM);
      pullParser.nextTag();
      Object obj=XMLRPCSerializer.deserialize(pullParser);
      entity.consumeContent();
      return obj;
    }
 else     if (tag.equals(TAG_FAULT)) {
      pullParser.nextTag();
      Map<String,Object> map=(Map<String,Object>)XMLRPCSerializer.deserialize(pullParser);
      String faultString=(String)map.get(TAG_FAULT_STRING);
      int faultCode=(Integer)map.get(TAG_FAULT_CODE);
      entity.consumeContent();
      throw new XMLRPCFault(faultString,faultCode);
    }
 else {
      entity.consumeContent();
      throw new XMLRPCException("String_Node_Str" + tag + "String_Node_Str");
    }
  }
 catch (  XMLRPCException e) {
    throw e;
  }
catch (  Exception e) {
    throw new XMLRPCException(e);
  }
}

Fixed version (ground truth):
/** 
 * Call method with optional parameters
 * @param method name of method to call
 * @param params parameters to pass to method (may be null if method has no parameters)
 * @return deserialized method return value
 * @throws XMLRPCException
 */
@SuppressWarnings("String_Node_Str") private Object callXMLRPC(String method,Object[] params) throws XMLRPCException {
  try {
    File tempFile=null;
    if (method.equals("String_Node_Str")) {
      String tempFileName="String_Node_Str" + System.currentTimeMillis();
      tempFile=File.createTempFile(tempFileName,null);
      if (!tempFile.exists() && !tempFile.mkdirs()) {
        throw new XMLRPCException("String_Node_Str");
      }
      FileWriter fileWriter=new FileWriter(tempFile);
      serializer.setOutput(fileWriter);
      serializer.startDocument(null,null);
      serializer.startTag(null,TAG_METHOD_CALL);
      serializer.startTag(null,TAG_METHOD_NAME).text(method).endTag(null,TAG_METHOD_NAME);
      if (params != null && params.length != 0) {
        serializer.startTag(null,TAG_PARAMS);
        for (int i=0; i < params.length; i++) {
          serializer.startTag(null,TAG_PARAM).startTag(null,XMLRPCSerializer.TAG_VALUE);
          XMLRPCSerializer.serialize(serializer,params[i]);
          serializer.endTag(null,XMLRPCSerializer.TAG_VALUE).endTag(null,TAG_PARAM);
        }
        serializer.endTag(null,TAG_PARAMS);
      }
      serializer.endTag(null,TAG_METHOD_CALL);
      serializer.endDocument();
      fileWriter.flush();
      fileWriter.close();
      FileEntity fEntity=new FileEntity(tempFile,"String_Node_Str");
      fEntity.setContentType("String_Node_Str");
      postMethod.setEntity(fEntity);
    }
 else {
      StringWriter bodyWriter=new StringWriter();
      serializer.setOutput(bodyWriter);
      serializer.startDocument(null,null);
      serializer.startTag(null,TAG_METHOD_CALL);
      serializer.startTag(null,TAG_METHOD_NAME).text(method).endTag(null,TAG_METHOD_NAME);
      if (params != null && params.length != 0) {
        serializer.startTag(null,TAG_PARAMS);
        for (int i=0; i < params.length; i++) {
          serializer.startTag(null,TAG_PARAM).startTag(null,XMLRPCSerializer.TAG_VALUE);
          if (method.equals("String_Node_Str") || method.equals("String_Node_Str")) {
            XMLRPCSerializer.serialize(serializer,params[i]);
          }
 else {
            XMLRPCSerializer.serialize(serializer,params[i]);
          }
          serializer.endTag(null,XMLRPCSerializer.TAG_VALUE).endTag(null,TAG_PARAM);
        }
        serializer.endTag(null,TAG_PARAMS);
      }
      serializer.endTag(null,TAG_METHOD_CALL);
      serializer.endDocument();
      HttpEntity entity=new StringEntity(bodyWriter.toString());
      postMethod.setEntity(entity);
    }
    client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,40000);
    client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,40000);
    postMethod.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,40000);
    postMethod.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,40000);
    HttpResponse response=client.execute(postMethod);
    Log.i("String_Node_Str","String_Node_Str" + response.getStatusLine());
    int statusCode=response.getStatusLine().getStatusCode();
    if ((method.equals("String_Node_Str"))) {
      tempFile.delete();
    }
    if (statusCode != HttpStatus.SC_OK) {
      throw new XMLRPCException("String_Node_Str" + statusCode + "String_Node_Str"+ response.getStatusLine().getReasonPhrase());
    }
    XmlPullParser pullParser=XmlPullParserFactory.newInstance().newPullParser();
    HttpEntity entity=response.getEntity();
    PushbackInputStream is=new PushbackInputStream(entity.getContent());
    int bomCheck=is.read();
    int stopper=0;
    while (bomCheck != 60 && stopper < 20) {
      bomCheck=is.read();
      stopper++;
    }
    is.unread(bomCheck);
    pullParser.setInput(is,"String_Node_Str");
    pullParser.nextTag();
    pullParser.require(XmlPullParser.START_TAG,null,TAG_METHOD_RESPONSE);
    pullParser.nextTag();
    String tag=pullParser.getName();
    if (tag.equals(TAG_PARAMS)) {
      pullParser.nextTag();
      pullParser.require(XmlPullParser.START_TAG,null,TAG_PARAM);
      pullParser.nextTag();
      Object obj=XMLRPCSerializer.deserialize(pullParser);
      entity.consumeContent();
      return obj;
    }
 else     if (tag.equals(TAG_FAULT)) {
      pullParser.nextTag();
      Map<String,Object> map=(Map<String,Object>)XMLRPCSerializer.deserialize(pullParser);
      String faultString=(String)map.get(TAG_FAULT_STRING);
      int faultCode=(Integer)map.get(TAG_FAULT_CODE);
      entity.consumeContent();
      throw new XMLRPCFault(faultString,faultCode);
    }
 else {
      entity.consumeContent();
      throw new XMLRPCException("String_Node_Str" + tag + "String_Node_Str");
    }
  }
 catch (  XMLRPCException e) {
    throw e;
  }
catch (  Exception e) {
    throw new XMLRPCException(e);
  }
}