diff --git a/components/camel-thrift/README.md b/components/camel-thrift/README.md index 94814a926c2ba..0dafd640598d2 100644 --- a/components/camel-thrift/README.md +++ b/components/camel-thrift/README.md @@ -15,6 +15,9 @@ If its succesful, you can type thrift --version +TIP: On mac you can install thrift via brew + + To display the version of the thrift compiler. You then need to compile the sample test source for the `camel-thrift` component. diff --git a/components/camel-thrift/pom.xml b/components/camel-thrift/pom.xml index 5febe642bbf6d..4fed97d93b39e 100644 --- a/components/camel-thrift/pom.xml +++ b/components/camel-thrift/pom.xml @@ -89,4 +89,29 @@ + + + + maven-antrun-plugin + + + process-sources + + + + + + + + + run + + + + + + + diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java index 79aec0fcfbc2b..a1fc9d7fc9938 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Calculator.java @@ -15,15 +15,15 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.camel.component.thrift.generated; +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) -@javax.annotation.processing.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-06-14") public class Calculator { /** @@ -37,24 +37,24 @@ public interface Iface { * that it may throw. Note that argument lists and exception lists are specified using the exact same syntax as * field lists in struct or exception definitions. */ - void ping() throws org.apache.thrift.TException; + public void ping() throws org.apache.thrift.TException; - int add(int num1, int num2) throws org.apache.thrift.TException; + public int add(int num1, int num2) throws org.apache.thrift.TException; - int calculate(int logid, Work w) throws InvalidOperation, org.apache.thrift.TException; + public int calculate(int logid, Work w) throws InvalidOperation, org.apache.thrift.TException; /** * This method has a oneway modifier. That means the client only makes a request and does not listen for any * response at all. Oneway methods must be void. */ - void zip() throws org.apache.thrift.TException; + public void zip() throws org.apache.thrift.TException; /** * This method echoed input object as return value. * * @param w */ - Work echo(Work w) throws org.apache.thrift.TException; + public Work echo(Work w) throws org.apache.thrift.TException; /** * This method contains all possible simple, special, struct and container types as input parameters @@ -72,7 +72,7 @@ public interface Iface { * @param v11 * @param v12 */ - int alltypes( + public int alltypes( boolean v1, byte v2, short v3, int v4, long v5, double v6, java.lang.String v7, java.nio.ByteBuffer v8, Work v9, java.util.List v10, java.util.Set v11, java.util.Map v12) @@ -82,19 +82,20 @@ int alltypes( public interface AsyncIface { - void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - void add(int num1, int num2, org.apache.thrift.async.AsyncMethodCallback resultHandler) + public void add(int num1, int num2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - void calculate(int logid, Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) + public void calculate(int logid, Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - void zip(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void zip(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - void echo(Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void echo(Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) + throws org.apache.thrift.TException; - void alltypes( + public void alltypes( boolean v1, byte v2, short v3, int v4, long v5, double v6, java.lang.String v7, java.nio.ByteBuffer v8, Work v9, java.util.List v10, java.util.Set v11, java.util.Map v12, @@ -108,10 +109,12 @@ public static class Factory implements org.apache.thrift.TServiceClientFactory v10, java.util.Set v11, @@ -271,6 +280,7 @@ public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, this.protocolFactory = protocolFactory; } + @Override public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } @@ -282,6 +292,7 @@ public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, super(protocolFactory, clientManager, transport); } + @Override public void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); ping_call method_call = new ping_call(resultHandler, this, ___protocolFactory, ___transport); @@ -293,10 +304,11 @@ public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } + @Override 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)); @@ -305,6 +317,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public Void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -312,10 +325,12 @@ public Void getResult() throws org.apache.thrift.TException { org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_ping(); return null; } } + @Override public void add(int num1, int num2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -331,12 +346,13 @@ public static class add_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.num1 = num1; this.num2 = num2; } + @Override public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin( new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.CALL, 0)); @@ -347,6 +363,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public java.lang.Integer getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -358,6 +375,7 @@ public java.lang.Integer getResult() throws org.apache.thrift.TException { } } + @Override public void calculate(int logid, Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -374,12 +392,13 @@ public calculate_call(int logid, Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.logid = logid; this.w = w; } + @Override public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin( new org.apache.thrift.protocol.TMessage("calculate", org.apache.thrift.protocol.TMessageType.CALL, 0)); @@ -390,6 +409,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public java.lang.Integer getResult() throws InvalidOperation, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -401,6 +421,7 @@ public java.lang.Integer getResult() throws InvalidOperation, org.apache.thrift. } } + @Override public void zip(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); zip_call method_call = new zip_call(resultHandler, this, ___protocolFactory, ___transport); @@ -412,10 +433,11 @@ public static class zip_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, true); } + @Override public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin( new org.apache.thrift.protocol.TMessage("zip", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); @@ -424,6 +446,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public Void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -435,6 +458,7 @@ public Void getResult() throws org.apache.thrift.TException { } } + @Override public void echo(Work w, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -449,11 +473,12 @@ public static class echo_call extends org.apache.thrift.async.TAsyncMethodCall resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.w = w; } + @Override public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin( new org.apache.thrift.protocol.TMessage("echo", org.apache.thrift.protocol.TMessageType.CALL, 0)); @@ -463,6 +488,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public Work getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -474,6 +500,7 @@ public Work getResult() throws org.apache.thrift.TException { } } + @Override public void alltypes( boolean v1, byte v2, short v3, int v4, long v5, double v6, java.lang.String v7, java.nio.ByteBuffer v8, Work v9, java.util.List v10, java.util.Set v11, @@ -507,7 +534,7 @@ public alltypes_call(boolean v1, byte v2, short v3, int v4, long v5, double v6, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, - org.apache.thrift.transport.TNonblockingTransport transport) { + org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.v1 = v1; this.v2 = v2; @@ -523,6 +550,7 @@ public alltypes_call(boolean v1, byte v2, short v3, int v4, long v5, double v6, this.v12 = v12; } + @Override public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin( new org.apache.thrift.protocol.TMessage("alltypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); @@ -543,6 +571,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa prot.writeMessageEnd(); } + @Override public java.lang.Integer getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); @@ -562,17 +591,17 @@ public static class Processor extends org.apache.thrift.TBasePr public Processor(I iface) { super(iface, getProcessMap( - new java.util.HashMap>())); + new java.util.HashMap>())); } protected Processor(I iface, - java.util.Map> processMap) { + java.util.Map> processMap) { super(iface, getProcessMap(processMap)); } private static < - I extends Iface> java.util.Map> getProcessMap( - java.util.Map> processMap) { + I extends Iface> java.util.Map> getProcessMap( + java.util.Map> processMap) { processMap.put("ping", new ping()); processMap.put("add", new add()); processMap.put("calculate", new calculate()); @@ -582,62 +611,102 @@ protected Processor(I iface, return processMap; } - public static class ping extends org.apache.thrift.ProcessFunction { + public static class ping extends org.apache.thrift.ProcessFunction { public ping() { super("ping"); } + @Override public ping_args getEmptyArgsInstance() { return new ping_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public ping_result getEmptyResultInstance() { + return new ping_result(); + } + + @Override public ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException { - ping_result result = new ping_result(); + ping_result result = getEmptyResultInstance(); iface.ping(); return result; } } - public static class add extends org.apache.thrift.ProcessFunction { + public static class add extends org.apache.thrift.ProcessFunction { public add() { super("add"); } + @Override public add_args getEmptyArgsInstance() { return new add_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public add_result getEmptyResultInstance() { + return new add_result(); + } + + @Override public add_result getResult(I iface, add_args args) throws org.apache.thrift.TException { - add_result result = new add_result(); + add_result result = getEmptyResultInstance(); result.success = iface.add(args.num1, args.num2); result.setSuccessIsSet(true); return result; } } - public static class calculate extends org.apache.thrift.ProcessFunction { + public static class calculate + extends org.apache.thrift.ProcessFunction { public calculate() { super("calculate"); } + @Override public calculate_args getEmptyArgsInstance() { return new calculate_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public calculate_result getEmptyResultInstance() { + return new calculate_result(); + } + + @Override public calculate_result getResult(I iface, calculate_args args) throws org.apache.thrift.TException { - calculate_result result = new calculate_result(); + calculate_result result = getEmptyResultInstance(); try { result.success = iface.calculate(args.logid, args.w); result.setSuccessIsSet(true); @@ -648,60 +717,101 @@ public calculate_result getResult(I iface, calculate_args args) throws org.apach } } - public static class zip extends org.apache.thrift.ProcessFunction { + public static class zip + extends org.apache.thrift.ProcessFunction { public zip() { super("zip"); } + @Override public zip_args getEmptyArgsInstance() { return new zip_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { return true; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public org.apache.thrift.TBase getEmptyResultInstance() { + return null; + } + + @Override public org.apache.thrift.TBase getResult(I iface, zip_args args) throws org.apache.thrift.TException { iface.zip(); return null; } } - public static class echo extends org.apache.thrift.ProcessFunction { + public static class echo extends org.apache.thrift.ProcessFunction { public echo() { super("echo"); } + @Override public echo_args getEmptyArgsInstance() { return new echo_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { return false; } + @Override + public echo_result getEmptyResultInstance() { + return new echo_result(); + } + + @Override public echo_result getResult(I iface, echo_args args) throws org.apache.thrift.TException { - echo_result result = new echo_result(); + echo_result result = getEmptyResultInstance(); result.success = iface.echo(args.w); return result; } } - public static class alltypes extends org.apache.thrift.ProcessFunction { + public static class alltypes + extends org.apache.thrift.ProcessFunction { public alltypes() { super("alltypes"); } + @Override public alltypes_args getEmptyArgsInstance() { return new alltypes_args(); } - protected boolean isOneway() { + @Override + public boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { return false; } + @Override + public alltypes_result getEmptyResultInstance() { + return new alltypes_result(); + } + + @Override public alltypes_result getResult(I iface, alltypes_args args) throws org.apache.thrift.TException { - alltypes_result result = new alltypes_result(); + alltypes_result result = getEmptyResultInstance(); result.success = iface.alltypes(args.v1, args.v2, args.v3, args.v4, args.v5, args.v6, args.v7, args.v8, args.v9, args.v10, args.v11, args.v12); result.setSuccessIsSet(true); @@ -716,17 +826,17 @@ public static class AsyncProcessor extends org.apache.thri public AsyncProcessor(I iface) { super(iface, getProcessMap( - new java.util.HashMap>())); + new java.util.HashMap>())); } protected AsyncProcessor(I iface, - java.util.Map> processMap) { + java.util.Map> processMap) { super(iface, getProcessMap(processMap)); } private static < - I extends AsyncIface> java.util.Map> getProcessMap( - java.util.Map> processMap) { + I extends AsyncIface> java.util.Map> getProcessMap( + java.util.Map> processMap) { processMap.put("ping", new ping()); processMap.put("add", new add()); processMap.put("calculate", new calculate()); @@ -736,19 +846,28 @@ protected AsyncProcessor(I iface, return processMap; } - public static class ping extends org.apache.thrift.AsyncProcessFunction { + public static class ping + extends org.apache.thrift.AsyncProcessFunction { public ping() { super("ping"); } + @Override + public ping_result getEmptyResultInstance() { + return new ping_result(); + } + + @Override public ping_args getEmptyArgsInstance() { return new ping_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(Void o) { ping_result result = new ping_result(); try { @@ -762,6 +881,7 @@ public void onComplete(Void o) { } } + @Override public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; @@ -790,10 +910,12 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override public void start(I iface, ping_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.ping(resultHandler); @@ -801,19 +923,27 @@ public void start(I iface, ping_args args, org.apache.thrift.async.AsyncMethodCa } public static class add - extends org.apache.thrift.AsyncProcessFunction { + extends org.apache.thrift.AsyncProcessFunction { public add() { super("add"); } + @Override + public add_result getEmptyResultInstance() { + return new add_result(); + } + + @Override public add_args getEmptyArgsInstance() { return new add_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(java.lang.Integer o) { add_result result = new add_result(); result.success = o; @@ -829,6 +959,7 @@ public void onComplete(java.lang.Integer o) { } } + @Override public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; @@ -857,10 +988,12 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override public void start( I iface, add_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { @@ -869,19 +1002,27 @@ public void start( } public static class calculate - extends org.apache.thrift.AsyncProcessFunction { + extends org.apache.thrift.AsyncProcessFunction { public calculate() { super("calculate"); } + @Override + public calculate_result getEmptyResultInstance() { + return new calculate_result(); + } + + @Override public calculate_args getEmptyArgsInstance() { return new calculate_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(java.lang.Integer o) { calculate_result result = new calculate_result(); result.success = o; @@ -897,6 +1038,7 @@ public void onComplete(java.lang.Integer o) { } } + @Override public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; @@ -929,10 +1071,12 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override public void start( I iface, calculate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { @@ -940,22 +1084,32 @@ public void start( } } - public static class zip extends org.apache.thrift.AsyncProcessFunction { + public static class zip + extends org.apache.thrift.AsyncProcessFunction { public zip() { super("zip"); } + @Override + public org.apache.thrift.TBase getEmptyResultInstance() { + return null; + } + + @Override public zip_args getEmptyArgsInstance() { return new zip_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(Void o) { } + @Override public void onError(java.lang.Exception e) { if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); @@ -967,29 +1121,40 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return true; } + @Override public void start(I iface, zip_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.zip(resultHandler); } } - public static class echo extends org.apache.thrift.AsyncProcessFunction { + public static class echo + extends org.apache.thrift.AsyncProcessFunction { public echo() { super("echo"); } + @Override + public echo_result getEmptyResultInstance() { + return new echo_result(); + } + + @Override public echo_args getEmptyArgsInstance() { return new echo_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(Work o) { echo_result result = new echo_result(); result.success = o; @@ -1004,6 +1169,7 @@ public void onComplete(Work o) { } } + @Override public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; @@ -1032,10 +1198,12 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override public void start(I iface, echo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.echo(args.w, resultHandler); @@ -1043,19 +1211,27 @@ public void start(I iface, echo_args args, org.apache.thrift.async.AsyncMethodCa } public static class alltypes - extends org.apache.thrift.AsyncProcessFunction { + extends org.apache.thrift.AsyncProcessFunction { public alltypes() { super("alltypes"); } + @Override + public alltypes_result getEmptyResultInstance() { + return new alltypes_result(); + } + + @Override public alltypes_args getEmptyArgsInstance() { return new alltypes_args(); } + @Override public org.apache.thrift.async.AsyncMethodCallback getResultHandler( final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new org.apache.thrift.async.AsyncMethodCallback() { + @Override public void onComplete(java.lang.Integer o) { alltypes_result result = new alltypes_result(); result.success = o; @@ -1071,6 +1247,7 @@ public void onComplete(java.lang.Integer o) { } } + @Override public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; @@ -1099,10 +1276,12 @@ public void onError(java.lang.Exception e) { }; } - protected boolean isOneway() { + @Override + public boolean isOneway() { return false; } + @Override public void start( I iface, alltypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { @@ -1113,6 +1292,7 @@ public void start( } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class ping_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -1127,7 +1307,8 @@ public static class ping_args public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -1138,6 +1319,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { default: @@ -1158,6 +1340,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -1170,10 +1353,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -1181,7 +1366,8 @@ public java.lang.String getFieldName() { public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap); } @@ -1195,6 +1381,7 @@ public ping_args() { public ping_args(ping_args other) { } + @Override public ping_args deepCopy() { return new ping_args(this); } @@ -1203,11 +1390,14 @@ public ping_args deepCopy() { public void clear() { } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { } @@ -1215,6 +1405,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -1227,8 +1418,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof ping_args) return this.equals((ping_args) that); return false; @@ -1261,14 +1450,18 @@ public int compareTo(ping_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -1282,7 +1475,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -1304,6 +1497,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class ping_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ping_argsStandardScheme getScheme() { return new ping_argsStandardScheme(); } @@ -1311,6 +1505,7 @@ public ping_argsStandardScheme getScheme() { private static class ping_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -1331,6 +1526,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) t struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -1343,6 +1539,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) } private static class ping_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ping_argsTupleScheme getScheme() { return new ping_argsTupleScheme(); } @@ -1351,12 +1548,12 @@ public ping_argsTupleScheme getScheme() { private static class ping_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -1367,6 +1564,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class ping_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -1381,7 +1579,8 @@ public static class ping_result public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -1392,6 +1591,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { default: @@ -1412,6 +1612,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -1424,10 +1625,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -1435,7 +1638,8 @@ public java.lang.String getFieldName() { public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap); } @@ -1449,6 +1653,7 @@ public ping_result() { public ping_result(ping_result other) { } + @Override public ping_result deepCopy() { return new ping_result(this); } @@ -1457,11 +1662,14 @@ public ping_result deepCopy() { public void clear() { } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { } @@ -1469,6 +1677,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -1481,8 +1690,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof ping_result) return this.equals((ping_result) that); return false; @@ -1515,10 +1722,13 @@ public int compareTo(ping_result other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } @@ -1536,7 +1746,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -1558,6 +1768,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class ping_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ping_resultStandardScheme getScheme() { return new ping_resultStandardScheme(); } @@ -1565,6 +1776,7 @@ public ping_resultStandardScheme getScheme() { private static class ping_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -1586,6 +1798,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct) throws org.apache.thrift.TException { struct.validate(); @@ -1598,6 +1811,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct } private static class ping_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ping_resultTupleScheme getScheme() { return new ping_resultTupleScheme(); } @@ -1606,12 +1820,14 @@ public ping_resultTupleScheme getScheme() { private static class ping_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) + throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) + throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -1622,6 +1838,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class add_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -1645,7 +1862,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { NUM1((short) 1, "num1"), NUM2((short) 2, "num2"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -1656,6 +1874,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // NUM1 @@ -1680,6 +1899,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -1692,10 +1912,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -1707,7 +1929,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NUM1, new org.apache.thrift.meta_data.FieldMetaData( "num1", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -1742,6 +1965,7 @@ public add_args(add_args other) { this.num2 = other.num2; } + @Override public add_args deepCopy() { return new add_args(this); } @@ -1800,7 +2024,8 @@ public void setNum2IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM2_ISSET_ID, value); } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM1: if (value == null) { @@ -1821,6 +2046,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM1: @@ -1834,6 +2061,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -1850,8 +2078,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof add_args) return this.equals((add_args) that); return false; @@ -1903,7 +2129,7 @@ public int compareTo(add_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetNum1()).compareTo(other.isSetNum1()); + lastComparison = java.lang.Boolean.compare(isSetNum1(), other.isSetNum1()); if (lastComparison != 0) { return lastComparison; } @@ -1913,7 +2139,7 @@ public int compareTo(add_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNum2()).compareTo(other.isSetNum2()); + lastComparison = java.lang.Boolean.compare(isSetNum2(), other.isSetNum2()); if (lastComparison != 0) { return lastComparison; } @@ -1926,14 +2152,18 @@ public int compareTo(add_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -1955,7 +2185,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -1979,6 +2209,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class add_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public add_argsStandardScheme getScheme() { return new add_argsStandardScheme(); } @@ -1986,6 +2217,7 @@ public add_argsStandardScheme getScheme() { private static class add_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, add_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -2022,6 +2254,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, add_args struct) th struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, add_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -2039,6 +2272,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, add_args struct) t } private static class add_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public add_argsTupleScheme getScheme() { return new add_argsTupleScheme(); } @@ -2086,6 +2320,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class add_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -2105,7 +2340,8 @@ public static class add_result public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short) 0, "success"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -2116,6 +2352,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 0: // SUCCESS @@ -2138,6 +2375,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -2150,10 +2388,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -2164,7 +2404,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData( "success", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -2191,6 +2432,7 @@ public add_result(add_result other) { this.success = other.success; } + @Override public add_result deepCopy() { return new add_result(this); } @@ -2224,7 +2466,8 @@ public void setSuccessIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -2237,6 +2480,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -2247,6 +2492,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -2261,8 +2507,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof add_result) return this.equals((add_result) that); return false; @@ -2303,7 +2547,7 @@ public int compareTo(add_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -2316,10 +2560,13 @@ public int compareTo(add_result other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } @@ -2340,7 +2587,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -2364,6 +2611,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class add_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public add_resultStandardScheme getScheme() { return new add_resultStandardScheme(); } @@ -2371,6 +2619,7 @@ public add_resultStandardScheme getScheme() { private static class add_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, add_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -2400,6 +2649,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, add_result struct) struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, add_result struct) throws org.apache.thrift.TException { struct.validate(); @@ -2417,6 +2667,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, add_result struct) } private static class add_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public add_resultTupleScheme getScheme() { return new add_resultTupleScheme(); } @@ -2455,6 +2706,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class calculate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -2472,14 +2724,15 @@ public static class calculate_args = new calculate_argsTupleSchemeFactory(); public int logid; // required - public Work w; // required + public @org.apache.thrift.annotation.Nullable Work w; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { LOGID((short) 1, "logid"), W((short) 2, "w"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -2490,6 +2743,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // LOGID @@ -2514,6 +2768,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -2526,10 +2781,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -2540,7 +2797,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.LOGID, new org.apache.thrift.meta_data.FieldMetaData( "logid", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -2575,6 +2833,7 @@ public calculate_args(calculate_args other) { } } + @Override public calculate_args deepCopy() { return new calculate_args(this); } @@ -2609,11 +2868,12 @@ public void setLogidIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LOGID_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public Work getW() { return this.w; } - public calculate_args setW(Work w) { + public calculate_args setW(@org.apache.thrift.annotation.Nullable Work w) { this.w = w; return this; } @@ -2633,7 +2893,8 @@ public void setWIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case LOGID: if (value == null) { @@ -2654,6 +2915,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case LOGID: @@ -2667,6 +2930,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -2683,8 +2947,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof calculate_args) return this.equals((calculate_args) that); return false; @@ -2738,7 +3000,7 @@ public int compareTo(calculate_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetLogid()).compareTo(other.isSetLogid()); + lastComparison = java.lang.Boolean.compare(isSetLogid(), other.isSetLogid()); if (lastComparison != 0) { return lastComparison; } @@ -2748,7 +3010,7 @@ public int compareTo(calculate_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetW()).compareTo(other.isSetW()); + lastComparison = java.lang.Boolean.compare(isSetW(), other.isSetW()); if (lastComparison != 0) { return lastComparison; } @@ -2761,14 +3023,18 @@ public int compareTo(calculate_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -2794,7 +3060,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (w != null) { @@ -2821,6 +3087,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class calculate_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public calculate_argsStandardScheme getScheme() { return new calculate_argsStandardScheme(); } @@ -2828,6 +3095,7 @@ public calculate_argsStandardScheme getScheme() { private static class calculate_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, calculate_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -2866,6 +3134,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, calculate_args stru struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, calculate_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -2886,6 +3155,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, calculate_args str } private static class calculate_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public calculate_argsTupleScheme getScheme() { return new calculate_argsTupleScheme(); } @@ -2936,6 +3206,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class calculate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -2953,14 +3224,15 @@ public static class calculate_result = new calculate_resultTupleSchemeFactory(); public int success; // required - public InvalidOperation ouch; // required + public @org.apache.thrift.annotation.Nullable InvalidOperation ouch; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short) 0, "success"), OUCH((short) 1, "ouch"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -2971,6 +3243,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 0: // SUCCESS @@ -2995,6 +3268,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -3007,10 +3281,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -3021,7 +3297,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData( "success", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -3058,6 +3335,7 @@ public calculate_result(calculate_result other) { } } + @Override public calculate_result deepCopy() { return new calculate_result(this); } @@ -3092,11 +3370,12 @@ public void setSuccessIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public InvalidOperation getOuch() { return this.ouch; } - public calculate_result setOuch(InvalidOperation ouch) { + public calculate_result setOuch(@org.apache.thrift.annotation.Nullable InvalidOperation ouch) { this.ouch = ouch; return this; } @@ -3116,7 +3395,8 @@ public void setOuchIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -3137,6 +3417,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -3150,6 +3432,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -3166,8 +3449,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof calculate_result) return this.equals((calculate_result) that); return false; @@ -3221,7 +3502,7 @@ public int compareTo(calculate_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -3231,7 +3512,7 @@ public int compareTo(calculate_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOuch()).compareTo(other.isSetOuch()); + lastComparison = java.lang.Boolean.compare(isSetOuch(), other.isSetOuch()); if (lastComparison != 0) { return lastComparison; } @@ -3244,10 +3525,13 @@ public int compareTo(calculate_result other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } @@ -3277,7 +3561,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -3301,6 +3585,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class calculate_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public calculate_resultStandardScheme getScheme() { return new calculate_resultStandardScheme(); } @@ -3308,6 +3593,7 @@ public calculate_resultStandardScheme getScheme() { private static class calculate_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, calculate_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -3346,6 +3632,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, calculate_result st struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, calculate_result struct) throws org.apache.thrift.TException { struct.validate(); @@ -3368,6 +3655,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, calculate_result s } private static class calculate_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public calculate_resultTupleScheme getScheme() { return new calculate_resultTupleScheme(); } @@ -3418,6 +3706,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class zip_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -3432,7 +3721,8 @@ public static class zip_args public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -3443,6 +3733,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { default: @@ -3463,6 +3754,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -3475,10 +3767,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -3486,7 +3780,8 @@ public java.lang.String getFieldName() { public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(zip_args.class, metaDataMap); } @@ -3500,6 +3795,7 @@ public zip_args() { public zip_args(zip_args other) { } + @Override public zip_args deepCopy() { return new zip_args(this); } @@ -3508,11 +3804,14 @@ public zip_args deepCopy() { public void clear() { } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { } @@ -3520,6 +3819,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -3532,8 +3832,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof zip_args) return this.equals((zip_args) that); return false; @@ -3566,14 +3864,18 @@ public int compareTo(zip_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -3587,7 +3889,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -3609,6 +3911,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class zip_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public zip_argsStandardScheme getScheme() { return new zip_argsStandardScheme(); } @@ -3616,6 +3919,7 @@ public zip_argsStandardScheme getScheme() { private static class zip_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, zip_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -3636,6 +3940,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, zip_args struct) th struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, zip_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -3647,6 +3952,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, zip_args struct) t } private static class zip_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public zip_argsTupleScheme getScheme() { return new zip_argsTupleScheme(); } @@ -3655,12 +3961,12 @@ public zip_argsTupleScheme getScheme() { private static class zip_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, zip_args struct) { + public void write(org.apache.thrift.protocol.TProtocol prot, zip_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, zip_args struct) { + public void read(org.apache.thrift.protocol.TProtocol prot, zip_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } @@ -3671,6 +3977,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class echo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -3684,13 +3991,14 @@ public static class echo_args = new echo_argsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echo_argsTupleSchemeFactory(); - public Work w; // required + public @org.apache.thrift.annotation.Nullable Work w; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { W((short) 1, "w"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -3701,6 +4009,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // W @@ -3723,6 +4032,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -3735,10 +4045,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -3747,7 +4059,8 @@ public java.lang.String getFieldName() { // isset id assignments public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.W, new org.apache.thrift.meta_data.FieldMetaData( "w", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Work.class))); @@ -3773,6 +4086,7 @@ public echo_args(echo_args other) { } } + @Override public echo_args deepCopy() { return new echo_args(this); } @@ -3782,11 +4096,12 @@ public void clear() { this.w = null; } + @org.apache.thrift.annotation.Nullable public Work getW() { return this.w; } - public echo_args setW(Work w) { + public echo_args setW(@org.apache.thrift.annotation.Nullable Work w) { this.w = w; return this; } @@ -3806,7 +4121,8 @@ public void setWIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case W: if (value == null) { @@ -3819,6 +4135,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case W: @@ -3829,6 +4147,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -3843,8 +4162,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof echo_args) return this.equals((echo_args) that); return false; @@ -3887,7 +4204,7 @@ public int compareTo(echo_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetW()).compareTo(other.isSetW()); + lastComparison = java.lang.Boolean.compare(isSetW(), other.isSetW()); if (lastComparison != 0) { return lastComparison; } @@ -3900,14 +4217,18 @@ public int compareTo(echo_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -3928,7 +4249,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (w != null) { @@ -3953,6 +4274,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class echo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public echo_argsStandardScheme getScheme() { return new echo_argsStandardScheme(); } @@ -3960,6 +4282,7 @@ public echo_argsStandardScheme getScheme() { private static class echo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, echo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -3989,6 +4312,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, echo_args struct) t struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, echo_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -4006,6 +4330,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, echo_args struct) } private static class echo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public echo_argsTupleScheme getScheme() { return new echo_argsTupleScheme(); } @@ -4044,6 +4369,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class echo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4057,13 +4383,14 @@ public static class echo_result = new echo_resultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echo_resultTupleSchemeFactory(); - public Work success; // required + public @org.apache.thrift.annotation.Nullable Work success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short) 0, "success"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -4074,6 +4401,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 0: // SUCCESS @@ -4096,6 +4424,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -4108,10 +4437,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -4120,7 +4451,8 @@ public java.lang.String getFieldName() { // isset id assignments public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData( "success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Work.class))); @@ -4146,6 +4478,7 @@ public echo_result(echo_result other) { } } + @Override public echo_result deepCopy() { return new echo_result(this); } @@ -4155,11 +4488,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public Work getSuccess() { return this.success; } - public echo_result setSuccess(Work success) { + public echo_result setSuccess(@org.apache.thrift.annotation.Nullable Work success) { this.success = success; return this; } @@ -4179,7 +4513,8 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -4192,6 +4527,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -4202,6 +4539,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -4216,8 +4554,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof echo_result) return this.equals((echo_result) that); return false; @@ -4260,7 +4596,7 @@ public int compareTo(echo_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -4273,10 +4609,13 @@ public int compareTo(echo_result other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } @@ -4301,7 +4640,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { @@ -4326,6 +4665,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class echo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public echo_resultStandardScheme getScheme() { return new echo_resultStandardScheme(); } @@ -4333,6 +4673,7 @@ public echo_resultStandardScheme getScheme() { private static class echo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, echo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4363,6 +4704,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, echo_result struct) struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, echo_result struct) throws org.apache.thrift.TException { struct.validate(); @@ -4380,6 +4722,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, echo_result struct } private static class echo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public echo_resultTupleScheme getScheme() { return new echo_resultTupleScheme(); } @@ -4420,6 +4763,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class alltypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4462,12 +4806,12 @@ public static class alltypes_args public int v4; // required public long v5; // required public double v6; // required - public java.lang.String v7; // required - public java.nio.ByteBuffer v8; // required - public Work v9; // required - public java.util.List v10; // required - public java.util.Set v11; // required - public java.util.Map v12; // required + public @org.apache.thrift.annotation.Nullable java.lang.String v7; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer v8; // required + public @org.apache.thrift.annotation.Nullable Work v9; // required + public @org.apache.thrift.annotation.Nullable java.util.List v10; // required + public @org.apache.thrift.annotation.Nullable java.util.Set v11; // required + public @org.apache.thrift.annotation.Nullable java.util.Map v12; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -4484,7 +4828,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { V11((short) 11, "v11"), V12((short) 12, "v12"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -4495,6 +4840,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // V1 @@ -4539,6 +4885,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -4551,10 +4898,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -4570,7 +4919,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.V1, new org.apache.thrift.meta_data.FieldMetaData( "v1", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -4686,19 +5036,21 @@ public alltypes_args(alltypes_args other) { this.v9 = new Work(other.v9); } if (other.isSetV10()) { - java.util.List __this__v10 = new java.util.ArrayList<>(other.v10); + java.util.List __this__v10 = new java.util.ArrayList(other.v10); this.v10 = __this__v10; } if (other.isSetV11()) { - java.util.Set __this__v11 = new java.util.HashSet<>(other.v11); + java.util.Set __this__v11 = new java.util.HashSet(other.v11); this.v11 = __this__v11; } if (other.isSetV12()) { - java.util.Map __this__v12 = new java.util.HashMap<>(other.v12); + java.util.Map __this__v12 + = new java.util.HashMap(other.v12); this.v12 = __this__v12; } } + @Override public alltypes_args deepCopy() { return new alltypes_args(this); } @@ -4863,11 +5215,12 @@ public void setV6IsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __V6_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public java.lang.String getV7() { return this.v7; } - public alltypes_args setV7(java.lang.String v7) { + public alltypes_args setV7(@org.apache.thrift.annotation.Nullable java.lang.String v7) { this.v7 = v7; return this; } @@ -4901,7 +5254,7 @@ public alltypes_args setV8(byte[] v8) { return this; } - public alltypes_args setV8(java.nio.ByteBuffer v8) { + public alltypes_args setV8(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer v8) { this.v8 = org.apache.thrift.TBaseHelper.copyBinary(v8); return this; } @@ -4921,11 +5274,12 @@ public void setV8IsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public Work getV9() { return this.v9; } - public alltypes_args setV9(Work v9) { + public alltypes_args setV9(@org.apache.thrift.annotation.Nullable Work v9) { this.v9 = v9; return this; } @@ -4949,22 +5303,24 @@ public int getV10Size() { return (this.v10 == null) ? 0 : this.v10.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getV10Iterator() { return (this.v10 == null) ? null : this.v10.iterator(); } public void addToV10(int elem) { if (this.v10 == null) { - this.v10 = new java.util.ArrayList<>(); + this.v10 = new java.util.ArrayList(); } this.v10.add(elem); } + @org.apache.thrift.annotation.Nullable public java.util.List getV10() { return this.v10; } - public alltypes_args setV10(java.util.List v10) { + public alltypes_args setV10(@org.apache.thrift.annotation.Nullable java.util.List v10) { this.v10 = v10; return this; } @@ -4988,22 +5344,24 @@ public int getV11Size() { return (this.v11 == null) ? 0 : this.v11.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getV11Iterator() { return (this.v11 == null) ? null : this.v11.iterator(); } public void addToV11(java.lang.String elem) { if (this.v11 == null) { - this.v11 = new java.util.HashSet<>(); + this.v11 = new java.util.HashSet(); } this.v11.add(elem); } + @org.apache.thrift.annotation.Nullable public java.util.Set getV11() { return this.v11; } - public alltypes_args setV11(java.util.Set v11) { + public alltypes_args setV11(@org.apache.thrift.annotation.Nullable java.util.Set v11) { this.v11 = v11; return this; } @@ -5029,16 +5387,18 @@ public int getV12Size() { public void putToV12(java.lang.String key, long val) { if (this.v12 == null) { - this.v12 = new java.util.HashMap<>(); + this.v12 = new java.util.HashMap(); } this.v12.put(key, val); } + @org.apache.thrift.annotation.Nullable public java.util.Map getV12() { return this.v12; } - public alltypes_args setV12(java.util.Map v12) { + public alltypes_args setV12( + @org.apache.thrift.annotation.Nullable java.util.Map v12) { this.v12 = v12; return this; } @@ -5058,7 +5418,8 @@ public void setV12IsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case V1: if (value == null) { @@ -5163,6 +5524,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case V1: @@ -5206,6 +5569,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -5242,8 +5606,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof alltypes_args) return this.equals((alltypes_args) that); return false; @@ -5372,7 +5734,7 @@ public int hashCode() { hashCode = hashCode * 8191 + ((v1) ? 131071 : 524287); - hashCode = hashCode * 8191 + (v2); + hashCode = hashCode * 8191 + (int) (v2); hashCode = hashCode * 8191 + v3; @@ -5417,7 +5779,7 @@ public int compareTo(alltypes_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetV1()).compareTo(other.isSetV1()); + lastComparison = java.lang.Boolean.compare(isSetV1(), other.isSetV1()); if (lastComparison != 0) { return lastComparison; } @@ -5427,7 +5789,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV2()).compareTo(other.isSetV2()); + lastComparison = java.lang.Boolean.compare(isSetV2(), other.isSetV2()); if (lastComparison != 0) { return lastComparison; } @@ -5437,7 +5799,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV3()).compareTo(other.isSetV3()); + lastComparison = java.lang.Boolean.compare(isSetV3(), other.isSetV3()); if (lastComparison != 0) { return lastComparison; } @@ -5447,7 +5809,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV4()).compareTo(other.isSetV4()); + lastComparison = java.lang.Boolean.compare(isSetV4(), other.isSetV4()); if (lastComparison != 0) { return lastComparison; } @@ -5457,7 +5819,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV5()).compareTo(other.isSetV5()); + lastComparison = java.lang.Boolean.compare(isSetV5(), other.isSetV5()); if (lastComparison != 0) { return lastComparison; } @@ -5467,7 +5829,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV6()).compareTo(other.isSetV6()); + lastComparison = java.lang.Boolean.compare(isSetV6(), other.isSetV6()); if (lastComparison != 0) { return lastComparison; } @@ -5477,7 +5839,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV7()).compareTo(other.isSetV7()); + lastComparison = java.lang.Boolean.compare(isSetV7(), other.isSetV7()); if (lastComparison != 0) { return lastComparison; } @@ -5487,7 +5849,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV8()).compareTo(other.isSetV8()); + lastComparison = java.lang.Boolean.compare(isSetV8(), other.isSetV8()); if (lastComparison != 0) { return lastComparison; } @@ -5497,7 +5859,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV9()).compareTo(other.isSetV9()); + lastComparison = java.lang.Boolean.compare(isSetV9(), other.isSetV9()); if (lastComparison != 0) { return lastComparison; } @@ -5507,7 +5869,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV10()).compareTo(other.isSetV10()); + lastComparison = java.lang.Boolean.compare(isSetV10(), other.isSetV10()); if (lastComparison != 0) { return lastComparison; } @@ -5517,7 +5879,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV11()).compareTo(other.isSetV11()); + lastComparison = java.lang.Boolean.compare(isSetV11(), other.isSetV11()); if (lastComparison != 0) { return lastComparison; } @@ -5527,7 +5889,7 @@ public int compareTo(alltypes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetV12()).compareTo(other.isSetV12()); + lastComparison = java.lang.Boolean.compare(isSetV12(), other.isSetV12()); if (lastComparison != 0) { return lastComparison; } @@ -5540,14 +5902,18 @@ public int compareTo(alltypes_args other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -5643,7 +6009,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (v9 != null) { @@ -5670,6 +6036,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class alltypes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public alltypes_argsStandardScheme getScheme() { return new alltypes_argsStandardScheme(); } @@ -5677,6 +6044,7 @@ public alltypes_argsStandardScheme getScheme() { private static class alltypes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -5764,7 +6132,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_args struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.v10 = new java.util.ArrayList<>(_list0.size); + struct.v10 = new java.util.ArrayList(_list0.size); int _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = iprot.readI32(); @@ -5781,7 +6149,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_args struc if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set3 = iprot.readSetBegin(); - struct.v11 = new java.util.HashSet<>(2 * _set3.size); + struct.v11 = new java.util.HashSet(2 * _set3.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem4; for (int _i5 = 0; _i5 < _set3.size; ++_i5) { _elem4 = iprot.readString(); @@ -5798,7 +6167,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_args struc if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map6 = iprot.readMapBegin(); - struct.v12 = new java.util.HashMap<>(2 * _map6.size); + struct.v12 = new java.util.HashMap(2 * _map6.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7; long _val8; for (int _i9 = 0; _i9 < _map6.size; ++_i9) { @@ -5824,6 +6194,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_args struc struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, alltypes_args struct) throws org.apache.thrift.TException { struct.validate(); @@ -5907,6 +6278,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alltypes_args stru } private static class alltypes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public alltypes_argsTupleScheme getScheme() { return new alltypes_argsTupleScheme(); } @@ -6054,9 +6426,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alltypes_args struct } if (incoming.get(9)) { { - org.apache.thrift.protocol.TList _list16 - = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.v10 = new java.util.ArrayList<>(_list16.size); + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); + struct.v10 = new java.util.ArrayList(_list16.size); int _elem17; for (int _i18 = 0; _i18 < _list16.size; ++_i18) { _elem17 = iprot.readI32(); @@ -6067,9 +6438,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alltypes_args struct } if (incoming.get(10)) { { - org.apache.thrift.protocol.TSet _set19 - = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.v11 = new java.util.HashSet<>(2 * _set19.size); + org.apache.thrift.protocol.TSet _set19 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING); + struct.v11 = new java.util.HashSet(2 * _set19.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem20; for (int _i21 = 0; _i21 < _set19.size; ++_i21) { _elem20 = iprot.readString(); @@ -6080,9 +6451,10 @@ public void read(org.apache.thrift.protocol.TProtocol prot, alltypes_args struct } if (incoming.get(11)) { { - org.apache.thrift.protocol.TMap _map22 = new org.apache.thrift.protocol.TMap( - org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.v12 = new java.util.HashMap<>(2 * _map22.size); + org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, + org.apache.thrift.protocol.TType.I64); + struct.v12 = new java.util.HashMap(2 * _map22.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key23; long _val24; for (int _i25 = 0; _i25 < _map22.size; ++_i25) { @@ -6102,6 +6474,7 @@ private static S scheme(org.apache. } } + @SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) public static class alltypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -6122,7 +6495,8 @@ public static class alltypes_result public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short) 0, "success"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -6133,6 +6507,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 0: // SUCCESS @@ -6155,6 +6530,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -6167,10 +6543,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -6181,7 +6559,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData( "success", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -6208,6 +6587,7 @@ public alltypes_result(alltypes_result other) { this.success = other.success; } + @Override public alltypes_result deepCopy() { return new alltypes_result(this); } @@ -6241,7 +6621,8 @@ public void setSuccessIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -6254,6 +6635,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: @@ -6264,6 +6647,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -6278,8 +6662,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof alltypes_result) return this.equals((alltypes_result) that); return false; @@ -6320,7 +6702,7 @@ public int compareTo(alltypes_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -6333,10 +6715,13 @@ public int compareTo(alltypes_result other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } @@ -6357,7 +6742,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -6381,6 +6766,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class alltypes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public alltypes_resultStandardScheme getScheme() { return new alltypes_resultStandardScheme(); } @@ -6388,6 +6774,7 @@ public alltypes_resultStandardScheme getScheme() { private static class alltypes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6417,6 +6804,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, alltypes_result str struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, alltypes_result struct) throws org.apache.thrift.TException { struct.validate(); @@ -6434,6 +6822,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, alltypes_result st } private static class alltypes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public alltypes_resultTupleScheme getScheme() { return new alltypes_resultTupleScheme(); } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java index d674a02d43880..a06b9530969fc 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/InvalidOperation.java @@ -15,18 +15,18 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.camel.component.thrift.generated; -@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) /** * Structs can also be exceptions, if they are nasty. */ -@javax.annotation.processing.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-06-14") +@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") public class InvalidOperation extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -43,14 +43,15 @@ public class InvalidOperation extends org.apache.thrift.TException private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new InvalidOperationTupleSchemeFactory(); public int whatOp; // required - public java.lang.String why; // required + public @org.apache.thrift.annotation.Nullable java.lang.String why; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { WHAT_OP((short) 1, "whatOp"), WHY((short) 2, "why"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -61,6 +62,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // WHAT_OP @@ -85,6 +87,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -97,10 +100,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -111,7 +116,8 @@ public java.lang.String getFieldName() { private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.WHAT_OP, new org.apache.thrift.meta_data.FieldMetaData( "whatOp", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -147,6 +153,7 @@ public InvalidOperation(InvalidOperation other) { } } + @Override public InvalidOperation deepCopy() { return new InvalidOperation(this); } @@ -181,11 +188,12 @@ public void setWhatOpIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WHATOP_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public java.lang.String getWhy() { return this.why; } - public InvalidOperation setWhy(java.lang.String why) { + public InvalidOperation setWhy(@org.apache.thrift.annotation.Nullable java.lang.String why) { this.why = why; return this; } @@ -205,7 +213,8 @@ public void setWhyIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case WHAT_OP: if (value == null) { @@ -226,6 +235,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case WHAT_OP: @@ -239,6 +250,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -255,8 +267,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof InvalidOperation) return this.equals((InvalidOperation) that); return false; @@ -310,7 +320,7 @@ public int compareTo(InvalidOperation other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetWhatOp()).compareTo(other.isSetWhatOp()); + lastComparison = java.lang.Boolean.compare(isSetWhatOp(), other.isSetWhatOp()); if (lastComparison != 0) { return lastComparison; } @@ -320,7 +330,7 @@ public int compareTo(InvalidOperation other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetWhy()).compareTo(other.isSetWhy()); + lastComparison = java.lang.Boolean.compare(isSetWhy(), other.isSetWhy()); if (lastComparison != 0) { return lastComparison; } @@ -333,14 +343,18 @@ public int compareTo(InvalidOperation other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -366,7 +380,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -390,6 +404,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class InvalidOperationStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public InvalidOperationStandardScheme getScheme() { return new InvalidOperationStandardScheme(); } @@ -397,6 +412,7 @@ public InvalidOperationStandardScheme getScheme() { private static class InvalidOperationStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -434,6 +450,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidOperation st struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidOperation struct) throws org.apache.thrift.TException { struct.validate(); @@ -454,6 +471,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidOperation s } private static class InvalidOperationTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public InvalidOperationTupleScheme getScheme() { return new InvalidOperationTupleScheme(); } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Operation.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Operation.java index 006df6a56dbc3..7c722d49b0a0c 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Operation.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Operation.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -26,6 +26,7 @@ * You can define enums, which are just 32 bit integers. Values are optional and start at 1 if not supplied, C style * again. */ +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") public enum Operation implements org.apache.thrift.TEnum { ADD(1), SUBTRACT(2), @@ -51,6 +52,7 @@ public int getValue() { * * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static Operation findByValue(int value) { switch (value) { case 1: diff --git a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java index 22355e9d752fd..453aa979d36d2 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/component/thrift/generated/Work.java @@ -15,14 +15,13 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.camel.component.thrift.generated; -@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) /** * Structs are the basic complex data structures. They are comprised of fields which each have an integer identifier, a * type, a symbolic name, and an optional default value. @@ -30,7 +29,8 @@ * Fields can be declared "optional", which ensures they will not be included in the serialized output if they aren't * set. Note that this requires some manual management in some languages. */ -@javax.annotation.processing.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-06-14") +@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") public class Work implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Work"); @@ -52,8 +52,8 @@ public class Work implements org.apache.thrift.TBase, java.i * * @see Operation */ - public Operation op; // required - public java.lang.String comment; // optional + public @org.apache.thrift.annotation.Nullable Operation op; // required + public @org.apache.thrift.annotation.Nullable java.lang.String comment; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -66,7 +66,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OP((short) 3, "op"), COMMENT((short) 4, "comment"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -77,6 +78,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // NUM1 @@ -105,6 +107,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -117,10 +120,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -133,7 +138,8 @@ public java.lang.String getFieldName() { private static final _Fields optionals[] = { _Fields.COMMENT }; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NUM1, new org.apache.thrift.meta_data.FieldMetaData( "num1", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -186,6 +192,7 @@ public Work(Work other) { } } + @Override public Work deepCopy() { return new Work(this); } @@ -250,6 +257,7 @@ public void setNum2IsSet(boolean value) { * * @see Operation */ + @org.apache.thrift.annotation.Nullable public Operation getOp() { return this.op; } @@ -258,7 +266,7 @@ public Operation getOp() { * * @see Operation */ - public Work setOp(Operation op) { + public Work setOp(@org.apache.thrift.annotation.Nullable Operation op) { this.op = op; return this; } @@ -278,11 +286,12 @@ public void setOpIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public java.lang.String getComment() { return this.comment; } - public Work setComment(java.lang.String comment) { + public Work setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { this.comment = comment; return this; } @@ -302,7 +311,8 @@ public void setCommentIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM1: if (value == null) { @@ -339,6 +349,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM1: @@ -358,6 +370,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -378,8 +391,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof Work) return this.equals((Work) that); return false; @@ -457,7 +468,7 @@ public int compareTo(Work other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetNum1()).compareTo(other.isSetNum1()); + lastComparison = java.lang.Boolean.compare(isSetNum1(), other.isSetNum1()); if (lastComparison != 0) { return lastComparison; } @@ -467,7 +478,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNum2()).compareTo(other.isSetNum2()); + lastComparison = java.lang.Boolean.compare(isSetNum2(), other.isSetNum2()); if (lastComparison != 0) { return lastComparison; } @@ -477,7 +488,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOp()).compareTo(other.isSetOp()); + lastComparison = java.lang.Boolean.compare(isSetOp(), other.isSetOp()); if (lastComparison != 0) { return lastComparison; } @@ -487,7 +498,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + lastComparison = java.lang.Boolean.compare(isSetComment(), other.isSetComment()); if (lastComparison != 0) { return lastComparison; } @@ -500,14 +511,18 @@ public int compareTo(Work other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -549,7 +564,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -573,6 +588,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class WorkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public WorkStandardScheme getScheme() { return new WorkStandardScheme(); } @@ -580,6 +596,7 @@ public WorkStandardScheme getScheme() { private static class WorkStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, Work struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -632,6 +649,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Work struct) throws struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, Work struct) throws org.apache.thrift.TException { struct.validate(); @@ -661,6 +679,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, Work struct) throw } private static class WorkTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public WorkTupleScheme getScheme() { return new WorkTupleScheme(); } diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Operation.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Operation.java index 3f24cb5f5275a..aade8b33bd8b3 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Operation.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Operation.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -26,6 +26,7 @@ * You can define enums, which are just 32 bit integers. Values are optional and start at 1 if not supplied, C style * again. */ +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") public enum Operation implements org.apache.thrift.TEnum { ADD(1), SUBTRACT(2), @@ -51,6 +52,7 @@ public int getValue() { * * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static Operation findByValue(int value) { switch (value) { case 1: diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java index 4cf64cafb3427..68efccc176eca 100644 --- a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java @@ -15,14 +15,13 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.10.0) + * Autogenerated by Thrift Compiler (0.21.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.camel.dataformat.thrift.generated; -@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) /** * Structs are the basic complex data structures. They are comprised of fields which each have an integer identifier, a * type, a symbolic name, and an optional default value. @@ -30,7 +29,8 @@ * Fields can be declared "optional", which ensures they will not be included in the serialized output if they aren't * set. Note that this requires some manual management in some languages. */ -@javax.annotation.processing.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-06-14") +@SuppressWarnings({ "cast", "rawtypes", "serial", "unchecked", "unused" }) +@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.21.0)", date = "2024-09-30") public class Work implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Work"); @@ -52,8 +52,8 @@ public class Work implements org.apache.thrift.TBase, java.i * * @see Operation */ - public Operation op; // required - public java.lang.String comment; // optional + public @org.apache.thrift.annotation.Nullable Operation op; // required + public @org.apache.thrift.annotation.Nullable java.lang.String comment; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -66,7 +66,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OP((short) 3, "op"), COMMENT((short) 4, "comment"); - private static final java.util.Map byName = new java.util.HashMap<>(); + private static final java.util.Map byName + = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { @@ -77,6 +78,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch (fieldId) { case 1: // NUM1 @@ -105,6 +107,7 @@ public static _Fields findByThriftIdOrThrow(int fieldId) { /** * Find the _Fields constant that matches name, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } @@ -117,10 +120,12 @@ public static _Fields findByName(java.lang.String name) { _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -133,7 +138,8 @@ public java.lang.String getFieldName() { private static final _Fields optionals[] = { _Fields.COMMENT }; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap + = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NUM1, new org.apache.thrift.meta_data.FieldMetaData( "num1", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -186,6 +192,7 @@ public Work(Work other) { } } + @Override public Work deepCopy() { return new Work(this); } @@ -250,6 +257,7 @@ public void setNum2IsSet(boolean value) { * * @see Operation */ + @org.apache.thrift.annotation.Nullable public Operation getOp() { return this.op; } @@ -258,7 +266,7 @@ public Operation getOp() { * * @see Operation */ - public Work setOp(Operation op) { + public Work setOp(@org.apache.thrift.annotation.Nullable Operation op) { this.op = op; return this; } @@ -278,11 +286,12 @@ public void setOpIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public java.lang.String getComment() { return this.comment; } - public Work setComment(java.lang.String comment) { + public Work setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { this.comment = comment; return this; } @@ -302,7 +311,8 @@ public void setCommentIsSet(boolean value) { } } - public void setFieldValue(_Fields field, java.lang.Object value) { + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NUM1: if (value == null) { @@ -339,6 +349,8 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } } + @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NUM1: @@ -358,6 +370,7 @@ public java.lang.Object getFieldValue(_Fields field) { } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -378,8 +391,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof Work) return this.equals((Work) that); return false; @@ -457,7 +468,7 @@ public int compareTo(Work other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetNum1()).compareTo(other.isSetNum1()); + lastComparison = java.lang.Boolean.compare(isSetNum1(), other.isSetNum1()); if (lastComparison != 0) { return lastComparison; } @@ -467,7 +478,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNum2()).compareTo(other.isSetNum2()); + lastComparison = java.lang.Boolean.compare(isSetNum2(), other.isSetNum2()); if (lastComparison != 0) { return lastComparison; } @@ -477,7 +488,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOp()).compareTo(other.isSetOp()); + lastComparison = java.lang.Boolean.compare(isSetOp(), other.isSetOp()); if (lastComparison != 0) { return lastComparison; } @@ -487,7 +498,7 @@ public int compareTo(Work other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + lastComparison = java.lang.Boolean.compare(isSetComment(), other.isSetComment()); if (lastComparison != 0) { return lastComparison; } @@ -500,14 +511,18 @@ public int compareTo(Work other) { return 0; } + @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -549,7 +564,7 @@ public java.lang.String toString() { return sb.toString(); } - public void validate() { + public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } @@ -573,6 +588,7 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } private static class WorkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public WorkStandardScheme getScheme() { return new WorkStandardScheme(); } @@ -580,6 +596,7 @@ public WorkStandardScheme getScheme() { private static class WorkStandardScheme extends org.apache.thrift.scheme.StandardScheme { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, Work struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -632,6 +649,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Work struct) throws struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, Work struct) throws org.apache.thrift.TException { struct.validate(); @@ -661,6 +679,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, Work struct) throw } private static class WorkTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public WorkTupleScheme getScheme() { return new WorkTupleScheme(); } diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java index ccd461f021078..a0605a9ff8b0e 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java @@ -487,7 +487,9 @@ private int run() throws Exception { final KameletMain main = createMainInstance(); main.setProfile(profile); - main.setRepositories(String.join(",", repositories)); + if (repositories != null && !repositories.isBlank()) { + main.setRepositories(String.join(",", repositories)); + } main.setDownload(download); main.setFresh(fresh); main.setMavenSettings(mavenSettings); @@ -547,7 +549,7 @@ private int run() throws Exception { writeSetting(main, profileProperties, "camel.jbang.gav", gav); } writeSetting(main, profileProperties, "camel.jbang.open-api", openapi); - writeSetting(main, profileProperties, "camel.jbang.repositories", String.join(",", repositories)); + writeSetting(main, profileProperties, "camel.jbang.repos", String.join(",", repositories)); writeSetting(main, profileProperties, "camel.jbang.health", health ? "true" : "false"); writeSetting(main, profileProperties, "camel.jbang.metrics", metrics ? "true" : "false"); writeSetting(main, profileProperties, "camel.jbang.console", console ? "true" : "false"); diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MavenDependencyDownloader.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MavenDependencyDownloader.java index 8b6105e3d5296..07c63a97214f2 100644 --- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MavenDependencyDownloader.java +++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MavenDependencyDownloader.java @@ -77,7 +77,7 @@ public class MavenDependencyDownloader extends ServiceSupport implements Depende // all maven-resolver work is delegated to camel-tooling-maven private MavenDownloader mavenDownloader; - // repository URLs set from "camel.jbang.repositories" property or --repository option. + // repository URLs set from "camel.jbang.repos" property or --repos option. private String repositories; private boolean fresh; diff --git a/parent/pom.xml b/parent/pom.xml index 8f4cffb36edcf..7ff50f5b9afc3 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -281,7 +281,7 @@ 1.8 1.0.8 6.0.1 - 0.20.0 + 0.21.0 2.13.0 2.1.1 0.1.8 @@ -323,7 +323,7 @@ 1.0.0 2.21.1 1.5.8 - 9.11.1 + 9.12.0 0.2.0 2.3.0 1.6.2 diff --git a/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java b/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java index 3b11d4b0b5aa5..a0c8cde9ffcd9 100644 --- a/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java +++ b/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenDownloaderImpl.java @@ -1168,7 +1168,7 @@ RepositorySystemSession configureRepositorySystemSession( /** *

- * Using the passed ({@code --repos} parameter or {@code camel.jbang.repositories} option) and configured (in Maven + * Using the passed ({@code --repos} parameter or {@code camel.jbang.repos} option) and configured (in Maven * settings) repository locations, prepare a list of {@link RemoteRepository remote repositories} to be used during * Maven resolution. These repositories are not yet mirrored/proxied. Use * {@link RepositorySystem#newResolutionRepositories} first.