PY-18029 Make PythonConsoleBackendService.getArray throw UnsupportedArrayTypeException

This commit is contained in:
Alexander Koshevoy
2018-08-22 23:16:40 +03:00
parent 82457d6510
commit 3cc6f118d8
6 changed files with 512 additions and 16 deletions
@@ -13,8 +13,9 @@ from _pydevd_bundle import pydevd_resolver
from _pydevd_bundle.pydevd_constants import dict_iter_items, dict_keys, IS_PY3K, \
BUILTINS_MODULE_NAME, MAXIMUM_VARIABLE_REPRESENTATION_SIZE, RETURN_VALUES_DICT, LOAD_VALUES_POLICY, ValuesPolicy, DEFAULT_VALUES_DICT
from _pydevd_bundle.pydevd_extension_api import TypeResolveProvider, StrPresentationProvider
from _pydevd_bundle.pydevd_vars import get_label, VariableError, array_default_format, MAXIMUM_ARRAY_SIZE
from pydev_console.protocol import DebugValue, GetArrayResponse, ArrayData, ArrayHeaders, ColHeader, RowHeader
from _pydevd_bundle.pydevd_vars import get_label, array_default_format, MAXIMUM_ARRAY_SIZE
from pydev_console.protocol import DebugValue, GetArrayResponse, ArrayData, ArrayHeaders, ColHeader, RowHeader, \
UnsupportedArrayTypeException
try:
import types
@@ -583,4 +584,4 @@ def table_like_struct_to_thrift_struct(array, name, roffset, coffset, rows, cols
if type_name in TYPE_TO_THRIFT_STRUCT_CONVERTERS:
return TYPE_TO_THRIFT_STRUCT_CONVERTERS[type_name](array, name, roffset, coffset, rows, cols, format)
else:
raise VariableError("type %s not supported" % type_name)
raise UnsupportedArrayTypeException(type_name)
@@ -108,6 +108,10 @@ typedef string AttributeDescription
typedef list<DebugValue> DebugValues
exception UnsupportedArrayTypeException {
1: string type,
}
service PythonConsoleBackendService {
/**
* Returns `true` if Python console script needs more code to evaluate it.
@@ -159,7 +163,8 @@ service PythonConsoleBackendService {
DebugValues evaluate(1: string expression),
GetArrayResponse getArray(1: string vars, 2: i32 rowOffset, 3: i32 colOffset, 4: i32 rows, 5: i32 cols, 6: string format),
GetArrayResponse getArray(1: string vars, 2: i32 rowOffset, 3: i32 colOffset, 4: i32 rows, 5: i32 cols, 6: string format)
throws (1: UnsupportedArrayTypeException unsupported),
/**
* The result is returned asyncronously with `PythonConsoleFrontendService.returnFullValue`.
@@ -15,5 +15,7 @@ ArrayHeaders = _console_thrift.ArrayHeaders
ColHeader = _console_thrift.ColHeader
RowHeader = _console_thrift.RowHeader
UnsupportedArrayTypeException = _console_thrift.UnsupportedArrayTypeException
PythonConsoleFrontendService = _console_thrift.PythonConsoleFrontendService
PythonConsoleBackendService = _console_thrift.PythonConsoleBackendService
@@ -7,7 +7,7 @@
package com.jetbrains.python.console;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-09")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-24")
public class PythonConsoleBackendService {
public interface Iface {
@@ -74,7 +74,7 @@ public class PythonConsoleBackendService {
public java.util.List<DebugValue> evaluate(java.lang.String expression) throws org.apache.thrift.TException;
public GetArrayResponse getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format) throws org.apache.thrift.TException;
public GetArrayResponse getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format) throws UnsupportedArrayTypeException, org.apache.thrift.TException;
/**
* The result is returned asyncronously with `PythonConsoleFrontendService.returnFullValue`.
@@ -394,7 +394,7 @@ public class PythonConsoleBackendService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "evaluate failed: unknown result");
}
public GetArrayResponse getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format) throws org.apache.thrift.TException
public GetArrayResponse getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format) throws UnsupportedArrayTypeException, org.apache.thrift.TException
{
send_getArray(vars, rowOffset, colOffset, rows, cols, format);
return recv_getArray();
@@ -412,13 +412,16 @@ public class PythonConsoleBackendService {
sendBase("getArray", args);
}
public GetArrayResponse recv_getArray() throws org.apache.thrift.TException
public GetArrayResponse recv_getArray() throws UnsupportedArrayTypeException, org.apache.thrift.TException
{
getArray_result result = new getArray_result();
receiveBase(result, "getArray");
if (result.isSetSuccess()) {
return result.success;
}
if (result.unsupported != null) {
throw result.unsupported;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getArray failed: unknown result");
}
@@ -882,7 +885,7 @@ public class PythonConsoleBackendService {
prot.writeMessageEnd();
}
public GetArrayResponse getResult() throws org.apache.thrift.TException {
public GetArrayResponse getResult() throws UnsupportedArrayTypeException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
@@ -1278,7 +1281,11 @@ public class PythonConsoleBackendService {
public getArray_result getResult(I iface, getArray_args args) throws org.apache.thrift.TException {
getArray_result result = new getArray_result();
result.success = iface.getArray(args.vars, args.rowOffset, args.colOffset, args.rows, args.cols, args.format);
try {
result.success = iface.getArray(args.vars, args.rowOffset, args.colOffset, args.rows, args.cols, args.format);
} catch (UnsupportedArrayTypeException unsupported) {
result.unsupported = unsupported;
}
return result;
}
}
@@ -2071,7 +2078,11 @@ public class PythonConsoleBackendService {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getArray_result result = new getArray_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
if (e instanceof UnsupportedArrayTypeException) {
result.unsupported = (UnsupportedArrayTypeException) e;
result.setUnsupportedIsSet(true);
msg = result;
} else if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
@@ -11289,15 +11300,18 @@ public class PythonConsoleBackendService {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getArray_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField UNSUPPORTED_FIELD_DESC = new org.apache.thrift.protocol.TField("unsupported", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getArray_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getArray_resultTupleSchemeFactory();
public GetArrayResponse success; // required
public UnsupportedArrayTypeException unsupported; // 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");
SUCCESS((short)0, "success"),
UNSUPPORTED((short)1, "unsupported");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
@@ -11314,6 +11328,8 @@ public class PythonConsoleBackendService {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // UNSUPPORTED
return UNSUPPORTED;
default:
return null;
}
@@ -11359,6 +11375,8 @@ public class PythonConsoleBackendService {
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, GetArrayResponse.class)));
tmpMap.put(_Fields.UNSUPPORTED, new org.apache.thrift.meta_data.FieldMetaData("unsupported", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UnsupportedArrayTypeException.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getArray_result.class, metaDataMap);
}
@@ -11367,10 +11385,12 @@ public class PythonConsoleBackendService {
}
public getArray_result(
GetArrayResponse success)
GetArrayResponse success,
UnsupportedArrayTypeException unsupported)
{
this();
this.success = success;
this.unsupported = unsupported;
}
/**
@@ -11380,6 +11400,9 @@ public class PythonConsoleBackendService {
if (other.isSetSuccess()) {
this.success = new GetArrayResponse(other.success);
}
if (other.isSetUnsupported()) {
this.unsupported = new UnsupportedArrayTypeException(other.unsupported);
}
}
public getArray_result deepCopy() {
@@ -11389,6 +11412,7 @@ public class PythonConsoleBackendService {
@Override
public void clear() {
this.success = null;
this.unsupported = null;
}
public GetArrayResponse getSuccess() {
@@ -11415,6 +11439,30 @@ public class PythonConsoleBackendService {
}
}
public UnsupportedArrayTypeException getUnsupported() {
return this.unsupported;
}
public getArray_result setUnsupported(UnsupportedArrayTypeException unsupported) {
this.unsupported = unsupported;
return this;
}
public void unsetUnsupported() {
this.unsupported = null;
}
/** Returns true if field unsupported is set (has been assigned a value) and false otherwise */
public boolean isSetUnsupported() {
return this.unsupported != null;
}
public void setUnsupportedIsSet(boolean value) {
if (!value) {
this.unsupported = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
@@ -11425,6 +11473,14 @@ public class PythonConsoleBackendService {
}
break;
case UNSUPPORTED:
if (value == null) {
unsetUnsupported();
} else {
setUnsupported((UnsupportedArrayTypeException)value);
}
break;
}
}
@@ -11433,6 +11489,9 @@ public class PythonConsoleBackendService {
case SUCCESS:
return getSuccess();
case UNSUPPORTED:
return getUnsupported();
}
throw new java.lang.IllegalStateException();
}
@@ -11446,6 +11505,8 @@ public class PythonConsoleBackendService {
switch (field) {
case SUCCESS:
return isSetSuccess();
case UNSUPPORTED:
return isSetUnsupported();
}
throw new java.lang.IllegalStateException();
}
@@ -11474,6 +11535,15 @@ public class PythonConsoleBackendService {
return false;
}
boolean this_present_unsupported = true && this.isSetUnsupported();
boolean that_present_unsupported = true && that.isSetUnsupported();
if (this_present_unsupported || that_present_unsupported) {
if (!(this_present_unsupported && that_present_unsupported))
return false;
if (!this.unsupported.equals(that.unsupported))
return false;
}
return true;
}
@@ -11485,6 +11555,10 @@ public class PythonConsoleBackendService {
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
hashCode = hashCode * 8191 + ((isSetUnsupported()) ? 131071 : 524287);
if (isSetUnsupported())
hashCode = hashCode * 8191 + unsupported.hashCode();
return hashCode;
}
@@ -11506,6 +11580,16 @@ public class PythonConsoleBackendService {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetUnsupported()).compareTo(other.isSetUnsupported());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUnsupported()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unsupported, other.unsupported);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@@ -11533,6 +11617,14 @@ public class PythonConsoleBackendService {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("unsupported:");
if (this.unsupported == null) {
sb.append("null");
} else {
sb.append(this.unsupported);
}
first = false;
sb.append(")");
return sb.toString();
}
@@ -11588,6 +11680,15 @@ public class PythonConsoleBackendService {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // UNSUPPORTED
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.unsupported = new UnsupportedArrayTypeException();
struct.unsupported.read(iprot);
struct.setUnsupportedIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -11608,6 +11709,11 @@ public class PythonConsoleBackendService {
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.unsupported != null) {
oprot.writeFieldBegin(UNSUPPORTED_FIELD_DESC);
struct.unsupported.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -11629,21 +11735,32 @@ public class PythonConsoleBackendService {
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetUnsupported()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetUnsupported()) {
struct.unsupported.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getArray_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new GetArrayResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.unsupported = new UnsupportedArrayTypeException();
struct.unsupported.read(iprot);
struct.setUnsupportedIsSet(true);
}
}
}
@@ -0,0 +1,372 @@
/**
* Autogenerated by Thrift Compiler (0.11.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.jetbrains.python.console;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-24")
public class UnsupportedArrayTypeException extends org.apache.thrift.TException implements org.apache.thrift.TBase<UnsupportedArrayTypeException, UnsupportedArrayTypeException._Fields>, java.io.Serializable, Cloneable, Comparable<UnsupportedArrayTypeException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnsupportedArrayTypeException");
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UnsupportedArrayTypeExceptionStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UnsupportedArrayTypeExceptionTupleSchemeFactory();
public java.lang.String type; // 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 {
TYPE((short)1, "type");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TYPE
return TYPE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
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(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// 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, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UnsupportedArrayTypeException.class, metaDataMap);
}
public UnsupportedArrayTypeException() {
}
public UnsupportedArrayTypeException(
java.lang.String type)
{
this();
this.type = type;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public UnsupportedArrayTypeException(UnsupportedArrayTypeException other) {
if (other.isSetType()) {
this.type = other.type;
}
}
public UnsupportedArrayTypeException deepCopy() {
return new UnsupportedArrayTypeException(this);
}
@Override
public void clear() {
this.type = null;
}
public java.lang.String getType() {
return this.type;
}
public UnsupportedArrayTypeException setType(java.lang.String type) {
this.type = type;
return this;
}
public void unsetType() {
this.type = null;
}
/** Returns true if field type is set (has been assigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case TYPE:
if (value == null) {
unsetType();
} else {
setType((java.lang.String)value);
}
break;
}
}
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case TYPE:
return getType();
}
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 java.lang.IllegalArgumentException();
}
switch (field) {
case TYPE:
return isSetType();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof UnsupportedArrayTypeException)
return this.equals((UnsupportedArrayTypeException)that);
return false;
}
public boolean equals(UnsupportedArrayTypeException that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
if (!(this_present_type && that_present_type))
return false;
if (!this.type.equals(that.type))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287);
if (isSetType())
hashCode = hashCode * 8191 + type.hashCode();
return hashCode;
}
@Override
public int compareTo(UnsupportedArrayTypeException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("UnsupportedArrayTypeException(");
boolean first = true;
sb.append("type:");
if (this.type == null) {
sb.append("null");
} else {
sb.append(this.type);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
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) {
throw new java.io.IOException(te);
}
}
private static class UnsupportedArrayTypeExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnsupportedArrayTypeExceptionStandardScheme getScheme() {
return new UnsupportedArrayTypeExceptionStandardScheme();
}
}
private static class UnsupportedArrayTypeExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<UnsupportedArrayTypeException> {
public void read(org.apache.thrift.protocol.TProtocol iprot, UnsupportedArrayTypeException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.type = iprot.readString();
struct.setTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, UnsupportedArrayTypeException struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.type != null) {
oprot.writeFieldBegin(TYPE_FIELD_DESC);
oprot.writeString(struct.type);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class UnsupportedArrayTypeExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnsupportedArrayTypeExceptionTupleScheme getScheme() {
return new UnsupportedArrayTypeExceptionTupleScheme();
}
}
private static class UnsupportedArrayTypeExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<UnsupportedArrayTypeException> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UnsupportedArrayTypeException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetType()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetType()) {
oprot.writeString(struct.type);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UnsupportedArrayTypeException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.type = iprot.readString();
struct.setTypeIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> 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();
}
}
@@ -639,7 +639,6 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl
throws PyDebuggerException {
if (myClient != null) {
try {
// @alexander todo add specific exception to the method (previously processed by `checkError()`)
GetArrayResponse ret = myClient.getArray(var.getName(), rowOffset, colOffset, rows, cols, format);
return createArrayChunk(ret, this);
}