You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Problem here is, that the thrift compiler itself camel cases the getter and the setter to
TSignal.getSignalName and TSignal.setSignalName without _ or -.
On line 142 of latest Version of ThriftUtils.getFieldType(...) you are looking for: Method method = containingClass.getDeclaredMethod(prefix + suffix);
The variable suffix evaluates as a result of line 135: String suffix = // uppercase first letter fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
to "getSignal_name" or "isSignal_name" which does not exist in the thrift class.
Would be nice if you could recognize this behaviour and add that eventuality into ThriftUtils.getFieldType.
Possible solutions would be changing the discovery of the fields by using Class.getDeclaredField(...) so you would'nt need the prefix + suffix and may use the field name directly here or additionaly camel case the field name.
Regards,
Bastian
The text was updated successfully, but these errors were encountered:
In my current case the ThriftUtils.getFieldType(...) is not able to successful reflect a field named signal_name out of the thrift class.
Example thrift struct:
The Problem here is, that the thrift compiler itself camel cases the getter and the setter to
TSignal.getSignalName and TSignal.setSignalName without _ or -.
On line 142 of latest Version of ThriftUtils.getFieldType(...) you are looking for:
Method method = containingClass.getDeclaredMethod(prefix + suffix);
The variable suffix evaluates as a result of line 135:
String suffix = // uppercase first letter fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
to "getSignal_name" or "isSignal_name" which does not exist in the thrift class.
Would be nice if you could recognize this behaviour and add that eventuality into ThriftUtils.getFieldType.
Possible solutions would be changing the discovery of the fields by using Class.getDeclaredField(...) so you would'nt need the prefix + suffix and may use the field name directly here or additionaly camel case the field name.
Regards,
Bastian
The text was updated successfully, but these errors were encountered: