You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "xia0c (Jira)" <ji...@apache.org> on 2019/12/05 20:10:00 UTC

[jira] [Created] (THRIFT-5045) Updating from 0.9.3 to 0.13.0 breaks

xia0c created THRIFT-5045:
-----------------------------

             Summary: Updating from 0.9.3 to 0.13.0 breaks
                 Key: THRIFT-5045
                 URL: https://issues.apache.org/jira/browse/THRIFT-5045
             Project: Thrift
          Issue Type: Bug
    Affects Versions: 0.13.0, 0.12.0, 0.11.0, 0.10.0
            Reporter: xia0c


When I try to upgrade Thrift from 0.9.3 to the version after 0.10.0. The upgrade breaks my existing code when I extend org.apache.thrift.async. e.g.

{code:java}
public class Testlibthrift extends org.apache.thrift.async.TAsyncMethodCall{
	
    protected Testlibthrift(TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport,
			AsyncMethodCallback callback, boolean isOneway) {
		super(client, protocolFactory, transport, callback, isOneway);
		// TODO Auto-generated constructor stub
	}

	public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0));

      }

      public void getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
      }

}
{code}

The code should pass. However, it throws an error:
{code:java}
Testlibthrift is not abstract and does not override abstract method getResult() in org.apache.thrift.async.TAsyncMethodCall
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)