Program: 62157
Project: 62157
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> finalMap=Maps.newHashMap();
      map.forEach((key,value) -> finalMap.put(key,toPropertyValue(value,propertyDefinition.getEntrySchema())));
      return new ComplexPropertyValue(finalMap);
    }
 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 finalList=new LinkedList();
    for (    Object item : list) {
      finalList.add(toPropertyValue(item,propertyDefinition.getEntrySchema()));
    }
    return new ListPropertyValue(finalList);
  }
 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) {
return new ComplexPropertyValue((Map<String,Object>)resolvedPropertyValue);
}
 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 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;
Map<String,Object> resultMap=Maps.newHashMap();
map.forEach((key,value) -> {
PropertyDefinition entryDefinition=dataType.getProperties().get(key);
if (entryDefinition == null) {
  throw new IllegalStateException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str"+ key+ "String_Node_Str");
}
resultMap.put(key,toPropertyValue(value,entryDefinition));
}
);
return new ComplexPropertyValue(resultMap);
}
 else {
throw new IllegalStateException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
}
}
}