Program: 166495
Project: 166495
Buggy source:
public VXResponse testConfig(VXAsset vXAsset){
  int assetType=vXAsset.getAssetType();
  VXResponse testResponse=new VXResponse();
  boolean connectivityStatus=false;
  HashMap<String,String> configMap=(HashMap<String,String>)jsonUtil.jsonToMap(vXAsset.getConfig());
  String password=configMap.get("String_Node_Str");
  String hiddenPasswordString=PropertiesUtil.getProperty("String_Node_Str","String_Node_Str");
  if (password != null && password.equals(hiddenPasswordString)) {
    String assetName=vXAsset.getName();
    if (assetName != null) {
      XXAsset existingVXAsset=xADaoManager.getXXAsset().findByAssetName(assetName);
      if (existingVXAsset != null && existingVXAsset.getConfig() != null) {
        String existingConfig=existingVXAsset.getConfig();
        HashMap<String,String> existingConfigMap=(HashMap<String,String>)jsonUtil.jsonToMap(existingConfig);
        String existingPassword=existingConfigMap.get("String_Node_Str");
        if (existingPassword != null) {
          configMap.put("String_Node_Str",existingPassword);
        }
      }
    }
  }
  try {
    if (assetType == AppConstants.ASSET_HDFS) {
      HadoopFS connectionObj=new HadoopFS(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        List<String> testResult=connectionObj.listFiles("String_Node_Str",null);
        if (testResult != null && testResult.size() != 0) {
          connectivityStatus=true;
        }
      }
    }
 else     if (assetType == AppConstants.ASSET_HIVE) {
      HiveClient connectionObj=new HiveClient(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        List<String> testResult=connectionObj.getDatabaseList("String_Node_Str");
        if (testResult != null && testResult.size() != 0) {
          connectivityStatus=true;
        }
      }
      connectionObj.close();
    }
 else     if (assetType == AppConstants.ASSET_HBASE) {
      HBaseClient connectionObj=new HBaseClient(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        connectivityStatus=true;
        List<String> testResult=connectionObj.getTableList("String_Node_Str");
        if (testResult != null && testResult.size() != 0) {
          connectivityStatus=true;
        }
      }
    }
 else     if (assetType == AppConstants.ASSET_KNOX) {
      KnoxClient knoxClient=assetConnectionMgr.getKnoxClient(vXAsset.getName(),configMap);
      VXStringList vxStringList=getKnoxResources(knoxClient,"String_Node_Str",null);
      if (vxStringList != null && (vxStringList.getListSize() != 0)) {
        connectivityStatus=true;
      }
    }
 else {
      throw restErrorUtil.createRESTException("String_Node_Str",MessageEnums.INVALID_INPUT_DATA);
    }
    if (connectivityStatus) {
      testResponse.setStatusCode(VXResponse.STATUS_SUCCESS);
    }
 else {
      testResponse.setStatusCode(VXResponse.STATUS_ERROR);
    }
  }
 catch (  Exception e) {
    testResponse.setStatusCode(VXResponse.STATUS_ERROR);
    logger.error("String_Node_Str" + vXAsset.getName(),e);
  }
  return testResponse;
}

Fixed version (ground truth):
public VXResponse testConfig(VXAsset vXAsset){
  int assetType=vXAsset.getAssetType();
  VXResponse testResponse=new VXResponse();
  boolean connectivityStatus=false;
  HashMap<String,String> configMap=(HashMap<String,String>)jsonUtil.jsonToMap(vXAsset.getConfig());
  String password=configMap.get("String_Node_Str");
  String hiddenPasswordString=PropertiesUtil.getProperty("String_Node_Str","String_Node_Str");
  if (password != null && password.equals(hiddenPasswordString)) {
    String assetName=vXAsset.getName();
    if (assetName != null) {
      XXAsset existingVXAsset=xADaoManager.getXXAsset().findByAssetName(assetName);
      if (existingVXAsset != null && existingVXAsset.getConfig() != null) {
        String existingConfig=existingVXAsset.getConfig();
        HashMap<String,String> existingConfigMap=(HashMap<String,String>)jsonUtil.jsonToMap(existingConfig);
        String existingPassword=existingConfigMap.get("String_Node_Str");
        if (existingPassword != null) {
          configMap.put("String_Node_Str",existingPassword);
        }
      }
    }
  }
  try {
    if (assetType == AppConstants.ASSET_HDFS) {
      HadoopFS connectionObj=new HadoopFS(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        List<String> testResult=connectionObj.listFiles("String_Node_Str",null);
        if (testResult != null && testResult.size() != 0) {
          connectivityStatus=true;
        }
      }
    }
 else     if (assetType == AppConstants.ASSET_HIVE) {
      HiveClient connectionObj=new HiveClient(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        List<String> testResult=connectionObj.getDatabaseList("String_Node_Str");
        if (testResult != null && testResult.size() != 0) {
          connectivityStatus=true;
        }
      }
      connectionObj.close();
    }
 else     if (assetType == AppConstants.ASSET_HBASE) {
      HBaseClient connectionObj=new HBaseClient(vXAsset.getName(),configMap);
      if (connectionObj != null) {
        connectivityStatus=connectionObj.getHBaseStatus();
      }
 else {
        Log.error("String_Node_Str");
      }
    }
 else     if (assetType == AppConstants.ASSET_KNOX) {
      KnoxClient knoxClient=assetConnectionMgr.getKnoxClient(vXAsset.getName(),configMap);
      VXStringList vxStringList=getKnoxResources(knoxClient,"String_Node_Str",null);
      if (vxStringList != null && (vxStringList.getListSize() != 0)) {
        connectivityStatus=true;
      }
    }
 else {
      throw restErrorUtil.createRESTException("String_Node_Str",MessageEnums.INVALID_INPUT_DATA);
    }
    if (connectivityStatus) {
      testResponse.setStatusCode(VXResponse.STATUS_SUCCESS);
    }
 else {
      testResponse.setStatusCode(VXResponse.STATUS_ERROR);
    }
  }
 catch (  Exception e) {
    testResponse.setStatusCode(VXResponse.STATUS_ERROR);
    logger.error("String_Node_Str" + vXAsset.getName(),e);
  }
  return testResponse;
}