diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/GoldService.java b/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/GoldService.java index 38e0daa99..889b2de78 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/GoldService.java +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/GoldService.java @@ -706,7 +706,7 @@ public Future apply(noExceptionCall_args args) { private void setReqRepContext(Object req, com.twitter.util.Try rep) { scala.Option serdeCtx = com.twitter.finagle.context.Contexts.local().get(ServerToReqRep.Key()); if (serdeCtx.nonEmpty()) { - serdeCtx.get().setReqRep(new com.twitter.finagle.service.ReqRep(req, rep)); + serdeCtx.get().setReqRep(com.twitter.finagle.service.ReqRep.apply(req, rep)); } } diff --git a/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/PlatinumService.java b/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/PlatinumService.java index 32d733325..8cd534956 100644 --- a/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/PlatinumService.java +++ b/scrooge-generator-tests/src/test/resources/gold_file_output_java/com/twitter/scrooge/test/gold/thriftjava/PlatinumService.java @@ -471,7 +471,7 @@ public Future apply(moreCoolThings_args args) { private void setReqRepContext(Object req, com.twitter.util.Try rep) { scala.Option serdeCtx = com.twitter.finagle.context.Contexts.local().get(ServerToReqRep.Key()); if (serdeCtx.nonEmpty()) { - serdeCtx.get().setReqRep(new com.twitter.finagle.service.ReqRep(req, rep)); + serdeCtx.get().setReqRep(com.twitter.finagle.service.ReqRep.apply(req, rep)); } } diff --git a/scrooge-generator/src/main/resources/apachejavagen/service.mustache b/scrooge-generator/src/main/resources/apachejavagen/service.mustache index 36a2e03da..401b847e2 100644 --- a/scrooge-generator/src/main/resources/apachejavagen/service.mustache +++ b/scrooge-generator/src/main/resources/apachejavagen/service.mustache @@ -616,7 +616,7 @@ public class {{name}} { private void setReqRepContext(Object req, com.twitter.util.Try rep) { scala.Option serdeCtx = com.twitter.finagle.context.Contexts.local().get(ServerToReqRep.Key()); if (serdeCtx.nonEmpty()) { - serdeCtx.get().setReqRep(new com.twitter.finagle.service.ReqRep(req, rep)); + serdeCtx.get().setReqRep(com.twitter.finagle.service.ReqRep.apply(req, rep)); } }