[
https://issues.apache.org/jira/browse/THRIFT-2773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165026#comment-14165026
]
Hudson commented on THRIFT-2773:
--------------------------------
FAILURE: Integrated in Thrift-precommit #28 (See
[https://builds.apache.org/job/Thrift-precommit/28/])
THRIFT-2773: java - fixed oneway support while using TServiceClient (hcorg: rev
b73d220ab5830e1ad9517b235fe75c542ef92e88)
* lib/java/src/org/apache/thrift/TServiceClient.java
* compiler/cpp/src/generate/t_java_generator.cc
> Generated Java code for 'oneway' methods is incorrect.
> ------------------------------------------------------
>
> Key: THRIFT-2773
> URL: https://issues.apache.org/jira/browse/THRIFT-2773
> Project: Thrift
> Issue Type: Bug
> Components: Java - Compiler, Java - Library
> Affects Versions: 1.0
> Environment: Mac OS X
> Reporter: Adam Zegelin
>
> While the ticket THRIFT-2704 (and associated pull request
> https://github.com/apache/thrift/pull/216) adds support to Java for 'oneway'
> service calls, the changes only apply to the generated AsyncClient.
> The synchronous client code calls TServiceClient.sendBase() which always
> generates a TMessage of type T_CALL.
> {code:title=oneway-test.thrift}
> service TestService {
> oneway void testFunction();
> }
> {code}
> {code:title=TestService.java}
> public class TestService {
> ⋮
> public static class Client extends org.apache.thrift.TServiceClient
> implements Iface {
> ⋮
> public void send_testFunction() throws org.apache.thrift.TException
> {
> ⋮
> sendBase("testFunction", args); // note the lack of message type here
> }
> }
> ⋮
> public static class AsyncClient extends
> org.apache.thrift.async.TAsyncClient implements AsyncIface {
> ⋮
> public static class testFunction_call extends
> org.apache.thrift.async.TAsyncMethodCall {
> ⋮
> public void write_args(org.apache.thrift.protocol.TProtocol prot)
> throws org.apache.thrift.TException {
> prot.writeMessageBegin(new
> org.apache.thrift.protocol.TMessage("testFunction",
> org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); // ONEWAY is specified
> correctly
> testFunction_args args = new testFunction_args();
> args.write(prot);
> prot.writeMessageEnd();
> }
> ⋮
> }
> }
> ⋮
> }
> {code}
> {code:title=TServiceClient.java}
> public abstract class TServiceClient {
> ⋮
> protected void sendBase(String methodName, TBase args) throws TException {
> oprot_.writeMessageBegin(new TMessage(methodName, TMessageType.CALL,
> ++seqid_)); // note hardcoded CALL
> ⋮
> }
> ⋮
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)