summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-12-09 19:10:20 +0000
committerMark Spruiell <mes@zeroc.com>2002-12-09 19:10:20 +0000
commit42a322482f6e862263407a7b806785fa6bc56d5a (patch)
tree7d917ae8e14bc95e6bd6bf87de5f5284c71cfc96 /cpp/src/slice2java/Gen.cpp
parentreverting to 1.19 revision - the AMI/AMD Glacier changes obviate the need (diff)
downloadice-42a322482f6e862263407a7b806785fa6bc56d5a.tar.bz2
ice-42a322482f6e862263407a7b806785fa6bc56d5a.tar.xz
ice-42a322482f6e862263407a7b806785fa6bc56d5a.zip
add null dictionary support for ice_marshal
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 6066e1d41b0..bc824ff94a6 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -2529,6 +2529,13 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p)
//
out << nl << "public static void" << nl << "ice_marshal(String __name, Ice.Stream __os, java.util.Map __v)";
out << sb;
+ out << nl << "if(__v == null)";
+ out << sb;
+ out << nl << "__os.startWriteDictionary(__name, 0);";
+ out << nl << "__os.endWriteDictionary();";
+ out << eb;
+ out << nl << "else";
+ out << sb;
out << nl << "__os.startWriteDictionary(__name, __v.size());";
out << nl << "java.util.Iterator __i = __v.entrySet().iterator();";
out << nl << "while(__i.hasNext())";
@@ -2619,6 +2626,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p)
out << eb;
out << nl << "__os.endWriteDictionary();";
out << eb;
+ out << eb;
//
// ice_unmarshal