[gwt-rpc-plus] r159 committed - - Fix RPC codegen so we generate JsRpcMapStringString instead of JsRp...

1 view
Skip to first unread message

gwt-rp...@googlecode.com

unread,
Apr 28, 2010, 6:57:09 PM4/28/10
to dotspots-o...@googlegroups.com
Revision: 159
Author: mmastrac
Date: Wed Apr 28 15:56:15 2010
Log: - Fix RPC codegen so we generate JsRpcMapStringString instead of
JsRpcMapString<String>.
- Adding some additional tests for some of the basic colleciton methods.
http://code.google.com/p/gwt-rpc-plus/source/detail?r=159

Modified:

/trunk/gwt-rpc-plus/codegen/com/dotspots/rpcplus/codegen/thrift/GwtCodeGenBase.java

/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/ObjectWithComplexTypes.java

/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi.java

/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi_testMapStringString_result.java

/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithComplexTypes.java

/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithEnum.java

/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/TortureTestApi.java

/trunk/gwt-rpc-plus/example/gen-json-server/com/dotspots/rpcplus/example/torturetest/TortureTestApiJson.java

/trunk/gwt-rpc-plus/example/server-example/com/dotspots/rpcplus/example/jsonrpc/thrift/ExampleService.java
/trunk/gwt-rpc-plus/example/torturetest.thrift

/trunk/gwt-rpc-plus/test/gwt-test/com/dotspots/rpcplus/test/client/TestThriftCollections.java

=======================================
---
/trunk/gwt-rpc-plus/codegen/com/dotspots/rpcplus/codegen/thrift/GwtCodeGenBase.java
Tue Nov 3 15:45:07 2009
+++
/trunk/gwt-rpc-plus/codegen/com/dotspots/rpcplus/codegen/thrift/GwtCodeGenBase.java
Wed Apr 28 15:56:15 2010
@@ -15,6 +15,7 @@
typeMap.put(RpcTypeKey.DOUBLE, "Double");
typeMap.put(RpcTypeKey.I64, "Long");
typeMap.put(RpcTypeKey.ENUM, "Int");
+ typeMap.put(RpcTypeKey.STRING, "String");

final Map<RpcTypeKey, String> keyTypeMap = new HashMap<RpcTypeKey,
String>();
keyTypeMap.put(RpcTypeKey.I32, "Int");
=======================================
---
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/ObjectWithComplexTypes.java
Mon Nov 30 10:50:09 2009
+++
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/ObjectWithComplexTypes.java
Wed Apr 28 15:56:15 2010
@@ -16,15 +16,15 @@
}

/* Factory method, strongly dependent on order of fields */
- public static native ObjectWithComplexTypes
create(JsRpcMapString<String> mapStringToString, JsRpcSetString
setOfStrings, JsRpcList<String> listOfStrings, JsRpcMapIntInt
mapOfIntToInt) /*-{
- return
[mapStringToString,setOfStrings,listOfStrings,mapOfIntToInt];
+ public static native ObjectWithComplexTypes
create(JsRpcMapStringString mapStringToString, JsRpcSetString setOfStrings,
JsRpcListString listOfStrings, JsRpcMapIntInt mapOfIntToInt,
JsRpcList<JsRpcMapStringString> listOfMapStringToString,
JsRpcList<JsRpcMapIntString> listOfMapI32ToString,
JsRpcList<JsRpcMapStringInt> listOfMapStringToI32,
JsRpcMapString<JsRpcMapIntInt> mapOfMapI32ToI32,
JsRpcMapString<JsRpcMapStringString> mapOfMapStringToString) /*-{
+ return
[mapStringToString,setOfStrings,listOfStrings,mapOfIntToInt,listOfMapStringToString,listOfMapI32ToString,listOfMapStringToI32,mapOfMapI32ToI32,mapOfMapStringToString];
}-*/;

- public native JsRpcMapString<String> getMapStringToString() /*-{
+ public native JsRpcMapStringString getMapStringToString() /*-{
return this[0];
}-*/;

- public native void setMapStringToString(JsRpcMapString<String>
mapStringToString) /*-{
+ public native void setMapStringToString(JsRpcMapStringString
mapStringToString) /*-{
this[0] = mapStringToString;
}-*/;

@@ -52,11 +52,11 @@
delete this[1];
}-*/;

- public native JsRpcList<String> getListOfStrings() /*-{
+ public native JsRpcListString getListOfStrings() /*-{
return this[2];
}-*/;

- public native void setListOfStrings(JsRpcList<String> listOfStrings)
/*-{
+ public native void setListOfStrings(JsRpcListString listOfStrings) /*-{
this[2] = listOfStrings;
}-*/;

@@ -84,4 +84,84 @@
delete this[3];
}-*/;

-}
+ public native JsRpcList<JsRpcMapStringString>
getListOfMapStringToString() /*-{
+ return this[4];
+ }-*/;
+
+ public native void
setListOfMapStringToString(JsRpcList<JsRpcMapStringString>
listOfMapStringToString) /*-{
+ this[4] = listOfMapStringToString;
+ }-*/;
+
+ public native boolean isSetListOfMapStringToString() /*-{
+ return this[4] != null;
+ }-*/;
+
+ public native void unsetListOfMapStringToString() /*-{
+ delete this[4];
+ }-*/;
+
+ public native JsRpcList<JsRpcMapIntString> getListOfMapI32ToString()
/*-{
+ return this[5];
+ }-*/;
+
+ public native void
setListOfMapI32ToString(JsRpcList<JsRpcMapIntString> listOfMapI32ToString)
/*-{
+ this[5] = listOfMapI32ToString;
+ }-*/;
+
+ public native boolean isSetListOfMapI32ToString() /*-{
+ return this[5] != null;
+ }-*/;
+
+ public native void unsetListOfMapI32ToString() /*-{
+ delete this[5];
+ }-*/;
+
+ public native JsRpcList<JsRpcMapStringInt> getListOfMapStringToI32()
/*-{
+ return this[6];
+ }-*/;
+
+ public native void
setListOfMapStringToI32(JsRpcList<JsRpcMapStringInt> listOfMapStringToI32)
/*-{
+ this[6] = listOfMapStringToI32;
+ }-*/;
+
+ public native boolean isSetListOfMapStringToI32() /*-{
+ return this[6] != null;
+ }-*/;
+
+ public native void unsetListOfMapStringToI32() /*-{
+ delete this[6];
+ }-*/;
+
+ public native JsRpcMapString<JsRpcMapIntInt> getMapOfMapI32ToI32() /*-{
+ return this[7];
+ }-*/;
+
+ public native void setMapOfMapI32ToI32(JsRpcMapString<JsRpcMapIntInt>
mapOfMapI32ToI32) /*-{
+ this[7] = mapOfMapI32ToI32;
+ }-*/;
+
+ public native boolean isSetMapOfMapI32ToI32() /*-{
+ return this[7] != null;
+ }-*/;
+
+ public native void unsetMapOfMapI32ToI32() /*-{
+ delete this[7];
+ }-*/;
+
+ public native JsRpcMapString<JsRpcMapStringString>
getMapOfMapStringToString() /*-{
+ return this[8];
+ }-*/;
+
+ public native void
setMapOfMapStringToString(JsRpcMapString<JsRpcMapStringString>
mapOfMapStringToString) /*-{
+ this[8] = mapOfMapStringToString;
+ }-*/;
+
+ public native boolean isSetMapOfMapStringToString() /*-{
+ return this[8] != null;
+ }-*/;
+
+ public native void unsetMapOfMapStringToString() /*-{
+ delete this[8];
+ }-*/;
+
+}
=======================================
---
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi.java
Tue Mar 23 20:33:15 2010
+++
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi.java
Wed Apr 28 15:56:15 2010
@@ -77,7 +77,7 @@
call(8, "testSetInt", TortureTestApi_testSetInt_args.create(),
callback);
};

