Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 30C11200CDD for ; Mon, 7 Aug 2017 16:55:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D7B816573F; Mon, 7 Aug 2017 14:55:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1644E165729 for ; Mon, 7 Aug 2017 16:55:30 +0200 (CEST) Received: (qmail 17122 invoked by uid 500); 7 Aug 2017 14:55:30 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 16825 invoked by uid 99); 7 Aug 2017 14:55:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 14:55:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 44023F5EC3; Mon, 7 Aug 2017 14:55:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: machristie@apache.org To: commits@airavata.apache.org Date: Mon, 07 Aug 2017 14:55:31 -0000 Message-Id: <69340f56450c4066abd6be0491830f05@git.apache.org> In-Reply-To: <3c67660f922b46c3b5d43e7f7bfa96ab@git.apache.org> References: <3c67660f922b46c3b5d43e7f7bfa96ab@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/51] [abbrv] [partial] airavata git commit: AIRAVATA-2505 Upgrade Airavata to Thrift 0.10.0 archived-at: Mon, 07 Aug 2017 14:55:33 -0000 http://git-wip-us.apache.org/repos/asf/airavata/blob/39fba1f5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java index 517ee3b..58e2102 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ExperimentNotFoundException.java @@ -16,41 +16,14 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown when a client asks to perform an operation on an experiment that does not exist. * @@ -58,28 +31,25 @@ import org.slf4j.LoggerFactory; * * key: The value passed from the client in the identifier, which was not found. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ExperimentNotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class ExperimentNotFoundException extends org.apache.thrift.TException 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("ExperimentNotFoundException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExperimentNotFoundExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExperimentNotFoundExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExperimentNotFoundExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExperimentNotFoundExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // 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 { MESSAGE((short)1, "message"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -102,21 +72,21 @@ public class ExperimentNotFoundException extends TException implements org.apach */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -125,18 +95,18 @@ public class ExperimentNotFoundException extends TException implements org.apach return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExperimentNotFoundException.class, metaDataMap); } @@ -144,7 +114,7 @@ public class ExperimentNotFoundException extends TException implements org.apach } public ExperimentNotFoundException( - String message) + java.lang.String message) { this(); this.message = message; @@ -168,11 +138,11 @@ public class ExperimentNotFoundException extends TException implements org.apach this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -191,43 +161,43 @@ public class ExperimentNotFoundException extends TException implements org.apach } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ExperimentNotFoundException) @@ -238,6 +208,8 @@ public class ExperimentNotFoundException extends TException implements org.apach public boolean equals(ExperimentNotFoundException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -253,14 +225,13 @@ public class ExperimentNotFoundException extends TException implements org.apach @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -271,7 +242,7 @@ public class ExperimentNotFoundException extends TException implements org.apach int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -289,16 +260,16 @@ public class ExperimentNotFoundException extends TException implements org.apach } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExperimentNotFoundException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ExperimentNotFoundException("); boolean first = true; sb.append("message:"); @@ -329,7 +300,7 @@ public class ExperimentNotFoundException extends TException implements org.apach } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -337,13 +308,13 @@ public class ExperimentNotFoundException extends TException implements org.apach } } - private static class ExperimentNotFoundExceptionStandardSchemeFactory implements SchemeFactory { + private static class ExperimentNotFoundExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExperimentNotFoundExceptionStandardScheme getScheme() { return new ExperimentNotFoundExceptionStandardScheme(); } } - private static class ExperimentNotFoundExceptionStandardScheme extends StandardScheme { + private static class ExperimentNotFoundExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -387,27 +358,30 @@ public class ExperimentNotFoundException extends TException implements org.apach } - private static class ExperimentNotFoundExceptionTupleSchemeFactory implements SchemeFactory { + private static class ExperimentNotFoundExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExperimentNotFoundExceptionTupleScheme getScheme() { return new ExperimentNotFoundExceptionTupleScheme(); } } - private static class ExperimentNotFoundExceptionTupleScheme extends TupleScheme { + private static class ExperimentNotFoundExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ExperimentNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/39fba1f5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java index f909497..1dcf19a 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/InvalidRequestException.java @@ -16,69 +16,39 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown for invalid requests that occur from any reasons like required input parameters are missing, * or a parameter is malformed. * * message: contains the associated error message. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class InvalidRequestException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class InvalidRequestException extends org.apache.thrift.TException 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("InvalidRequestException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new InvalidRequestExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new InvalidRequestExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new InvalidRequestExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new InvalidRequestExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // 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 { MESSAGE((short)1, "message"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -101,21 +71,21 @@ public class InvalidRequestException extends TException implements org.apache.th */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -124,18 +94,18 @@ public class InvalidRequestException extends TException implements org.apache.th return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvalidRequestException.class, metaDataMap); } @@ -143,7 +113,7 @@ public class InvalidRequestException extends TException implements org.apache.th } public InvalidRequestException( - String message) + java.lang.String message) { this(); this.message = message; @@ -167,11 +137,11 @@ public class InvalidRequestException extends TException implements org.apache.th this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -190,43 +160,43 @@ public class InvalidRequestException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof InvalidRequestException) @@ -237,6 +207,8 @@ public class InvalidRequestException extends TException implements org.apache.th public boolean equals(InvalidRequestException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -252,14 +224,13 @@ public class InvalidRequestException extends TException implements org.apache.th @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -270,7 +241,7 @@ public class InvalidRequestException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -288,16 +259,16 @@ public class InvalidRequestException extends TException implements org.apache.th } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("InvalidRequestException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("InvalidRequestException("); boolean first = true; sb.append("message:"); @@ -328,7 +299,7 @@ public class InvalidRequestException extends TException implements org.apache.th } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -336,13 +307,13 @@ public class InvalidRequestException extends TException implements org.apache.th } } - private static class InvalidRequestExceptionStandardSchemeFactory implements SchemeFactory { + private static class InvalidRequestExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public InvalidRequestExceptionStandardScheme getScheme() { return new InvalidRequestExceptionStandardScheme(); } } - private static class InvalidRequestExceptionStandardScheme extends StandardScheme { + private static class InvalidRequestExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidRequestException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -386,27 +357,30 @@ public class InvalidRequestException extends TException implements org.apache.th } - private static class InvalidRequestExceptionTupleSchemeFactory implements SchemeFactory { + private static class InvalidRequestExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public InvalidRequestExceptionTupleScheme getScheme() { return new InvalidRequestExceptionTupleScheme(); } } - private static class InvalidRequestExceptionTupleScheme extends TupleScheme { + private static class InvalidRequestExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, InvalidRequestException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, InvalidRequestException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/39fba1f5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java index f6a7019..ddb83ad 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/LaunchValidationException.java @@ -16,66 +16,36 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class LaunchValidationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class LaunchValidationException extends org.apache.thrift.TException 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("LaunchValidationException"); private static final org.apache.thrift.protocol.TField VALIDATION_RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("validationResult", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new LaunchValidationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new LaunchValidationExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new LaunchValidationExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new LaunchValidationExceptionTupleSchemeFactory(); private ValidationResults validationResult; // required - private String errorMessage; // optional + private java.lang.String errorMessage; // 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 { VALIDATION_RESULT((short)1, "validationResult"), ERROR_MESSAGE((short)2, "errorMessage"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -100,21 +70,21 @@ public class LaunchValidationException extends TException implements org.apache. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -123,21 +93,21 @@ public class LaunchValidationException extends TException implements org.apache. return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.ERROR_MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_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.VALIDATION_RESULT, new org.apache.thrift.meta_data.FieldMetaData("validationResult", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ValidationResults.class))); tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LaunchValidationException.class, metaDataMap); } @@ -196,11 +166,11 @@ public class LaunchValidationException extends TException implements org.apache. } } - public String getErrorMessage() { + public java.lang.String getErrorMessage() { return this.errorMessage; } - public void setErrorMessage(String errorMessage) { + public void setErrorMessage(java.lang.String errorMessage) { this.errorMessage = errorMessage; } @@ -219,7 +189,7 @@ public class LaunchValidationException extends TException implements org.apache. } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case VALIDATION_RESULT: if (value == null) { @@ -233,14 +203,14 @@ public class LaunchValidationException extends TException implements org.apache. if (value == null) { unsetErrorMessage(); } else { - setErrorMessage((String)value); + setErrorMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALIDATION_RESULT: return getValidationResult(); @@ -249,13 +219,13 @@ public class LaunchValidationException extends TException implements org.apache. return getErrorMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -264,11 +234,11 @@ public class LaunchValidationException extends TException implements org.apache. case ERROR_MESSAGE: return isSetErrorMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof LaunchValidationException) @@ -279,6 +249,8 @@ public class LaunchValidationException extends TException implements org.apache. public boolean equals(LaunchValidationException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_validationResult = true && this.isSetValidationResult(); boolean that_present_validationResult = true && that.isSetValidationResult(); @@ -303,19 +275,17 @@ public class LaunchValidationException extends TException implements org.apache. @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_validationResult = true && (isSetValidationResult()); - list.add(present_validationResult); - if (present_validationResult) - list.add(validationResult); + hashCode = hashCode * 8191 + ((isSetValidationResult()) ? 131071 : 524287); + if (isSetValidationResult()) + hashCode = hashCode * 8191 + validationResult.hashCode(); - boolean present_errorMessage = true && (isSetErrorMessage()); - list.add(present_errorMessage); - if (present_errorMessage) - list.add(errorMessage); + hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); + if (isSetErrorMessage()) + hashCode = hashCode * 8191 + errorMessage.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -326,7 +296,7 @@ public class LaunchValidationException extends TException implements org.apache. int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValidationResult()).compareTo(other.isSetValidationResult()); + lastComparison = java.lang.Boolean.valueOf(isSetValidationResult()).compareTo(other.isSetValidationResult()); if (lastComparison != 0) { return lastComparison; } @@ -336,7 +306,7 @@ public class LaunchValidationException extends TException implements org.apache. return lastComparison; } } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); if (lastComparison != 0) { return lastComparison; } @@ -354,16 +324,16 @@ public class LaunchValidationException extends TException implements org.apache. } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("LaunchValidationException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("LaunchValidationException("); boolean first = true; sb.append("validationResult:"); @@ -407,7 +377,7 @@ public class LaunchValidationException extends TException implements org.apache. } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +385,13 @@ public class LaunchValidationException extends TException implements org.apache. } } - private static class LaunchValidationExceptionStandardSchemeFactory implements SchemeFactory { + private static class LaunchValidationExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public LaunchValidationExceptionStandardScheme getScheme() { return new LaunchValidationExceptionStandardScheme(); } } - private static class LaunchValidationExceptionStandardScheme extends StandardScheme { + private static class LaunchValidationExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, LaunchValidationException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -481,19 +451,19 @@ public class LaunchValidationException extends TException implements org.apache. } - private static class LaunchValidationExceptionTupleSchemeFactory implements SchemeFactory { + private static class LaunchValidationExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public LaunchValidationExceptionTupleScheme getScheme() { return new LaunchValidationExceptionTupleScheme(); } } - private static class LaunchValidationExceptionTupleScheme extends TupleScheme { + private static class LaunchValidationExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, LaunchValidationException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.validationResult.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetErrorMessage()) { optionals.set(0); } @@ -505,11 +475,11 @@ public class LaunchValidationException extends TException implements org.apache. @Override public void read(org.apache.thrift.protocol.TProtocol prot, LaunchValidationException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.validationResult = new ValidationResults(); struct.validationResult.read(iprot); struct.setValidationResultIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.errorMessage = iprot.readString(); struct.setErrorMessageIsSet(true); @@ -517,5 +487,8 @@ public class LaunchValidationException extends TException implements org.apache. } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/39fba1f5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java index a81da69..f0ca5d2 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/ProjectNotFoundException.java @@ -16,68 +16,38 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * 1: optional string identifier, * 2: optional string key * */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class ProjectNotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class ProjectNotFoundException extends org.apache.thrift.TException 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("ProjectNotFoundException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ProjectNotFoundExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ProjectNotFoundExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ProjectNotFoundExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ProjectNotFoundExceptionTupleSchemeFactory(); - private String message; // required + private java.lang.String message; // 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 { MESSAGE((short)1, "message"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -100,21 +70,21 @@ public class ProjectNotFoundException extends TException implements org.apache.t */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -123,18 +93,18 @@ public class ProjectNotFoundException extends TException implements org.apache.t return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProjectNotFoundException.class, metaDataMap); } @@ -142,7 +112,7 @@ public class ProjectNotFoundException extends TException implements org.apache.t } public ProjectNotFoundException( - String message) + java.lang.String message) { this(); this.message = message; @@ -166,11 +136,11 @@ public class ProjectNotFoundException extends TException implements org.apache.t this.message = null; } - public String getMessage() { + public java.lang.String getMessage() { return this.message; } - public void setMessage(String message) { + public void setMessage(java.lang.String message) { this.message = message; } @@ -189,43 +159,43 @@ public class ProjectNotFoundException extends TException implements org.apache.t } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MESSAGE: if (value == null) { unsetMessage(); } else { - setMessage((String)value); + setMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MESSAGE: return getMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MESSAGE: return isSetMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ProjectNotFoundException) @@ -236,6 +206,8 @@ public class ProjectNotFoundException extends TException implements org.apache.t public boolean equals(ProjectNotFoundException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); @@ -251,14 +223,13 @@ public class ProjectNotFoundException extends TException implements org.apache.t @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_message = true && (isSetMessage()); - list.add(present_message); - if (present_message) - list.add(message); + hashCode = hashCode * 8191 + ((isSetMessage()) ? 131071 : 524287); + if (isSetMessage()) + hashCode = hashCode * 8191 + message.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -269,7 +240,7 @@ public class ProjectNotFoundException extends TException implements org.apache.t int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -287,16 +258,16 @@ public class ProjectNotFoundException extends TException implements org.apache.t } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ProjectNotFoundException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ProjectNotFoundException("); boolean first = true; sb.append("message:"); @@ -327,7 +298,7 @@ public class ProjectNotFoundException extends TException implements org.apache.t } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -335,13 +306,13 @@ public class ProjectNotFoundException extends TException implements org.apache.t } } - private static class ProjectNotFoundExceptionStandardSchemeFactory implements SchemeFactory { + private static class ProjectNotFoundExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ProjectNotFoundExceptionStandardScheme getScheme() { return new ProjectNotFoundExceptionStandardScheme(); } } - private static class ProjectNotFoundExceptionStandardScheme extends StandardScheme { + private static class ProjectNotFoundExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ProjectNotFoundException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -385,27 +356,30 @@ public class ProjectNotFoundException extends TException implements org.apache.t } - private static class ProjectNotFoundExceptionTupleSchemeFactory implements SchemeFactory { + private static class ProjectNotFoundExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ProjectNotFoundExceptionTupleScheme getScheme() { return new ProjectNotFoundExceptionTupleScheme(); } } - private static class ProjectNotFoundExceptionTupleScheme extends TupleScheme { + private static class ProjectNotFoundExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ProjectNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.message); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ProjectNotFoundException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.message = iprot.readString(); struct.setMessageIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } http://git-wip-us.apache.org/repos/asf/airavata/blob/39fba1f5/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java index b192ab6..33d95a0 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/error/TimedOutException.java @@ -16,64 +16,34 @@ */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.airavata.model.error; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * This exception is thrown when RPC timeout gets exceeded. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TimedOutException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class TimedOutException extends org.apache.thrift.TException 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("TimedOutException"); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TimedOutExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TimedOutExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TimedOutExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TimedOutExceptionTupleSchemeFactory(); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -94,21 +64,21 @@ public class TimedOutException extends TException implements org.apache.thrift.T */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -117,14 +87,14 @@ public class TimedOutException extends TException implements org.apache.thrift.T return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - metaDataMap = Collections.unmodifiableMap(tmpMap); + 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(TimedOutException.class, metaDataMap); } @@ -145,30 +115,30 @@ public class TimedOutException extends TException implements org.apache.thrift.T public void clear() { } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TimedOutException) @@ -179,15 +149,17 @@ public class TimedOutException extends TException implements org.apache.thrift.T public boolean equals(TimedOutException that) { if (that == null) return false; + if (this == that) + return true; return true; } @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - return list.hashCode(); + return hashCode; } @Override @@ -206,16 +178,16 @@ public class TimedOutException extends TException implements org.apache.thrift.T } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TimedOutException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TimedOutException("); boolean first = true; sb.append(")"); @@ -235,7 +207,7 @@ public class TimedOutException extends TException implements org.apache.thrift.T } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -243,13 +215,13 @@ public class TimedOutException extends TException implements org.apache.thrift.T } } - private static class TimedOutExceptionStandardSchemeFactory implements SchemeFactory { + private static class TimedOutExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TimedOutExceptionStandardScheme getScheme() { return new TimedOutExceptionStandardScheme(); } } - private static class TimedOutExceptionStandardScheme extends StandardScheme { + private static class TimedOutExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TimedOutException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -280,24 +252,27 @@ public class TimedOutException extends TException implements org.apache.thrift.T } - private static class TimedOutExceptionTupleSchemeFactory implements SchemeFactory { + private static class TimedOutExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TimedOutExceptionTupleScheme getScheme() { return new TimedOutExceptionTupleScheme(); } } - private static class TimedOutExceptionTupleScheme extends TupleScheme { + private static class TimedOutExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TimedOutException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TimedOutException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } }