Program: 114800
Project: 114800
Buggy source:
/** 
 * Generate Swagger v2 paths object from swagger v1.2 document See <a href="https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#paths-object">Swagger v2 paths object</a>
 * @param apiDefinitionPaths API definition paths
 * @return swagger v2 paths object
 * @throws ParseException
 */
private static JSONObject generatePathsObj(Map<String,JSONArray> apiDefinitionPaths) throws ParseException {
  JSONObject pathsObj=new JSONObject();
  String defaultType="String_Node_Str";
  JSONObject responseObject=new JSONObject();
  JSONObject status200=new JSONObject();
  status200.put(Constants.SWAGGER_DESCRIPTION,"String_Node_Str");
  responseObject.put(Constants.SWAGGER_RESPONSE_200,status200);
  for (  Map.Entry<String,JSONArray> entry : apiDefinitionPaths.entrySet()) {
    String key=entry.getKey();
    JSONArray operations=entry.getValue();
    JSONObject pathItemObj=new JSONObject();
    for (    Object operation : operations) {
      JSONObject operationObject=(JSONObject)operation;
      if (operationObject.containsKey("String_Node_Str")) {
        String method=(String)operationObject.get("String_Node_Str");
        if (operationObject.containsKey("String_Node_Str")) {
          JSONArray swagger2ParamObjects=(JSONArray)operationObject.get("String_Node_Str");
          JSONObject swagger2OperationsObj=new JSONObject();
          JSONArray newParameters=new JSONArray();
          for (          Object swagger2ParamObj : swagger2ParamObjects) {
            JSONObject oldParam=(JSONObject)swagger2ParamObj;
            JSONObject paramObj=new JSONObject();
            paramObj.put(Constants.SWAGGER_NAME,oldParam.get(Constants.SWAGGER_NAME));
            paramObj.put(Constants.SWAGGER_PARAM_TYPE_IN,oldParam.get("String_Node_Str"));
            if (Constants.SWAGGER_PARAM_TYPE_BODY.equals(oldParam.get("String_Node_Str"))) {
              JSONObject refObject=new JSONObject();
              refObject.put(Constants.SWAGGER_REF,"String_Node_Str");
              paramObj.put(Constants.SWAGGER_BODY_SCHEMA,refObject);
            }
 else {
              if (paramObj.containsKey(Constants.SWAGGER_REQUIRED_PARAM)) {
                paramObj.put(Constants.SWAGGER_PARAM_TYPE,oldParam.get("String_Node_Str"));
              }
 else {
                paramObj.put(Constants.SWAGGER_PARAM_TYPE,defaultType);
              }
            }
            if (paramObj.containsKey(Constants.SWAGGER_REQUIRED_PARAM)) {
              paramObj.put(Constants.SWAGGER_REQUIRED_PARAM,oldParam.get(Constants.SWAGGER_REQUIRED_PARAM));
            }
 else {
              paramObj.put(Constants.SWAGGER_REQUIRED_PARAM,Boolean.FALSE);
            }
            if (paramObj.containsKey(Constants.SWAGGER_DESCRIPTION)) {
              paramObj.put(Constants.SWAGGER_DESCRIPTION,oldParam.get(Constants.SWAGGER_DESCRIPTION));
            }
 else {
              paramObj.put(Constants.SWAGGER_DESCRIPTION,"String_Node_Str");
            }
            newParameters.add(paramObj);
          }
          swagger2OperationsObj.put(Constants.SWAGGER_OPERATION_ID,operationObject.get("String_Node_Str"));
          swagger2OperationsObj.put(Constants.SWAGGER_PARAMETERS,newParameters);
          if (operationObject.containsKey(Constants.SWAGGER_AUTH_TYPE)) {
            swagger2OperationsObj.put(Constants.SWAGGER_X_AUTH_TYPE,operationObject.get(Constants.SWAGGER_AUTH_TYPE));
          }
          if (operationObject.containsKey(Constants.SWAGGER_THROTTLING_TIER)) {
            swagger2OperationsObj.put(Constants.SWAGGER_X_THROTTLING_TIER,operationObject.get(Constants.SWAGGER_THROTTLING_TIER));
          }
          if (operationObject.containsKey("String_Node_Str")) {
            swagger2OperationsObj.put(Constants.SWAGGER_DESCRIPTION,operationObject.get("String_Node_Str"));
          }
          if (operationObject.containsKey(Constants.SWAGGER_SUMMARY)) {
            swagger2OperationsObj.put(Constants.SWAGGER_SUMMARY,operationObject.get(Constants.SWAGGER_SUMMARY));
          }
          pathItemObj.put(method.toLowerCase(),swagger2OperationsObj);
          if (operationObject.containsKey("String_Node_Str")) {
            responseObject=new JSONObject();
            JSONArray responseMessages=(JSONArray)operationObject.get("String_Node_Str");
            for (            Object responseMessage : responseMessages) {
              JSONObject errorObj=(JSONObject)responseMessage;
              responseObject.put(errorObj.get("String_Node_Str"),errorObj.get("String_Node_Str"));
            }
          }
          swagger2OperationsObj.put(Constants.SWAGGER_RESPONSES,responseObject);
        }
      }
 else {
        log.error("String_Node_Str");
      }
    }
    pathsObj.put(key,pathItemObj);
  }
  return pathsObj;
}

Fixed version (ground truth):
/** 
 * Generate Swagger v2 paths object from swagger v1.2 document See <a href="https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#paths-object">Swagger v2 paths object</a>
 * @param apiDefinitionPaths API definition paths
 * @return swagger v2 paths object
 * @throws ParseException
 */
private static JSONObject generatePathsObj(Map<String,JSONArray> apiDefinitionPaths) throws ParseException {
  JSONObject pathsObj=new JSONObject();
  String defaultType="String_Node_Str";
  JSONObject responseObject=new JSONObject();
  JSONObject status200=new JSONObject();
  status200.put(Constants.SWAGGER_DESCRIPTION,"String_Node_Str");
  responseObject.put(Constants.SWAGGER_RESPONSE_200,status200);
  for (  Map.Entry<String,JSONArray> entry : apiDefinitionPaths.entrySet()) {
    try {
      String key=entry.getKey();
      JSONArray operations=entry.getValue();
      JSONObject pathItemObj=new JSONObject();
      for (      Object operation : operations) {
        JSONObject operationObject=(JSONObject)operation;
        if (operationObject.containsKey("String_Node_Str")) {
          String method=(String)operationObject.get("String_Node_Str");
          if (operationObject.containsKey("String_Node_Str")) {
            JSONObject swagger2OperationsObj=null;
            JSONArray newParameters=null;
            Object swagger2Params=operationObject.get("String_Node_Str");
            if (swagger2Params == null) {
              continue;
            }
            if (swagger2Params instanceof JSONArray) {
              JSONArray swagger2ParamObjects=(JSONArray)swagger2Params;
              swagger2OperationsObj=new JSONObject();
              newParameters=new JSONArray();
              for (              Object swagger2ParamObj : swagger2ParamObjects) {
                JSONObject oldParam=(JSONObject)swagger2ParamObj;
                JSONObject paramObj=new JSONObject();
                paramObj.put(Constants.SWAGGER_NAME,oldParam.get(Constants.SWAGGER_NAME));
                paramObj.put(Constants.SWAGGER_PARAM_TYPE_IN,oldParam.get("String_Node_Str"));
                if (Constants.SWAGGER_PARAM_TYPE_BODY.equals(oldParam.get("String_Node_Str"))) {
                  JSONObject refObject=new JSONObject();
                  refObject.put(Constants.SWAGGER_REF,"String_Node_Str");
                  paramObj.put(Constants.SWAGGER_BODY_SCHEMA,refObject);
                }
 else {
                  if (paramObj.containsKey(Constants.SWAGGER_REQUIRED_PARAM)) {
                    paramObj.put(Constants.SWAGGER_PARAM_TYPE,oldParam.get("String_Node_Str"));
                  }
 else {
                    paramObj.put(Constants.SWAGGER_PARAM_TYPE,defaultType);
                  }
                }
                if (paramObj.containsKey(Constants.SWAGGER_REQUIRED_PARAM)) {
                  paramObj.put(Constants.SWAGGER_REQUIRED_PARAM,oldParam.get(Constants.SWAGGER_REQUIRED_PARAM));
                }
 else {
                  paramObj.put(Constants.SWAGGER_REQUIRED_PARAM,Boolean.FALSE);
                }
                if (paramObj.containsKey(Constants.SWAGGER_DESCRIPTION)) {
                  paramObj.put(Constants.SWAGGER_DESCRIPTION,oldParam.get(Constants.SWAGGER_DESCRIPTION));
                }
 else {
                  paramObj.put(Constants.SWAGGER_DESCRIPTION,"String_Node_Str");
                }
                newParameters.add(paramObj);
              }
            }
            swagger2OperationsObj.put(Constants.SWAGGER_OPERATION_ID,operationObject.get("String_Node_Str"));
            swagger2OperationsObj.put(Constants.SWAGGER_PARAMETERS,newParameters);
            if (operationObject.containsKey(Constants.SWAGGER_AUTH_TYPE)) {
              swagger2OperationsObj.put(Constants.SWAGGER_X_AUTH_TYPE,operationObject.get(Constants.SWAGGER_AUTH_TYPE));
            }
            if (operationObject.containsKey(Constants.SWAGGER_THROTTLING_TIER)) {
              swagger2OperationsObj.put(Constants.SWAGGER_X_THROTTLING_TIER,operationObject.get(Constants.SWAGGER_THROTTLING_TIER));
            }
            if (operationObject.containsKey("String_Node_Str")) {
              swagger2OperationsObj.put(Constants.SWAGGER_DESCRIPTION,operationObject.get("String_Node_Str"));
            }
            if (operationObject.containsKey(Constants.SWAGGER_SUMMARY)) {
              swagger2OperationsObj.put(Constants.SWAGGER_SUMMARY,operationObject.get(Constants.SWAGGER_SUMMARY));
            }
            pathItemObj.put(method.toLowerCase(),swagger2OperationsObj);
            if (operationObject.containsKey("String_Node_Str")) {
              responseObject=new JSONObject();
              JSONArray responseMessages=(JSONArray)operationObject.get("String_Node_Str");
              for (              Object responseMessage : responseMessages) {
                JSONObject errorObj=(JSONObject)responseMessage;
                responseObject.put(errorObj.get("String_Node_Str"),errorObj.get("String_Node_Str"));
              }
            }
            swagger2OperationsObj.put(Constants.SWAGGER_RESPONSES,responseObject);
          }
        }
 else {
          log.error("String_Node_Str");
        }
      }
      pathsObj.put(key,pathItemObj);
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + entry.getKey() + "String_Node_Str"+ "String_Node_Str"+ entry.getValue().toString(),e);
    }
  }
  return pathsObj;
}