Program: 105278
Project: 105278
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void setFieldValue(final Field field,final BaseCmd cmdObj,final Object paramObj,final Parameter annotation) throws IllegalArgumentException, ParseException {
  try {
    field.setAccessible(true);
    final CommandType fieldType=annotation.type();
switch (fieldType) {
case BOOLEAN:
      field.set(cmdObj,Boolean.valueOf(paramObj.toString()));
    break;
case DATE:
  if (cmdObj instanceof ListEventsCmd || cmdObj instanceof DeleteEventsCmd || cmdObj instanceof ArchiveEventsCmd|| cmdObj instanceof ArchiveAlertsCmd|| cmdObj instanceof DeleteAlertsCmd|| cmdObj instanceof GetUsageRecordsCmd) {
    final boolean isObjInNewDateFormat=isObjInNewDateFormat(paramObj.toString());
    if (isObjInNewDateFormat) {
      final DateFormat newFormat=BaseCmd.NEW_INPUT_FORMAT;
synchronized (newFormat) {
        field.set(cmdObj,newFormat.parse(paramObj.toString()));
      }
    }
 else {
      final DateFormat format=BaseCmd.INPUT_FORMAT;
synchronized (format) {
        Date date=format.parse(paramObj.toString());
        if (field.getName().equals("String_Node_Str")) {
          date=messageDate(date,0,0,0);
        }
 else         if (field.getName().equals("String_Node_Str")) {
          date=messageDate(date,23,59,59);
        }
        field.set(cmdObj,date);
      }
    }
  }
 else {
    final DateFormat format=BaseCmd.INPUT_FORMAT;
synchronized (format) {
      format.setLenient(false);
      field.set(cmdObj,format.parse(paramObj.toString()));
    }
  }
break;
case FLOAT:
if (paramObj != null && isNotBlank(paramObj.toString())) {
field.set(cmdObj,Float.valueOf(paramObj.toString()));
}
break;
case INTEGER:
if (paramObj != null && isNotBlank(paramObj.toString())) {
field.set(cmdObj,Integer.valueOf(paramObj.toString()));
}
break;
case LIST:
final List listParam=new ArrayList();
final StringTokenizer st=new StringTokenizer(paramObj.toString(),"String_Node_Str");
while (st.hasMoreTokens()) {
final String token=st.nextToken();
final CommandType listType=annotation.collectionType();
switch (listType) {
case INTEGER:
listParam.add(Integer.valueOf(token));
break;
case UUID:
if (token.isEmpty()) break;
final Long internalId=translateUuidToInternalId(token,annotation);
listParam.add(internalId);
break;
case LONG:
{
listParam.add(Long.valueOf(token));
}
break;
case SHORT:
listParam.add(Short.valueOf(token));
break;
case STRING:
listParam.add(token);
break;
}
}
field.set(cmdObj,listParam);
break;
case UUID:
final Long internalId=translateUuidToInternalId(paramObj.toString(),annotation);
field.set(cmdObj,internalId);
break;
case LONG:
field.set(cmdObj,Long.valueOf(paramObj.toString()));
break;
case SHORT:
field.set(cmdObj,Short.valueOf(paramObj.toString()));
break;
case STRING:
if ((paramObj != null)) {
if (paramObj.toString().length() > annotation.length()) {
s_logger.error("String_Node_Str" + annotation.length() + "String_Node_Str"+ field.getName());
throw new InvalidParameterValueException("String_Node_Str" + annotation.length() + "String_Node_Str"+ field.getName());
}
 else {
field.set(cmdObj,paramObj.toString());
}
}
break;
case TZDATE:
field.set(cmdObj,DateUtil.parseTZDateString(paramObj.toString()));
break;
case MAP:
default :
field.set(cmdObj,paramObj);
break;
}
}
 catch (final IllegalAccessException ex) {
s_logger.error("String_Node_Str" + cmdObj.getCommandName() + "String_Node_Str"+ field.getName()+ "String_Node_Str");
throw new CloudRuntimeException("String_Node_Str" + cmdObj.getCommandName() + "String_Node_Str"+ field.getName()+ "String_Node_Str");
}
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void setFieldValue(final Field field,final BaseCmd cmdObj,final Object paramObj,final Parameter annotation) throws IllegalArgumentException, ParseException {
  try {
    field.setAccessible(true);
    final CommandType fieldType=annotation.type();
switch (fieldType) {
case BOOLEAN:
      field.set(cmdObj,Boolean.valueOf(paramObj.toString()));
    break;
case DATE:
  if (cmdObj instanceof ListEventsCmd || cmdObj instanceof DeleteEventsCmd || cmdObj instanceof ArchiveEventsCmd|| cmdObj instanceof ArchiveAlertsCmd|| cmdObj instanceof DeleteAlertsCmd|| cmdObj instanceof GetUsageRecordsCmd) {
    final boolean isObjInNewDateFormat=isObjInNewDateFormat(paramObj.toString());
    if (isObjInNewDateFormat) {
      final DateFormat newFormat=newInputFormat;
synchronized (newFormat) {
        field.set(cmdObj,newFormat.parse(paramObj.toString()));
      }
    }
 else {
      final DateFormat format=inputFormat;
synchronized (format) {
        Date date=format.parse(paramObj.toString());
        if (field.getName().equals("String_Node_Str")) {
          date=messageDate(date,0,0,0);
        }
 else         if (field.getName().equals("String_Node_Str")) {
          date=messageDate(date,23,59,59);
        }
        field.set(cmdObj,date);
      }
    }
  }
 else {
    final DateFormat format=inputFormat;
synchronized (format) {
      format.setLenient(false);
      field.set(cmdObj,format.parse(paramObj.toString()));
    }
  }
break;
case FLOAT:
if (paramObj != null && isNotBlank(paramObj.toString())) {
field.set(cmdObj,Float.valueOf(paramObj.toString()));
}
break;
case INTEGER:
if (paramObj != null && isNotBlank(paramObj.toString())) {
field.set(cmdObj,Integer.valueOf(paramObj.toString()));
}
break;
case LIST:
final List listParam=new ArrayList();
final StringTokenizer st=new StringTokenizer(paramObj.toString(),"String_Node_Str");
while (st.hasMoreTokens()) {
final String token=st.nextToken();
final CommandType listType=annotation.collectionType();
switch (listType) {
case INTEGER:
listParam.add(Integer.valueOf(token));
break;
case UUID:
if (token.isEmpty()) break;
final Long internalId=translateUuidToInternalId(token,annotation);
listParam.add(internalId);
break;
case LONG:
{
listParam.add(Long.valueOf(token));
}
break;
case SHORT:
listParam.add(Short.valueOf(token));
break;
case STRING:
listParam.add(token);
break;
}
}
field.set(cmdObj,listParam);
break;
case UUID:
final Long internalId=translateUuidToInternalId(paramObj.toString(),annotation);
field.set(cmdObj,internalId);
break;
case LONG:
field.set(cmdObj,Long.valueOf(paramObj.toString()));
break;
case SHORT:
field.set(cmdObj,Short.valueOf(paramObj.toString()));
break;
case STRING:
if ((paramObj != null)) {
if (paramObj.toString().length() > annotation.length()) {
s_logger.error("String_Node_Str" + annotation.length() + "String_Node_Str"+ field.getName());
throw new InvalidParameterValueException("String_Node_Str" + annotation.length() + "String_Node_Str"+ field.getName());
}
 else {
field.set(cmdObj,paramObj.toString());
}
}
break;
case TZDATE:
field.set(cmdObj,DateUtil.parseTZDateString(paramObj.toString()));
break;
case MAP:
default :
field.set(cmdObj,paramObj);
break;
}
}
 catch (final IllegalAccessException ex) {
s_logger.error("String_Node_Str" + cmdObj.getCommandName() + "String_Node_Str"+ field.getName()+ "String_Node_Str");
throw new CloudRuntimeException("String_Node_Str" + cmdObj.getCommandName() + "String_Node_Str"+ field.getName()+ "String_Node_Str");
}
}