Possible bug in REST APIs RestResponseFactory

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2014 07:23 AM
Shouldn't the isAssignableFrom call below be written the other way around?
org.activiti.rest.service.api.RestResponseFactory#createRestVariable:
A converter can convert a subtype into the base type it supports, but not the reverse.
Currently a converter such that converter.getVariableType() == "Cat" will be asked to convert an "Animal" to a "Cat"… that doesn't seem right?
org.activiti.rest.service.api.RestResponseFactory#createRestVariable:
for (RestVariableConverter c : variableConverters) { if (value.getClass().isAssignableFrom(c.getVariableType())) { converter = c; break; } } if (converter != null) { converter.convertVariableValue(value, restVar);
A converter can convert a subtype into the base type it supports, but not the reverse.
Currently a converter such that converter.getVariableType() == "Cat" will be asked to convert an "Animal" to a "Cat"… that doesn't seem right?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2014 03:40 AM
Yes, you're right. This has gone through our testing, since no variable-types by default use inheritance. I've fixed this on master:
https://github.com/Activiti/Activiti/commit/8a0c521535f182845691d1d5819d0f70a0cc46aa
https://github.com/Activiti/Activiti/commit/8a0c521535f182845691d1d5819d0f70a0cc46aa
