Program: 62125
Project: 62125
Buggy source:
@SuppressWarnings("String_Node_Str") public PropertyValue toPropertyValue(Object resolvedPropertyValue,PropertyDefinition propertyDefinition){
  if (resolvedPropertyValue == null) {
    return null;
  }
  if (ToscaTypes.isSimple(propertyDefinition.getType())) {
    return new ScalarPropertyValue(resolvedPropertyValue.toString());
  }
switch (propertyDefinition.getType()) {
case ToscaTypes.MAP:
    if (resolvedPropertyValue instanceof Map) {
      Map<String,Object> map=(Map<String,Object>)resolvedPropertyValue;
      Map<String,Object> resultMap=Maps.newHashMap();
      map.forEach((key,value) -> resultMap.put(key,toPropertyValue(value,propertyDefinition.getEntrySchema())));
      return new ComplexPropertyValue(resultMap);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + Map.class.getSimpleName() + "String_Node_Str"+ resolvedPropertyValue.getClass().getName()+ "String_Node_Str");
    }
case ToscaTypes.LIST:
  if (resolvedPropertyValue instanceof Collection) {
    List list=(List)resolvedPropertyValue;
    List resultList=new LinkedList();
    for (    Object item : list) {
      resultList.add(toPropertyValue(item,propertyDefinition.getEntrySchema()));
    }
    return new ListPropertyValue(resultList);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + Collection.class.getSimpleName() + "String_Node_Str"+ resolvedPropertyValue.getClass().getName()+ "String_Node_Str");
  }
default :
DataType dataType=findDataType(propertyDefinition.getType());
if (dataType == null) {
throw new IllegalStateException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
}
if (dataType.isDeriveFromSimpleType()) {
return new ScalarPropertyValue(resolvedPropertyValue.toString());
}
 else if (resolvedPropertyValue instanceof Map) {
Map<String,Object> map=(Map<String,Object>)resolvedPropertyValue;
return new ComplexPropertyValue(map);
}
 else {
throw new IllegalStateException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
}
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public PropertyValue toPropertyValue(Object resolvedPropertyValue,PropertyDefinition propertyDefinition){
  if (resolvedPropertyValue == null) {
    return null;
  }
  if (ToscaTypes.isSimple(propertyDefinition.getType())) {
    return new ScalarPropertyValue(resolvedPropertyValue.toString());
  }
switch (propertyDefinition.getType()) {
case ToscaTypes.MAP:
    if (resolvedPropertyValue instanceof Map) {
      Map<String,Object> map=(Map<String,Object>)resolvedPropertyValue;
      Map<String,Object> resultMap=Maps.newHashMap();
      map.forEach((key,value) -> resultMap.put(key,toPropertyValue(value,propertyDefinition.getEntrySchema())));
      return new ComplexPropertyValue(resultMap);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + Map.class.getSimpleName() + "String_Node_Str"+ resolvedPropertyValue.getClass().getName()+ "String_Node_Str");
    }
case ToscaTypes.LIST:
  if (resolvedPropertyValue instanceof Collection) {
    List list=(List)resolvedPropertyValue;
    List resultList=new LinkedList();
    for (    Object item : list) {
      resultList.add(toPropertyValue(item,propertyDefinition.getEntrySchema()));
    }
    return new ListPropertyValue(resultList);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + Collection.class.getSimpleName() + "String_Node_Str"+ resolvedPropertyValue.getClass().getName()+ "String_Node_Str");
  }
default :
DataType dataType=findDataType(propertyDefinition.getType());
if (dataType == null) {
throw new NotFoundException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
}
if (dataType.isDeriveFromSimpleType()) {
return new ScalarPropertyValue(resolvedPropertyValue.toString());
}
 else if (resolvedPropertyValue instanceof Map) {
Map<String,Object> map=(Map<String,Object>)resolvedPropertyValue;
return new ComplexPropertyValue(map);
}
 else {
throw new IllegalStateException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str"+ resolvedPropertyValue.getClass().getName()+ "String_Node_Str");
}
}
}