- public void testMapStringString(AsyncCallback<JsRpcMapString<String>>
callback) {
+ public void testMapStringString(AsyncCallback<JsRpcMapStringString>
callback) {
call(9, "testMapStringString",
TortureTestApi_testMapStringString_args.create(), callback);
};

=======================================
---
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi_testMapStringString_result.java
Mon Nov 30 10:50:09 2009
+++
/trunk/gwt-rpc-plus/example/gen-java-gwt/com/dotspots/rpcplus/example/torturetest/client/TortureTestApi_testMapStringString_result.java
Wed Apr 28 15:56:15 2010
@@ -16,15 +16,15 @@
}

/* Factory method, strongly dependent on order of fields */
- public static native TortureTestApi_testMapStringString_result
create(JsRpcMapString<String> success) /*-{
+ public static native TortureTestApi_testMapStringString_result
create(JsRpcMapStringString success) /*-{
return [success];
}-*/;

- public native JsRpcMapString<String> getSuccess() /*-{
+ public native JsRpcMapStringString getSuccess() /*-{
return this[0];
}-*/;

- public native void setSuccess(JsRpcMapString<String> success) /*-{
+ public native void setSuccess(JsRpcMapStringString success) /*-{
this[0] = success;
}-*/;

=======================================
---
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithComplexTypes.java
Mon Oct 19 14:12:20 2009
+++
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithComplexTypes.java
Wed Apr 28 15:56:15 2010
@@ -24,6 +24,11 @@
private static final TField SET_OF_STRINGS_FIELD_DESC = new
TField("setOfStrings", TType.SET, (short)2);
private static final TField LIST_OF_STRINGS_FIELD_DESC = new
TField("listOfStrings", TType.LIST, (short)3);
private static final TField MAP_OF_INT_TO_INT_FIELD_DESC = new
TField("mapOfIntToInt", TType.MAP, (short)4);
+ private static final TField LIST_OF_MAP_STRING_TO_STRING_FIELD_DESC =
new TField("listOfMapStringToString", TType.LIST, (short)5);
+ private static final TField LIST_OF_MAP_I32_TO_STRING_FIELD_DESC = new
TField("listOfMapI32ToString", TType.LIST, (short)6);
+ private static final TField LIST_OF_MAP_STRING_TO_I32_FIELD_DESC = new
TField("listOfMapStringToI32", TType.LIST, (short)7);
+ private static final TField MAP_OF_MAP_I32_TO_I32_FIELD_DESC = new
TField("mapOfMapI32ToI32", TType.MAP, (short)8);
+ private static final TField MAP_OF_MAP_STRING_TO_STRING_FIELD_DESC = new
TField("mapOfMapStringToString", TType.MAP, (short)9);

private Map<String,String> mapStringToString;
public static final int MAPSTRINGTOSTRING = 1;
@@ -33,6 +38,16 @@
public static final int LISTOFSTRINGS = 3;
private Map<Integer,Integer> mapOfIntToInt;
public static final int MAPOFINTTOINT = 4;
+ private List<Map<String,String>> listOfMapStringToString;
+ public static final int LISTOFMAPSTRINGTOSTRING = 5;
+ private List<Map<Integer,String>> listOfMapI32ToString;
+ public static final int LISTOFMAPI32TOSTRING = 6;
+ private List<Map<String,Integer>> listOfMapStringToI32;
+ public static final int LISTOFMAPSTRINGTOI32 = 7;
+ private Map<String,Map<Integer,Integer>> mapOfMapI32ToI32;
+ public static final int MAPOFMAPI32TOI32 = 8;
+ private Map<String,Map<String,String>> mapOfMapStringToString;
+ public static final int MAPOFMAPSTRINGTOSTRING = 9;

private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
@@ -53,6 +68,33 @@
new MapMetaData(TType.MAP,
new FieldValueMetaData(TType.I32),
new FieldValueMetaData(TType.I32))));
+ put(LISTOFMAPSTRINGTOSTRING, new
FieldMetaData("listOfMapStringToString", TFieldRequirementType.DEFAULT,
+ new ListMetaData(TType.LIST,
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.STRING),
+ new FieldValueMetaData(TType.STRING)))));
+ put(LISTOFMAPI32TOSTRING, new FieldMetaData("listOfMapI32ToString",
TFieldRequirementType.DEFAULT,
+ new ListMetaData(TType.LIST,
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.I32),
+ new FieldValueMetaData(TType.STRING)))));
+ put(LISTOFMAPSTRINGTOI32, new FieldMetaData("listOfMapStringToI32",
TFieldRequirementType.DEFAULT,
+ new ListMetaData(TType.LIST,
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.STRING),
+ new FieldValueMetaData(TType.I32)))));
+ put(MAPOFMAPI32TOI32, new FieldMetaData("mapOfMapI32ToI32",
TFieldRequirementType.DEFAULT,
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.STRING),
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.I32),
+ new FieldValueMetaData(TType.I32)))));
+ put(MAPOFMAPSTRINGTOSTRING, new
FieldMetaData("mapOfMapStringToString", TFieldRequirementType.DEFAULT,
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.STRING),
+ new MapMetaData(TType.MAP,
+ new FieldValueMetaData(TType.STRING),
+ new FieldValueMetaData(TType.STRING)))));
}});

static {
@@ -66,13 +108,23 @@
Map<String,String> mapStringToString,
Set<String> setOfStrings,
List<String> listOfStrings,
- Map<Integer,Integer> mapOfIntToInt)
+ Map<Integer,Integer> mapOfIntToInt,
+ List<Map<String,String>> listOfMapStringToString,
+ List<Map<Integer,String>> listOfMapI32ToString,
+ List<Map<String,Integer>> listOfMapStringToI32,
+ Map<String,Map<Integer,Integer>> mapOfMapI32ToI32,
+ Map<String,Map<String,String>> mapOfMapStringToString)
{
this();
this.mapStringToString = mapStringToString;
this.setOfStrings = setOfStrings;
this.listOfStrings = listOfStrings;
this.mapOfIntToInt = mapOfIntToInt;
+ this.listOfMapStringToString = listOfMapStringToString;
+ this.listOfMapI32ToString = listOfMapI32ToString;
+ this.listOfMapStringToI32 = listOfMapStringToI32;
+ this.mapOfMapI32ToI32 = mapOfMapI32ToI32;
+ this.mapOfMapStringToString = mapOfMapStringToString;
}

