Open eboto opened 6 years ago
OK the attached pull request fixes the issue. The new behavior is:
"build"
method on the template companion"apply"
method.This should fix the problem with identical performance for most recently generated templates, and will do the work slightly slower for older templates without breaking backwards compatibility.
Not sure who is maintainer now. @zhaojunz @amory-coursera but would appreciate a review merge and version on this one assuming passing CI (looks like travis has a pretty big queue right now)
@yifan-coursera @amory-coursera any chance you could point the maintainer for this project to take a look at this issue and PR? Seems high-priority -- I don't see how DataTemplates.readX
isn't completely broken for anyone using recent courier templates right now!
(See #71 for reproduction)
For quite a few versions now (since 5acb817876e5109d9acb640f3c4f87f47a8f4c83) I think generated scala records have been incompatible with the
readRecord
methods inorg.coursera.courier.templates.DataTemplates
Attempting to read a record results in
java.lang.NoSuchMethodException: org.coursera.records.test.Simple$.apply
, of course because the previousapply(DataMap, DataConversion)
is nowbuild(DataMap, DataConversion)
My temptation is to update
DataTemplates
to callbuild
instead ofapply
, but that would be backwards incompatible for Courier users who are still operating on old templates. Could also perform two lookups in case the first one fails, but that will double the reflection work for either old or new clients. Curious your thoughts how to remediate?This is relatively high priority for us at Instrumental so would love your thoughts.