Program: 125565
Project: 125565
Buggy source:
static void matchContextPropertiesForDbConnection(EDBParamName dbParam,DatabaseConnection conn,String originalVariableName){
switch (dbParam) {
case AdditionalParams:
    conn.setAdditionalParams(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
  break;
case Datasource:
conn.setDatasourceName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case DBRootPath:
conn.setDBRootPath(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case File:
conn.setFileFieldName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Password:
conn.setPassword(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case JdbcUrl:
conn.setURL(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case DriverJar:
conn.setDriverJarPath(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case MappingFile:
conn.setDbmsId(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case ClassName:
conn.setDriverClass(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Port:
conn.setPort(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Schema:
conn.setUiSchema(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Server:
conn.setServerName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Sid:
case Database:
case ServiceName:
conn.setSID(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Login:
conn.setUsername(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USERNAME,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case JobTrackerOrResourceManager:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case NameNode:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HivePrincipal:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_HIVEPRINCIPLA,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveMetastore:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_METASTOREURL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveDriverJar:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_DRIVERJAR_PATH,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveDriveClass:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_DRIVERCLASS,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveUserName:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_USERNAME,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HivePassword:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_PASSWORD,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveKeyTabPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveKeyTab:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveAdditionalJDBCParameters:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ADDITIONAL_JDBC_SETTINGS,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveSSLTrustStorePath:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PATH,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveSSLTrustStorePassword:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PASSWORD,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case MasterPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case RegionPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HbaseKeyTabPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HbaseKeyTab:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
default :
}
}

Fixed version (ground truth):
static void matchContextPropertiesForDbConnection(EDBParamName dbParam,DatabaseConnection conn,String originalVariableName){
switch (dbParam) {
case AdditionalParams:
    conn.setAdditionalParams(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
  break;
case Datasource:
conn.setDatasourceName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case DBRootPath:
conn.setDBRootPath(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case File:
conn.setFileFieldName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Password:
conn.setPassword(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case JdbcUrl:
conn.setURL(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case DriverJar:
conn.setDriverJarPath(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case MappingFile:
conn.setDbmsId(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case ClassName:
conn.setDriverClass(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Port:
conn.setPort(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Schema:
conn.setUiSchema(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Server:
conn.setServerName(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Sid:
case Database:
case ServiceName:
conn.setSID(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Login:
conn.setUsername(ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_USERNAME,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case JobTrackerOrResourceManager:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case NameNode:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HivePrincipal:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_HIVEPRINCIPLA,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveMetastore:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_METASTOREURL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveDriverJar:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_DRIVERJAR_PATH,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveDriveClass:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_DRIVERCLASS,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveUserName:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_USERNAME,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HivePassword:
conn.getParameters().put(ConnParameterKeys.HIVE_AUTHENTICATION_PASSWORD,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveKeyTabPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HiveKeyTab:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveAdditionalJDBCParameters:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_ADDITIONAL_JDBC_SETTINGS,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveSSLTrustStorePath:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PATH,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case hiveSSLTrustStorePassword:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_SSL_TRUST_STORE_PASSWORD,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case MasterPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case RegionPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HbaseKeyTabPrincipal:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case HbaseKeyTab:
conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Username:
String key=ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_USERNAME;
if (EDatabaseTypeName.HBASE.getDisplayName().equals(conn.getDatabaseType())) {
key=ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_USERNAME;
}
conn.getParameters().put(key,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Maprticket_Password:
key=ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_PASSWORD;
if (EDatabaseTypeName.HBASE.getDisplayName().equals(conn.getDatabaseType())) {
key=ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_PASSWORD;
}
conn.getParameters().put(key,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Maprticket_Cluster:
key=ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_CLUSTER;
if (EDatabaseTypeName.HBASE.getDisplayName().equals(conn.getDatabaseType())) {
key=ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_CLUSTER;
}
conn.getParameters().put(key,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
case Maprticket_Duration:
key=ConnParameterKeys.CONN_PARA_KEY_HIVE_AUTHENTICATION_MAPRTICKET_DURATION;
if (EDatabaseTypeName.HBASE.getDisplayName().equals(conn.getDatabaseType())) {
key=ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MAPRTICKET_DURATION;
}
conn.getParameters().put(key,ContextParameterUtils.getNewScriptCode(originalVariableName,LANGUAGE));
break;
default :
}
}