/**
@@ -123,6 +175,115 @@
}
this.mapOfIntToInt = __this__mapOfIntToInt;
}
+ if (other.isSetListOfMapStringToString()) {
+ List<Map<String,String>> __this__listOfMapStringToString = new
ArrayList<Map<String,String>>();
+ for (Map<String,String> other_element :
other.listOfMapStringToString) {
+ Map<String,String> __this__listOfMapStringToString_copy = new
HashMap<String,String>();
+ for (Map.Entry<String, String> other_element_element :
other_element.entrySet()) {
+
+ String other_element_element_key =
other_element_element.getKey();
+ String other_element_element_value =
other_element_element.getValue();
+
+ String __this__listOfMapStringToString_copy_copy_key =
other_element_element_key;
+
+ String __this__listOfMapStringToString_copy_copy_value =
other_element_element_value;
+
+
__this__listOfMapStringToString_copy.put(__this__listOfMapStringToString_copy_copy_key,
__this__listOfMapStringToString_copy_copy_value);
+ }
+
__this__listOfMapStringToString.add(__this__listOfMapStringToString_copy);
+ }
+ this.listOfMapStringToString = __this__listOfMapStringToString;
+ }
+ if (other.isSetListOfMapI32ToString()) {
+ List<Map<Integer,String>> __this__listOfMapI32ToString = new
ArrayList<Map<Integer,String>>();
+ for (Map<Integer,String> other_element : other.listOfMapI32ToString)
{
+ Map<Integer,String> __this__listOfMapI32ToString_copy = new
HashMap<Integer,String>();
+ for (Map.Entry<Integer, String> other_element_element :
other_element.entrySet()) {
+
+ Integer other_element_element_key =
other_element_element.getKey();
+ String other_element_element_value =
other_element_element.getValue();
+
+ Integer __this__listOfMapI32ToString_copy_copy_key =
other_element_element_key;
+
+ String __this__listOfMapI32ToString_copy_copy_value =
other_element_element_value;
+
+
__this__listOfMapI32ToString_copy.put(__this__listOfMapI32ToString_copy_copy_key,
__this__listOfMapI32ToString_copy_copy_value);
+ }
+
__this__listOfMapI32ToString.add(__this__listOfMapI32ToString_copy);
+ }
+ this.listOfMapI32ToString = __this__listOfMapI32ToString;
+ }
+ if (other.isSetListOfMapStringToI32()) {
+ List<Map<String,Integer>> __this__listOfMapStringToI32 = new
ArrayList<Map<String,Integer>>();
+ for (Map<String,Integer> other_element : other.listOfMapStringToI32)
{
+ Map<String,Integer> __this__listOfMapStringToI32_copy = new
HashMap<String,Integer>();
+ for (Map.Entry<String, Integer> other_element_element :
other_element.entrySet()) {
+
+ String other_element_element_key =
other_element_element.getKey();
+ Integer other_element_element_value =
other_element_element.getValue();
+
+ String __this__listOfMapStringToI32_copy_copy_key =
other_element_element_key;
+
+ Integer __this__listOfMapStringToI32_copy_copy_value =
other_element_element_value;
+
+
__this__listOfMapStringToI32_copy.put(__this__listOfMapStringToI32_copy_copy_key,
__this__listOfMapStringToI32_copy_copy_value);
+ }
+
__this__listOfMapStringToI32.add(__this__listOfMapStringToI32_copy);
+ }
+ this.listOfMapStringToI32 = __this__listOfMapStringToI32;
+ }
+ if (other.isSetMapOfMapI32ToI32()) {
+ Map<String,Map<Integer,Integer>> __this__mapOfMapI32ToI32 = new
HashMap<String,Map<Integer,Integer>>();
+ for (Map.Entry<String, Map<Integer,Integer>> other_element :
other.mapOfMapI32ToI32.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ Map<Integer,Integer> other_element_value =
other_element.getValue();
+
+ String __this__mapOfMapI32ToI32_copy_key = other_element_key;
+
+ Map<Integer,Integer> __this__mapOfMapI32ToI32_copy_value = new
HashMap<Integer,Integer>();
+ for (Map.Entry<Integer, Integer> other_element_value_element :
other_element_value.entrySet()) {
+
+ Integer other_element_value_element_key =
other_element_value_element.getKey();
+ Integer other_element_value_element_value =
other_element_value_element.getValue();
+
+ Integer __this__mapOfMapI32ToI32_copy_value_copy_key =
other_element_value_element_key;
+
+ Integer __this__mapOfMapI32ToI32_copy_value_copy_value =
other_element_value_element_value;
+
+
__this__mapOfMapI32ToI32_copy_value.put(__this__mapOfMapI32ToI32_copy_value_copy_key,
__this__mapOfMapI32ToI32_copy_value_copy_value);
+ }
+
+ __this__mapOfMapI32ToI32.put(__this__mapOfMapI32ToI32_copy_key,
__this__mapOfMapI32ToI32_copy_value);
+ }
+ this.mapOfMapI32ToI32 = __this__mapOfMapI32ToI32;
+ }
+ if (other.isSetMapOfMapStringToString()) {
+ Map<String,Map<String,String>> __this__mapOfMapStringToString = new
HashMap<String,Map<String,String>>();
+ for (Map.Entry<String, Map<String,String>> other_element :
other.mapOfMapStringToString.entrySet()) {
+
+ String other_element_key = other_element.getKey();
+ Map<String,String> other_element_value = other_element.getValue();
+
+ String __this__mapOfMapStringToString_copy_key = other_element_key;
+
+ Map<String,String> __this__mapOfMapStringToString_copy_value = new
HashMap<String,String>();
+ for (Map.Entry<String, String> other_element_value_element :
other_element_value.entrySet()) {
+
+ String other_element_value_element_key =
other_element_value_element.getKey();
+ String other_element_value_element_value =
other_element_value_element.getValue();
+
+ String __this__mapOfMapStringToString_copy_value_copy_key =
other_element_value_element_key;
+
+ String __this__mapOfMapStringToString_copy_value_copy_value =
other_element_value_element_value;
+
+
__this__mapOfMapStringToString_copy_value.put(__this__mapOfMapStringToString_copy_value_copy_key,
__this__mapOfMapStringToString_copy_value_copy_value);
+ }
+
+
__this__mapOfMapStringToString.put(__this__mapOfMapStringToString_copy_key,
__this__mapOfMapStringToString_copy_value);
+ }
+ this.mapOfMapStringToString = __this__mapOfMapStringToString;
+ }
}

@Override
@@ -249,6 +410,158 @@
public boolean isSetMapOfIntToInt() {
return this.mapOfIntToInt != null;
}
+
+ public int getListOfMapStringToStringSize() {
+ return (this.listOfMapStringToString == null) ? 0 :
this.listOfMapStringToString.size();
+ }
+
+ public java.util.Iterator<Map<String,String>>
getListOfMapStringToStringIterator() {
+ return (this.listOfMapStringToString == null) ? null :
this.listOfMapStringToString.iterator();
+ }
+
+ public void addToListOfMapStringToString(Map<String,String> elem) {
+ if (this.listOfMapStringToString == null) {
+ this.listOfMapStringToString = new ArrayList<Map<String,String>>();
+ }
+ this.listOfMapStringToString.add(elem);
+ }
+
+ public List<Map<String,String>> getListOfMapStringToString() {
+ return this.listOfMapStringToString;
+ }
+
+ public void setListOfMapStringToString(List<Map<String,String>>
listOfMapStringToString) {
+ this.listOfMapStringToString = listOfMapStringToString;
+ }
+
+ public void unsetListOfMapStringToString() {
+ this.listOfMapStringToString = null;
+ }
+
+ // Returns true if field listOfMapStringToString is set (has been
asigned a value) and false otherwise
+ public boolean isSetListOfMapStringToString() {
+ return this.listOfMapStringToString != null;
+ }
+
+ public int getListOfMapI32ToStringSize() {
+ return (this.listOfMapI32ToString == null) ? 0 :
this.listOfMapI32ToString.size();
+ }
+
+ public java.util.Iterator<Map<Integer,String>>
getListOfMapI32ToStringIterator() {
+ return (this.listOfMapI32ToString == null) ? null :
this.listOfMapI32ToString.iterator();
+ }
+
+ public void addToListOfMapI32ToString(Map<Integer,String> elem) {
+ if (this.listOfMapI32ToString == null) {
+ this.listOfMapI32ToString = new ArrayList<Map<Integer,String>>();
+ }
+ this.listOfMapI32ToString.add(elem);
+ }
+
+ public List<Map<Integer,String>> getListOfMapI32ToString() {
+ return this.listOfMapI32ToString;
+ }
+
+ public void setListOfMapI32ToString(List<Map<Integer,String>>
listOfMapI32ToString) {
+ this.listOfMapI32ToString = listOfMapI32ToString;
+ }
+
+ public void unsetListOfMapI32ToString() {
+ this.listOfMapI32ToString = null;
+ }
+
+ // Returns true if field listOfMapI32ToString is set (has been asigned a
value) and false otherwise
+ public boolean isSetListOfMapI32ToString() {
+ return this.listOfMapI32ToString != null;
+ }
+
+ public int getListOfMapStringToI32Size() {
+ return (this.listOfMapStringToI32 == null) ? 0 :
this.listOfMapStringToI32.size();
+ }
+
+ public java.util.Iterator<Map<String,Integer>>
getListOfMapStringToI32Iterator() {
+ return (this.listOfMapStringToI32 == null) ? null :
this.listOfMapStringToI32.iterator();
+ }
+
+ public void addToListOfMapStringToI32(Map<String,Integer> elem) {
+ if (this.listOfMapStringToI32 == null) {
+ this.listOfMapStringToI32 = new ArrayList<Map<String,Integer>>();
+ }
+ this.listOfMapStringToI32.add(elem);
+ }
+
+ public List<Map<String,Integer>> getListOfMapStringToI32() {
+ return this.listOfMapStringToI32;
+ }
+
+ public void setListOfMapStringToI32(List<Map<String,Integer>>
listOfMapStringToI32) {
+ this.listOfMapStringToI32 = listOfMapStringToI32;
+ }
+
+ public void unsetListOfMapStringToI32() {
+ this.listOfMapStringToI32 = null;
+ }
+
+ // Returns true if field listOfMapStringToI32 is set (has been asigned a
value) and false otherwise
+ public boolean isSetListOfMapStringToI32() {
+ return this.listOfMapStringToI32 != null;
+ }
+
+ public int getMapOfMapI32ToI32Size() {
+ return (this.mapOfMapI32ToI32 == null) ? 0 :
this.mapOfMapI32ToI32.size();
+ }
+
+ public void putToMapOfMapI32ToI32(String key, Map<Integer,Integer> val) {
+ if (this.mapOfMapI32ToI32 == null) {
+ this.mapOfMapI32ToI32 = new HashMap<String,Map<Integer,Integer>>();
+ }
+ this.mapOfMapI32ToI32.put(key, val);
+ }
+
+ public Map<String,Map<Integer,Integer>> getMapOfMapI32ToI32() {
+ return this.mapOfMapI32ToI32;
+ }
+
+ public void setMapOfMapI32ToI32(Map<String,Map<Integer,Integer>>
mapOfMapI32ToI32) {
+ this.mapOfMapI32ToI32 = mapOfMapI32ToI32;
+ }
+
+ public void unsetMapOfMapI32ToI32() {
+ this.mapOfMapI32ToI32 = null;
+ }
+
+ // Returns true if field mapOfMapI32ToI32 is set (has been asigned a
value) and false otherwise
+ public boolean isSetMapOfMapI32ToI32() {
+ return this.mapOfMapI32ToI32 != null;
+ }
+
+ public int getMapOfMapStringToStringSize() {
+ return (this.mapOfMapStringToString == null) ? 0 :
this.mapOfMapStringToString.size();
+ }
+
+ public void putToMapOfMapStringToString(String key, Map<String,String>
val) {
+ if (this.mapOfMapStringToString == null) {
+ this.mapOfMapStringToString = new
HashMap<String,Map<String,String>>();
+ }
+ this.mapOfMapStringToString.put(key, val);
+ }
+
+ public Map<String,Map<String,String>> getMapOfMapStringToString() {
+ return this.mapOfMapStringToString;
+ }
+
+ public void setMapOfMapStringToString(Map<String,Map<String,String>>
mapOfMapStringToString) {
+ this.mapOfMapStringToString = mapOfMapStringToString;
+ }
+
+ public void unsetMapOfMapStringToString() {
+ this.mapOfMapStringToString = null;
+ }
+
+ // Returns true if field mapOfMapStringToString is set (has been asigned
a value) and false otherwise
+ public boolean isSetMapOfMapStringToString() {
+ return this.mapOfMapStringToString != null;
+ }

public void setFieldValue(int fieldID, Object value) {
switch (fieldID) {
@@ -284,6 +597,46 @@
}
break;

+ case LISTOFMAPSTRINGTOSTRING:
+ if (value == null) {
+ unsetListOfMapStringToString();
+ } else {
+ setListOfMapStringToString((List<Map<String,String>>)value);
+ }
+ break;
+
+ case LISTOFMAPI32TOSTRING:
+ if (value == null) {
+ unsetListOfMapI32ToString();
+ } else {
+ setListOfMapI32ToString((List<Map<Integer,String>>)value);
+ }
+ break;
+
+ case LISTOFMAPSTRINGTOI32:
+ if (value == null) {
+ unsetListOfMapStringToI32();
+ } else {
+ setListOfMapStringToI32((List<Map<String,Integer>>)value);
+ }
+ break;
+
+ case MAPOFMAPI32TOI32:
+ if (value == null) {
+ unsetMapOfMapI32ToI32();
+ } else {
+ setMapOfMapI32ToI32((Map<String,Map<Integer,Integer>>)value);
+ }
+ break;
+
+ case MAPOFMAPSTRINGTOSTRING:
+ if (value == null) {
+ unsetMapOfMapStringToString();
+ } else {
+ setMapOfMapStringToString((Map<String,Map<String,String>>)value);
+ }
+ break;
+
default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't
exist!");
}
@@ -303,6 +656,21 @@
case MAPOFINTTOINT:
return getMapOfIntToInt();

+ case LISTOFMAPSTRINGTOSTRING:
+ return getListOfMapStringToString();
+
+ case LISTOFMAPI32TOSTRING:
+ return getListOfMapI32ToString();
+
+ case LISTOFMAPSTRINGTOI32:
+ return getListOfMapStringToI32();
+
+ case MAPOFMAPI32TOI32:
+ return getMapOfMapI32ToI32();
+
+ case MAPOFMAPSTRINGTOSTRING:
+ return getMapOfMapStringToString();
+
default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't
exist!");
}
@@ -319,6 +687,16 @@
return isSetListOfStrings();
case MAPOFINTTOINT:
return isSetMapOfIntToInt();
+ case LISTOFMAPSTRINGTOSTRING:
+ return isSetListOfMapStringToString();
+ case LISTOFMAPI32TOSTRING:
+ return isSetListOfMapI32ToString();
+ case LISTOFMAPSTRINGTOI32:
+ return isSetListOfMapStringToI32();
+ case MAPOFMAPI32TOI32:
+ return isSetMapOfMapI32ToI32();
+ case MAPOFMAPSTRINGTOSTRING:
+ return isSetMapOfMapStringToString();
default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't
exist!");
}
@@ -372,6 +750,51 @@
if (!this.mapOfIntToInt.equals(that.mapOfIntToInt))
return false;
}
+
+ boolean this_present_listOfMapStringToString = true &&
this.isSetListOfMapStringToString();
+ boolean that_present_listOfMapStringToString = true &&
that.isSetListOfMapStringToString();
+ if (this_present_listOfMapStringToString ||
that_present_listOfMapStringToString) {
+ if (!(this_present_listOfMapStringToString &&
that_present_listOfMapStringToString))
+ return false;
+ if
(!this.listOfMapStringToString.equals(that.listOfMapStringToString))
+ return false;
+ }
+
+ boolean this_present_listOfMapI32ToString = true &&
this.isSetListOfMapI32ToString();
+ boolean that_present_listOfMapI32ToString = true &&
that.isSetListOfMapI32ToString();
+ if (this_present_listOfMapI32ToString ||
that_present_listOfMapI32ToString) {
+ if (!(this_present_listOfMapI32ToString &&
that_present_listOfMapI32ToString))
+ return false;
+ if (!this.listOfMapI32ToString.equals(that.listOfMapI32ToString))
+ return false;
+ }
+
+ boolean this_present_listOfMapStringToI32 = true &&
this.isSetListOfMapStringToI32();
+ boolean that_present_listOfMapStringToI32 = true &&
that.isSetListOfMapStringToI32();
+ if (this_present_listOfMapStringToI32 ||
that_present_listOfMapStringToI32) {
+ if (!(this_present_listOfMapStringToI32 &&
that_present_listOfMapStringToI32))
+ return false;
+ if (!this.listOfMapStringToI32.equals(that.listOfMapStringToI32))
+ return false;
+ }
+
+ boolean this_present_mapOfMapI32ToI32 = true &&
this.isSetMapOfMapI32ToI32();
+ boolean that_present_mapOfMapI32ToI32 = true &&
that.isSetMapOfMapI32ToI32();
+ if (this_present_mapOfMapI32ToI32 || that_present_mapOfMapI32ToI32) {
+ if (!(this_present_mapOfMapI32ToI32 &&
that_present_mapOfMapI32ToI32))
+ return false;
+ if (!this.mapOfMapI32ToI32.equals(that.mapOfMapI32ToI32))
+ return false;
+ }
+
+ boolean this_present_mapOfMapStringToString = true &&
this.isSetMapOfMapStringToString();
+ boolean that_present_mapOfMapStringToString = true &&
that.isSetMapOfMapStringToString();
+ if (this_present_mapOfMapStringToString ||
that_present_mapOfMapStringToString) {
+ if (!(this_present_mapOfMapStringToString &&
that_present_mapOfMapStringToString))
+ return false;
+ if (!this.mapOfMapStringToString.equals(that.mapOfMapStringToString))
+ return false;
+ }

return true;
}
@@ -458,6 +881,155 @@
_val13 = iprot.readI32();
this.mapOfIntToInt.put(_key12, _val13);
}
+ iprot.readMapEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case LISTOFMAPSTRINGTOSTRING:
+ if (field.type == TType.LIST) {
+ {
+ TList _list14 = iprot.readListBegin();
+ this.listOfMapStringToString = new
ArrayList<Map<String,String>>(_list14.size);
+ for (int _i15 = 0; _i15 < _list14.size; ++_i15)
+ {
+ Map<String,String> _elem16;
+ {
+ TMap _map17 = iprot.readMapBegin();
+ _elem16 = new HashMap<String,String>(2*_map17.size);
+ for (int _i18 = 0; _i18 < _map17.size; ++_i18)
+ {
+ String _key19;
+ String _val20;
+ _key19 = iprot.readString();
+ _val20 = iprot.readString();
+ _elem16.put(_key19, _val20);
+ }
+ iprot.readMapEnd();
+ }
+ this.listOfMapStringToString.add(_elem16);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case LISTOFMAPI32TOSTRING:
+ if (field.type == TType.LIST) {
+ {
+ TList _list21 = iprot.readListBegin();
+ this.listOfMapI32ToString = new
ArrayList<Map<Integer,String>>(_list21.size);
+ for (int _i22 = 0; _i22 < _list21.size; ++_i22)
+ {
+ Map<Integer,String> _elem23;
+ {
+ TMap _map24 = iprot.readMapBegin();
+ _elem23 = new HashMap<Integer,String>(2*_map24.size);
+ for (int _i25 = 0; _i25 < _map24.size; ++_i25)
+ {
+ int _key26;
+ String _val27;
+ _key26 = iprot.readI32();
+ _val27 = iprot.readString();
+ _elem23.put(_key26, _val27);
+ }
+ iprot.readMapEnd();
+ }
+ this.listOfMapI32ToString.add(_elem23);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case LISTOFMAPSTRINGTOI32:
+ if (field.type == TType.LIST) {
+ {
+ TList _list28 = iprot.readListBegin();
+ this.listOfMapStringToI32 = new
ArrayList<Map<String,Integer>>(_list28.size);
+ for (int _i29 = 0; _i29 < _list28.size; ++_i29)
+ {
+ Map<String,Integer> _elem30;
+ {
+ TMap _map31 = iprot.readMapBegin();
+ _elem30 = new HashMap<String,Integer>(2*_map31.size);
+ for (int _i32 = 0; _i32 < _map31.size; ++_i32)
+ {
+ String _key33;
+ int _val34;
+ _key33 = iprot.readString();
+ _val34 = iprot.readI32();
+ _elem30.put(_key33, _val34);
+ }
+ iprot.readMapEnd();
+ }
+ this.listOfMapStringToI32.add(_elem30);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case MAPOFMAPI32TOI32:
+ if (field.type == TType.MAP) {
+ {
+ TMap _map35 = iprot.readMapBegin();
+ this.mapOfMapI32ToI32 = new
HashMap<String,Map<Integer,Integer>>(2*_map35.size);
+ for (int _i36 = 0; _i36 < _map35.size; ++_i36)
+ {
+ String _key37;
+ Map<Integer,Integer> _val38;
+ _key37 = iprot.readString();
+ {
+ TMap _map39 = iprot.readMapBegin();
+ _val38 = new HashMap<Integer,Integer>(2*_map39.size);
+ for (int _i40 = 0; _i40 < _map39.size; ++_i40)
+ {
+ int _key41;
+ int _val42;
+ _key41 = iprot.readI32();
+ _val42 = iprot.readI32();
+ _val38.put(_key41, _val42);
+ }
+ iprot.readMapEnd();
+ }
+ this.mapOfMapI32ToI32.put(_key37, _val38);
+ }
+ iprot.readMapEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case MAPOFMAPSTRINGTOSTRING:
+ if (field.type == TType.MAP) {
+ {
+ TMap _map43 = iprot.readMapBegin();
+ this.mapOfMapStringToString = new
HashMap<String,Map<String,String>>(2*_map43.size);
+ for (int _i44 = 0; _i44 < _map43.size; ++_i44)
+ {
+ String _key45;
+ Map<String,String> _val46;
+ _key45 = iprot.readString();
+ {
+ TMap _map47 = iprot.readMapBegin();
+ _val46 = new HashMap<String,String>(2*_map47.size);
+ for (int _i48 = 0; _i48 < _map47.size; ++_i48)
+ {
+ String _key49;
+ String _val50;
+ _key49 = iprot.readString();
+ _val50 = iprot.readString();
+ _val46.put(_key49, _val50);
+ }
+ iprot.readMapEnd();
+ }
+ this.mapOfMapStringToString.put(_key45, _val46);
+ }
iprot.readMapEnd();
}
} else {
@@ -483,9 +1055,9 @@
oprot.writeFieldBegin(MAP_STRING_TO_STRING_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING,
this.mapStringToString.size()));
- for (Map.Entry<String, String> _iter14 :
this.mapStringToString.entrySet()) {
- oprot.writeString(_iter14.getKey());
- oprot.writeString(_iter14.getValue());
+ for (Map.Entry<String, String> _iter51 :
this.mapStringToString.entrySet()) {
+ oprot.writeString(_iter51.getKey());
+ oprot.writeString(_iter51.getValue());
}
oprot.writeMapEnd();
}
@@ -495,8 +1067,8 @@
oprot.writeFieldBegin(SET_OF_STRINGS_FIELD_DESC);
{
oprot.writeSetBegin(new TSet(TType.STRING,
this.setOfStrings.size()));
- for (String _iter15 : this.setOfStrings) {
- oprot.writeString(_iter15);
+ for (String _iter52 : this.setOfStrings) {
+ oprot.writeString(_iter52);
}
oprot.writeSetEnd();
}
@@ -506,8 +1078,8 @@
oprot.writeFieldBegin(LIST_OF_STRINGS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING,
this.listOfStrings.size()));
- for (String _iter16 : this.listOfStrings) {
- oprot.writeString(_iter16);
+ for (String _iter53 : this.listOfStrings) {
+ oprot.writeString(_iter53);
}
oprot.writeListEnd();
}
@@ -517,9 +1089,101 @@
oprot.writeFieldBegin(MAP_OF_INT_TO_INT_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.I32, TType.I32,
this.mapOfIntToInt.size()));
- for (Map.Entry<Integer, Integer> _iter17 :
this.mapOfIntToInt.entrySet()) {
- oprot.writeI32(_iter17.getKey());
- oprot.writeI32(_iter17.getValue());
+ for (Map.Entry<Integer, Integer> _iter54 :
this.mapOfIntToInt.entrySet()) {
+ oprot.writeI32(_iter54.getKey());
+ oprot.writeI32(_iter54.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.listOfMapStringToString != null) {
+ oprot.writeFieldBegin(LIST_OF_MAP_STRING_TO_STRING_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.MAP,
this.listOfMapStringToString.size()));
+ for (Map<String,String> _iter55 :
this.listOfMapStringToString) {
+ {
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING,
_iter55.size()));
+ for (Map.Entry<String, String> _iter56 :
_iter55.entrySet()) {
+ oprot.writeString(_iter56.getKey());
+ oprot.writeString(_iter56.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.listOfMapI32ToString != null) {
+ oprot.writeFieldBegin(LIST_OF_MAP_I32_TO_STRING_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.MAP,
this.listOfMapI32ToString.size()));
+ for (Map<Integer,String> _iter57 :
this.listOfMapI32ToString) {
+ {
+ oprot.writeMapBegin(new TMap(TType.I32, TType.STRING,
_iter57.size()));
+ for (Map.Entry<Integer, String> _iter58 :
_iter57.entrySet()) {
+ oprot.writeI32(_iter58.getKey());
+ oprot.writeString(_iter58.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.listOfMapStringToI32 != null) {
+ oprot.writeFieldBegin(LIST_OF_MAP_STRING_TO_I32_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.MAP,
this.listOfMapStringToI32.size()));
+ for (Map<String,Integer> _iter59 :
this.listOfMapStringToI32) {
+ {
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.I32,
_iter59.size()));
+ for (Map.Entry<String, Integer> _iter60 :
_iter59.entrySet()) {
+ oprot.writeString(_iter60.getKey());
+ oprot.writeI32(_iter60.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.mapOfMapI32ToI32 != null) {
+ oprot.writeFieldBegin(MAP_OF_MAP_I32_TO_I32_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.MAP,
this.mapOfMapI32ToI32.size()));
+ for (Map.Entry<String, Map<Integer,Integer>> _iter61 :
this.mapOfMapI32ToI32.entrySet()) {
+ oprot.writeString(_iter61.getKey());
+ {
+ oprot.writeMapBegin(new TMap(TType.I32, TType.I32,
_iter61.getValue().size()));
+ for (Map.Entry<Integer, Integer> _iter62 :
_iter61.getValue().entrySet()) {
+ oprot.writeI32(_iter62.getKey());
+ oprot.writeI32(_iter62.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (this.mapOfMapStringToString != null) {
+ oprot.writeFieldBegin(MAP_OF_MAP_STRING_TO_STRING_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.MAP,
this.mapOfMapStringToString.size()));
+ for (Map.Entry<String, Map<String,String>> _iter63 :
this.mapOfMapStringToString.entrySet()) {
+ oprot.writeString(_iter63.getKey());
+ {
+ oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING,
_iter63.getValue().size()));
+ for (Map.Entry<String, String> _iter64 :
_iter63.getValue().entrySet()) {
+ oprot.writeString(_iter64.getKey());
+ oprot.writeString(_iter64.getValue());
+ }
+ oprot.writeMapEnd();
+ }
}
oprot.writeMapEnd();
}
@@ -564,6 +1228,46 @@
} else {
sb.append(this.mapOfIntToInt);
}
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("listOfMapStringToString:");
+ if (this.listOfMapStringToString == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.listOfMapStringToString);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("listOfMapI32ToString:");
+ if (this.listOfMapI32ToString == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.listOfMapI32ToString);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("listOfMapStringToI32:");
+ if (this.listOfMapStringToI32 == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.listOfMapStringToI32);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mapOfMapI32ToI32:");
+ if (this.mapOfMapI32ToI32 == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mapOfMapI32ToI32);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("mapOfMapStringToString:");
+ if (this.mapOfMapStringToString == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.mapOfMapStringToString);
+ }
first = false;
sb.append(")");
return sb.toString();
=======================================
---
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithEnum.java
Tue Nov 3 15:45:07 2009
+++
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/ObjectWithEnum.java
Wed Apr 28 15:56:15 2010
@@ -380,13 +380,13 @@
case ENUMSET:
if (field.type == TType.SET) {
{
- TSet _set18 = iprot.readSetBegin();
- this.enumSet = new HashSet<Integer>(2*_set18.size);
- for (int _i19 = 0; _i19 < _set18.size; ++_i19)
- {
- int _elem20;
- _elem20 = iprot.readI32();
- this.enumSet.add(_elem20);
+ TSet _set65 = iprot.readSetBegin();
+ this.enumSet = new HashSet<Integer>(2*_set65.size);
+ for (int _i66 = 0; _i66 < _set65.size; ++_i66)
+ {
+ int _elem67;
+ _elem67 = iprot.readI32();
+ this.enumSet.add(_elem67);
}
iprot.readSetEnd();
}
@@ -397,15 +397,15 @@
case ENUMMAP:
if (field.type == TType.MAP) {
{
- TMap _map21 = iprot.readMapBegin();
- this.enumMap = new HashMap<Integer,Integer>(2*_map21.size);
- for (int _i22 = 0; _i22 < _map21.size; ++_i22)
- {
- int _key23;
- int _val24;
- _key23 = iprot.readI32();
- _val24 = iprot.readI32();
- this.enumMap.put(_key23, _val24);
+ TMap _map68 = iprot.readMapBegin();
+ this.enumMap = new HashMap<Integer,Integer>(2*_map68.size);
+ for (int _i69 = 0; _i69 < _map68.size; ++_i69)
+ {
+ int _key70;
+ int _val71;
+ _key70 = iprot.readI32();
+ _val71 = iprot.readI32();
+ this.enumMap.put(_key70, _val71);
}
iprot.readMapEnd();
}
@@ -416,13 +416,13 @@
case ENUMLIST:
if (field.type == TType.LIST) {
{
- TList _list25 = iprot.readListBegin();
- this.enumList = new ArrayList<Integer>(_list25.size);
- for (int _i26 = 0; _i26 < _list25.size; ++_i26)
- {
- int _elem27;
- _elem27 = iprot.readI32();
- this.enumList.add(_elem27);
+ TList _list72 = iprot.readListBegin();
+ this.enumList = new ArrayList<Integer>(_list72.size);
+ for (int _i73 = 0; _i73 < _list72.size; ++_i73)
+ {
+ int _elem74;
+ _elem74 = iprot.readI32();
+ this.enumList.add(_elem74);
}
iprot.readListEnd();
}
@@ -452,8 +452,8 @@
oprot.writeFieldBegin(ENUM_SET_FIELD_DESC);
{
oprot.writeSetBegin(new TSet(TType.I32, this.enumSet.size()));
- for (int _iter28 : this.enumSet) {
- oprot.writeI32(_iter28);
+ for (int _iter75 : this.enumSet) {
+ oprot.writeI32(_iter75);
}
oprot.writeSetEnd();
}
@@ -463,9 +463,9 @@
oprot.writeFieldBegin(ENUM_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.I32, TType.I32,
this.enumMap.size()));
- for (Map.Entry<Integer, Integer> _iter29 :
this.enumMap.entrySet()) {
- oprot.writeI32(_iter29.getKey());
- oprot.writeI32(_iter29.getValue());
+ for (Map.Entry<Integer, Integer> _iter76 :
this.enumMap.entrySet()) {
+ oprot.writeI32(_iter76.getKey());
+ oprot.writeI32(_iter76.getValue());
}
oprot.writeMapEnd();
}
@@ -475,8 +475,8 @@
oprot.writeFieldBegin(ENUM_LIST_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.I32, this.enumList.size()));
- for (int _iter30 : this.enumList) {
- oprot.writeI32(_iter30);
+ for (int _iter77 : this.enumList) {
+ oprot.writeI32(_iter77);
}
oprot.writeListEnd();
}
=======================================
---
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/TortureTestApi.java
Tue Mar 23 20:33:15 2010
+++
/trunk/gwt-rpc-plus/example/gen-javabean/com/dotspots/rpcplus/example/torturetest/TortureTestApi.java
Wed Apr 28 15:56:15 2010
@@ -4157,13 +4157,13 @@
case SUCCESS:
if (field.type == TType.SET) {
{
- TSet _set31 = iprot.readSetBegin();
- this.success = new HashSet<String>(2*_set31.size);
- for (int _i32 = 0; _i32 < _set31.size; ++_i32)
- {
- String _elem33;
- _elem33 = iprot.readString();
- this.success.add(_elem33);
+ TSet _set78 = iprot.readSetBegin();
+ this.success = new HashSet<String>(2*_set78.size);
+ for (int _i79 = 0; _i79 < _set78.size; ++_i79)
+ {
+ String _elem80;
+ _elem80 = iprot.readString();
+ this.success.add(_elem80);
}
iprot.readSetEnd();
}
@@ -4189,8 +4189,8 @@
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeSetBegin(new TSet(TType.STRING, this.success.size()));
- for (String _iter34 : this.success) {
- oprot.writeString(_iter34);
+ for (String _iter81 : this.success) {
+ oprot.writeString(_iter81);
}
oprot.writeSetEnd();
}
@@ -4496,13 +4496,13 @@
case SUCCESS:
if (field.type == TType.SET) {
{
- TSet _set35 = iprot.readSetBegin();
- this.success = new HashSet<Integer>(2*_set35.size);
- for (int _i36 = 0; _i36 < _set35.size; ++_i36)
- {
- int _elem37;
- _elem37 = iprot.readI32();
- this.success.add(_elem37);
+ TSet _set82 = iprot.readSetBegin();
+ this.success = new HashSet<Integer>(2*_set82.size);
+ for (int _i83 = 0; _i83 < _set82.size; ++_i83)
+ {
+ int _elem84;
+ _elem84 = iprot.readI32();
+ this.success.add(_elem84);
}
iprot.readSetEnd();
}
@@ -4528,8 +4528,8 @@
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeSetBegin(new TSet(TType.I32, this.success.size()));
- for (int _iter38 : this.success) {
- oprot.writeI32(_iter38);
+ for (int _iter85 : this.success) {
+ oprot.writeI32(_iter85);
}
oprot.writeSetEnd();
}
@@ -4840,15 +4840,15 @@
case SUCCESS:
if (field.type == TType.MAP) {
{
- TMap _map39 = iprot.readMapBegin();
- this.success = new HashMap<String,String>(2*_map39.size);
- for (int _i40 = 0; _i40 < _map39.size; ++_i40)
- {
- String _key41;
- String _val42;
- _key41 = iprot.readString();
- _val42 = iprot.readString();
- this.success.put(_key41, _val42);
+ TMap _map86 = iprot.readMapBegin();
+ this.success = new HashMap<String,String>(2*_map86.size);
+ for (int _i87 = 0; _i87 < _map86.size; ++_i87)
+ {
+ String _key88;
+ String _val89;
+ _key88 = iprot.readString();
+ _val89 = iprot.readString();
+ this.success.put(_key88, _val89);
}
iprot.readMapEnd();
}
@@ -4874,9 +4874,9 @@
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING,
this.success.size()));
- for (Map.Entry<String, String> _iter43 :
this.success.entrySet()) {
- oprot.writeString(_iter43.getKey());
- oprot.writeString(_iter43.getValue());
+ for (Map.Entry<String, String> _iter90 :
this.success.entrySet()) {
+ oprot.writeString(_iter90.getKey());
+ oprot.writeString(_iter90.getValue());
}
oprot.writeMapEnd();
}
=======================================
---
/trunk/gwt-rpc-plus/example/gen-json-server/com/dotspots/rpcplus/example/torturetest/TortureTestApiJson.java
Tue Mar 23 20:33:15 2010
+++
/trunk/gwt-rpc-plus/example/gen-json-server/com/dotspots/rpcplus/example/torturetest/TortureTestApiJson.java
Wed Apr 28 15:56:15 2010
@@ -1352,6 +1352,108 @@
obj.setMapOfIntToInt(value0);
break;
}
+ case 4: {
+ List<Map<String, String>> value0 = null;
+ if (protocol.readListBegin()) {
+ value0 = new ArrayList<Map<String, String>>();
+ while (protocol.hasNext()) {
+ Map<String, String> value1 = null;
+ if (protocol.readMapBegin()) {
+ value1 = new HashMap<String, String>();
+ while (protocol.hasNext()) {
+ String key2 = protocol.readString();
+ String value2 = protocol.readString();
+ value1.put(key2, value2);
+ }
+ }
+ value0.add(value1);
+ }
+ }
+ obj.setListOfMapStringToString(value0);
+ break;
+ }
+ case 5: {
+ List<Map<Integer, String>> value0 = null;
+ if (protocol.readListBegin()) {
+ value0 = new ArrayList<Map<Integer, String>>();
+ while (protocol.hasNext()) {
+ Map<Integer, String> value1 = null;
+ if (protocol.readMapBegin()) {
+ value1 = new HashMap<Integer, String>();
+ while (protocol.hasNext()) {
+ int key2 = protocol.readI32();
+ String value2 = protocol.readString();
+ value1.put(key2, value2);
+ }
+ }
+ value0.add(value1);
+ }
+ }
+ obj.setListOfMapI32ToString(value0);
+ break;
+ }
+ case 6: {
+ List<Map<String, Integer>> value0 = null;
+ if (protocol.readListBegin()) {
+ value0 = new ArrayList<Map<String, Integer>>();
+ while (protocol.hasNext()) {
+ Map<String, Integer> value1 = null;
+ if (protocol.readMapBegin()) {
+ value1 = new HashMap<String, Integer>();
+ while (protocol.hasNext()) {
+ String key2 = protocol.readString();
+ int value2 = protocol.readI32();
+ value1.put(key2, value2);
+ }
+ }
+ value0.add(value1);
+ }
+ }
+ obj.setListOfMapStringToI32(value0);
+ break;
+ }
+ case 7: {
+ Map<String, Map<Integer, Integer>> value0 = null;
+ if (protocol.readMapBegin()) {
+ value0 = new HashMap<String, Map<Integer,
Integer>>();
+ while (protocol.hasNext()) {
+ String key1 = protocol.readString();
+ Map<Integer, Integer> value1 = null;
+ if (protocol.readMapBegin()) {
+ value1 = new HashMap<Integer, Integer>();
+ while (protocol.hasNext()) {
+ int key2 = protocol.readI32();
+ int value2 = protocol.readI32();
+ value1.put(key2, value2);
+ }
+ }
+ value0.put(key1, value1);
+ }
+ }
+ obj.setMapOfMapI32ToI32(value0);
+ break;
+ }
+ case 8: {
+ Map<String, Map<String, String>> value0 = null;
+ if (protocol.readMapBegin()) {
+ value0 = new HashMap<String, Map<String,
String>>();
+ while (protocol.hasNext()) {
+ String key1 = protocol.readString();
+ Map<String, String> value1 = null;
+ if (protocol.readMapBegin()) {
+ value1 = new HashMap<String, String>();
+ while (protocol.hasNext()) {
+ String key2 = protocol.readString();
+ String value2 = protocol.readString();
+ value1.put(key2, value2);
+ }
+ }
+ value0.put(key1, value1);
+ }
+ }
+ obj.setMapOfMapStringToString(value0);
+ break;
+ }
default:
protocol.skip();
}
@@ -1408,6 +1510,92 @@
}
protocol.writeMapEnd();
}
+ if (obj.isSetListOfMapStringToString()) {
+ protocol.writeI32(4);
+ List<Map<String, String>> value0 =
obj.getListOfMapStringToString();
+ protocol.writeListBegin(null);
+ for (Map<String, String> value1 : value0) {
+ protocol.writeMapBegin(null);
+ for (Map.Entry<String, String> entry1 : value1.entrySet())
{
+ String key2 = entry1.getKey();
+ String value2 = entry1.getValue();
+ protocol.writeString(key2);
+ protocol.writeString(value2);
+ }
+ protocol.writeMapEnd();
+ }
+ protocol.writeListEnd();
+ }
+ if (obj.isSetListOfMapI32ToString()) {
+ protocol.writeI32(5);
+ List<Map<Integer, String>> value0 =
obj.getListOfMapI32ToString();
+ protocol.writeListBegin(null);
+ for (Map<Integer, String> value1 : value0) {
+ protocol.writeMapBegin(null);
+ for (Map.Entry<Integer, String> entry1 :
value1.entrySet()) {
+ int key2 = entry1.getKey();
+ String value2 = entry1.getValue();
+ protocol.writeI32(key2);
+ protocol.writeString(value2);
+ }
+ protocol.writeMapEnd();
+ }
+ protocol.writeListEnd();
+ }
+ if (obj.isSetListOfMapStringToI32()) {
+ protocol.writeI32(6);
+ List<Map<String, Integer>> value0 =
obj.getListOfMapStringToI32();
+ protocol.writeListBegin(null);
+ for (Map<String, Integer> value1 : value0) {
+ protocol.writeMapBegin(null);
+ for (Map.Entry<String, Integer> entry1 :
value1.entrySet()) {
+ String key2 = entry1.getKey();
+ int value2 = entry1.getValue();
+ protocol.writeString(key2);
+ protocol.writeI32(value2);
+ }
+ protocol.writeMapEnd();
+ }
+ protocol.writeListEnd();
+ }
+ if (obj.isSetMapOfMapI32ToI32()) {
+ protocol.writeI32(7);
+ Map<String, Map<Integer, Integer>> value0 =
obj.getMapOfMapI32ToI32();
+ protocol.writeMapBegin(null);
+ for (Map.Entry<String, Map<Integer, Integer>> entry0 :
value0.entrySet()) {
+ String key1 = entry0.getKey();
+ Map<Integer, Integer> value1 = entry0.getValue();
+ protocol.writeString(key1);
+ protocol.writeMapBegin(null);
+ for (Map.Entry<Integer, Integer> entry1 :
value1.entrySet()) {
+ int key2 = entry1.getKey();
+ int value2 = entry1.getValue();
+ protocol.writeI32(key2);
+ protocol.writeI32(value2);
+ }
+ protocol.writeMapEnd();
+ }
+ protocol.writeMapEnd();
+ }
+ if (obj.isSetMapOfMapStringToString()) {
+ protocol.writeI32(8);
+ Map<String, Map<String, String>> value0 =
obj.getMapOfMapStringToString();
+ protocol.writeMapBegin(null);
+ for (Map.Entry<String, Map<String, String>> entry0 :
value0.entrySet()) {
+ String key1 = entry0.getKey();
+ Map<String, String> value1 = entry0.getValue();
+ protocol.writeString(key1);
+ protocol.writeMapBegin(null);
+ for (Map.Entry<String, String> entry1 : value1.entrySet())
{
+ String key2 = entry1.getKey();
+ String value2 = entry1.getValue();
+ protocol.writeString(key2);
+ protocol.writeString(value2);
+ }
+ protocol.writeMapEnd();
+ }
+ protocol.writeMapEnd();
+ }
protocol.writeStructEnd();
}

=======================================
---
/trunk/gwt-rpc-plus/example/server-example/com/dotspots/rpcplus/example/jsonrpc/thrift/ExampleService.java
Tue Mar 23 20:33:15 2010
+++
/trunk/gwt-rpc-plus/example/server-example/com/dotspots/rpcplus/example/jsonrpc/thrift/ExampleService.java
Wed Apr 28 15:56:15 2010
@@ -121,7 +121,7 @@
set.add("hi" + i);
}

- throw new MoreComplexException("Message!", new
ObjectWithComplexTypes(null, set, null, null));
+ throw new MoreComplexException("Message!", new
ObjectWithComplexTypes(null, set, null, null, null, null, null, null,
null));
}

public ContextOut __getContext() throws TException {
=======================================
--- /trunk/gwt-rpc-plus/example/torturetest.thrift Tue Mar 23 20:33:15 2010
+++ /trunk/gwt-rpc-plus/example/torturetest.thrift Wed Apr 28 15:56:15 2010
@@ -15,6 +15,11 @@
2: set<string> setOfStrings;
3: list<string> listOfStrings;
4: map<i32, i32> mapOfIntToInt;
+ 5: list<map<string, string>> listOfMapStringToString;
+ 6: list<map<i32, string>> listOfMapI32ToString;
+ 7: list<map<string, i32>> listOfMapStringToI32;
+ 8: map<string, map<i32, i32>> mapOfMapI32ToI32;
+ 9: map<string, map<string, string>> mapOfMapStringToString;
}

struct ObjectThatIsReferenced {
=======================================
---
/trunk/gwt-rpc-plus/test/gwt-test/com/dotspots/rpcplus/test/client/TestThriftCollections.java
Thu Jan 28 14:46:34 2010
+++
/trunk/gwt-rpc-plus/test/gwt-test/com/dotspots/rpcplus/test/client/TestThriftCollections.java
Wed Apr 28 15:56:15 2010
@@ -5,12 +5,17 @@
import com.dotspots.rpcplus.client.jscollections.JsRpcIntObjectProcedure;
import com.dotspots.rpcplus.client.jscollections.JsRpcList;
import com.dotspots.rpcplus.client.jscollections.JsRpcListBool;
+import com.dotspots.rpcplus.client.jscollections.JsRpcListDouble;
import com.dotspots.rpcplus.client.jscollections.JsRpcListInt;
import com.dotspots.rpcplus.client.jscollections.JsRpcListLong;
import com.dotspots.rpcplus.client.jscollections.JsRpcListString;
import com.dotspots.rpcplus.client.jscollections.JsRpcListUtils;
import com.dotspots.rpcplus.client.jscollections.JsRpcMapInt;
+import com.dotspots.rpcplus.client.jscollections.JsRpcMapIntBool;
+import com.dotspots.rpcplus.client.jscollections.JsRpcMapIntDouble;
+import com.dotspots.rpcplus.client.jscollections.JsRpcMapIntInt;
import com.dotspots.rpcplus.client.jscollections.JsRpcMapIntLong;
+import com.dotspots.rpcplus.client.jscollections.JsRpcMapIntString;
import com.dotspots.rpcplus.client.jscollections.JsRpcMapStringLong;
import com.dotspots.rpcplus.client.jscollections.JsRpcMapStringString;
import com.dotspots.rpcplus.client.jscollections.JsRpcSetString;
@@ -50,6 +55,24 @@

assertEquals(2, list.size());
}
+
+ public void testListDefaults() {
+ assertEquals(false, JsRpcListBool.create().get(0));
+ assertEquals(0, JsRpcListInt.create().get(0));
+ assertEquals(0L, JsRpcListLong.create().get(0));
+ assertEquals(0.0, JsRpcListDouble.create().get(0));
+ assertEquals(null, JsRpcListString.create().get(0));
+ assertEquals(null, JsRpcList.<JavaScriptObject> create().get(0));
+ }
+
+ public void testListPopDefaults() {
+ assertEquals(false, JsRpcListBool.create().pop());
+ assertEquals(0, JsRpcListInt.create().pop());
+ assertEquals(0L, JsRpcListLong.create().pop());
+ assertEquals(0.0, JsRpcListDouble.create().pop());
+ assertEquals(null, JsRpcListString.create().pop());
+ assertEquals(null, JsRpcList.<JavaScriptObject> create().pop());
+ }

public void testListSearch() {
JsRpcList<JavaScriptObject> list = JsRpcList.create();
@@ -184,6 +207,15 @@

assertEquals(2, map.countSize());
}
+
+ public void testMapDefaults() {
+ assertEquals(false, JsRpcMapIntBool.create().get(0));
+ assertEquals(0, JsRpcMapIntInt.create().get(0));
+ assertEquals(0L, JsRpcMapIntLong.create().get(0));
+ assertEquals(0.0, JsRpcMapIntDouble.create().get(0));
+ assertEquals(null, JsRpcMapIntString.create().get(0));
+ assertEquals(null, JsRpcMapInt.<JavaScriptObject> create().get(0));
+ }

public void testMapIntLong() {
JsRpcMapIntLong map = JsRpcMapIntLong.create();
Reply all
Reply to author
Forward
0 new messages