cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug in REST APIs RestResponseFactory

franck102
Champ in-the-making
Champ in-the-making
Shouldn't the isAssignableFrom call below be written the other way around?

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?



1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
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