summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-11-08 21:15:22 +0000
committerMark Spruiell <mes@zeroc.com>2004-11-08 21:15:22 +0000
commit3150dc46d45b9ffba435a03884cd4220991a1bf6 (patch)
tree19f7bc367fcc9349873d0baba4fad4779ad0bb95 /cpp/src
parentversion update (diff)
downloadice-3150dc46d45b9ffba435a03884cd4220991a1bf6.tar.bz2
ice-3150dc46d45b9ffba435a03884cd4220991a1bf6.tar.xz
ice-3150dc46d45b9ffba435a03884cd4220991a1bf6.zip
always generate stream read/write functions for class, exception
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2java/Gen.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 4761f56ad72..51c7306b713 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -1682,6 +1682,26 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "super.__read(__in, true);";
out << eb;
}
+ else
+ {
+ //
+ // Emit placeholder functions to catch errors.
+ //
+ string scoped = p->scoped();
+ out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __out)";
+ out << sb;
+ out << nl << "Ice.MarshalException ex = new Ice.MarshalException();";
+ out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";";
+ out << nl << "throw ex;";
+ out << eb;
+
+ out << sp << nl << "public void" << nl << "__read(Ice.InputStream __in, boolean __rid)";
+ out << sb;
+ out << nl << "Ice.MarshalException ex = new Ice.MarshalException();";
+ out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";";
+ out << nl << "throw ex;";
+ out << eb;
+ }
}
return true;
@@ -1932,6 +1952,26 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
}
out << eb;
}
+ else
+ {
+ //
+ // Emit placeholder functions to catch errors.
+ //
+ string scoped = p->scoped();
+ out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __out)";
+ out << sb;
+ out << nl << "Ice.MarshalException ex = new Ice.MarshalException();";
+ out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";";
+ out << nl << "throw ex;";
+ out << eb;
+
+ out << sp << nl << "public void" << nl << "__read(Ice.InputStream __in, boolean __rid)";
+ out << sb;
+ out << nl << "Ice.MarshalException ex = new Ice.MarshalException();";
+ out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";";
+ out << nl << "throw ex;";
+ out << eb;
+ }
if(p->usesClasses())
{