Program: 124642
Project: 124642
Buggy source:
@Override public List<IContextParameter> createContextParameters(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  List<IContextParameter> varList=new ArrayList<IContextParameter>();
  if (connection instanceof NoSQLConnection) {
    NoSQLConnection conn=(NoSQLConnection)connection;
    JavaType javaType=null;
    if (conn == null || prefixName == null || paramSet == null || paramSet.isEmpty()) {
      return Collections.emptyList();
    }
    for (    Map.Entry<String,String> attr : ((NoSQLConnection)connection).getAttributes()) {
      if (INoSQLCommonAttributes.PASSWORD.equals(attr)) {
        javaType=JavaTypesManager.PASSWORD;
      }
    }
    String paramPrefix=prefixName + ConnectionContextHelper.LINE;
    String paramName=null;
    for (    IConnParamName param : paramSet) {
      if (param instanceof EHadoopParamName) {
        EHadoopParamName noSqlParam=(EHadoopParamName)param;
        paramName=paramPrefix + noSqlParam;
switch (noSqlParam) {
case Server:
          ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.HOST),javaType);
        break;
case Port:
      ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.PORT),javaType);
    break;
case Keyspace:
  ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.DATABASE),javaType);
break;
case Database:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.DATABASE),javaType);
break;
case Databasepath:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INeo4jAttributes.DATABASE_PATH),javaType);
break;
case ServerUrl:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INeo4jAttributes.SERVER_URL),javaType);
break;
case UserName:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.USERNAME),javaType);
break;
case Password:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.PASSWORD),JavaTypesManager.PASSWORD);
break;
case ReplicaSets:
String replicaSets=conn.getAttributes().get(IMongoDBAttributes.REPLICA_SET);
if (StringUtils.isNotEmpty(replicaSets)) {
try {
JSONArray jsa=new JSONArray(replicaSets);
for (int i=0; i < jsa.length(); i++) {
JSONObject jso=jsa.getJSONObject(i);
String hostParamName=paramPrefix + EHadoopParamName.ReplicaHost.name() + ConnectionContextHelper.LINE+ (i + 1);
String portParamName=paramPrefix + EHadoopParamName.ReplicaPort.name() + ConnectionContextHelper.LINE+ (i + 1);
String hostValue=jso.getString(IMongoConstants.REPLICA_HOST_KEY);
String portValue=jso.getString(IMongoConstants.REPLICA_PORT_KEY);
ConnectionContextHelper.createParameters(varList,hostParamName,hostValue,javaType);
ConnectionContextHelper.createParameters(varList,portParamName,portValue,javaType);
}
}
 catch (JSONException e) {
ExceptionHandler.process(e);
}
}
break;
default :
}
}
}
}
return varList;
}

Fixed version (ground truth):
@Override public List<IContextParameter> createContextParameters(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  List<IContextParameter> varList=new ArrayList<IContextParameter>();
  if (connection instanceof NoSQLConnection) {
    NoSQLConnection conn=(NoSQLConnection)connection;
    JavaType javaType=null;
    if (conn == null || prefixName == null || paramSet == null || paramSet.isEmpty()) {
      return Collections.emptyList();
    }
    for (    Map.Entry<String,String> attr : ((NoSQLConnection)connection).getAttributes()) {
      if (INoSQLCommonAttributes.PASSWORD.equals(attr)) {
        javaType=JavaTypesManager.PASSWORD;
      }
    }
    String paramPrefix=prefixName + ConnectionContextHelper.LINE;
    String paramName=null;
    for (    IConnParamName param : paramSet) {
      if (param instanceof EHadoopParamName) {
        EHadoopParamName noSqlParam=(EHadoopParamName)param;
        paramName=paramPrefix + noSqlParam;
switch (noSqlParam) {
case Server:
          ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.HOST),javaType);
        break;
case Port:
      ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.PORT),javaType);
    break;
case Keyspace:
  ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.DATABASE),javaType);
break;
case Database:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.DATABASE),javaType);
break;
case Databasepath:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INeo4jAttributes.DATABASE_PATH),javaType);
break;
case ServerUrl:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INeo4jAttributes.SERVER_URL),javaType);
break;
case UserName:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.USERNAME),javaType);
break;
case Password:
ConnectionContextHelper.createParameters(varList,paramName,conn.getAttributes().get(INoSQLCommonAttributes.PASSWORD),JavaTypesManager.PASSWORD);
break;
case ReplicaSets:
String replicaSets=conn.getAttributes().get(IMongoDBAttributes.REPLICA_SET);
if (StringUtils.isNotEmpty(replicaSets)) {
try {
JSONArray jsa=new JSONArray(replicaSets);
for (int i=0; i < jsa.length(); i++) {
JSONObject jso=jsa.getJSONObject(i);
String hostParamName=paramPrefix + EHadoopParamName.ReplicaHost.name() + ConnectionContextHelper.LINE+ (i + 1);
String portParamName=paramPrefix + EHadoopParamName.ReplicaPort.name() + ConnectionContextHelper.LINE+ (i + 1);
String hostValue=jso.getString(IMongoConstants.REPLICA_HOST_KEY);
String portValue=jso.getString(IMongoConstants.REPLICA_PORT_KEY);
ConnectionContextHelper.createParameters(varList,hostParamName,hostValue,JavaTypesManager.STRING);
ConnectionContextHelper.createParameters(varList,portParamName,portValue,JavaTypesManager.INTEGER);
}
}
 catch (JSONException e) {
ExceptionHandler.process(e);
}
}
break;
default :
}
}
}
}
return varList;
}