summaryrefslogtreecommitdiff
path: root/cpp/src/slice2java/Gen.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-10-18 16:18:17 +1000
committerMichi Henning <michi@zeroc.com>2007-10-18 16:18:17 +1000
commit5830d404e15cd788f4088e897ef71a4dca57a217 (patch)
tree1cf1f972420b6db655b5740a5aedda85ecce6996 /cpp/src/slice2java/Gen.cpp
parentChanged the way the patchers work for the expected type. (diff)
downloadice-5830d404e15cd788f4088e897ef71a4dca57a217.tar.bz2
ice-5830d404e15cd788f4088e897ef71a4dca57a217.tar.xz
ice-5830d404e15cd788f4088e897ef71a4dca57a217.zip
Changed the UnexpectedObjectException is thrown to match C#.
Diffstat (limited to 'cpp/src/slice2java/Gen.cpp')
-rw-r--r--cpp/src/slice2java/Gen.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 471b0a9697a..11867246ad8 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -1034,10 +1034,7 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr&
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "Ice.UnexpectedObjectException _e = new Ice.UnexpectedObjectException();";
- out << nl << "_e.type = v.ice_id();";
- out << nl << "_e.expectedType = type();";
- out << nl << "throw _e;";
+ out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());
out << eb;
out << eb;
@@ -2082,10 +2079,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "Ice.UnexpectedObjectException _e = new Ice.UnexpectedObjectException();";
- out << nl << "_e.type = v.ice_id();";
- out << nl << "_e.expectedType = type();";
- out << nl << "throw _e;";
+ out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());
out << eb;
out << eb;
@@ -2491,10 +2485,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "Ice.UnexpectedObjectException _e = new Ice.UnexpectedObjectException();";
- out << nl << "_e.type = v.ice_id();";
- out << nl << "_e.expectedType = type();";
- out << nl << "throw _e;";
+ out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());
out << eb;
out << eb;
@@ -3232,10 +3223,7 @@ Slice::Gen::HolderVisitor::writeHolder(const TypePtr& p)
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "Ice.UnexpectedObjectException _e = new Ice.UnexpectedObjectException();";
- out << nl << "_e.type = v.ice_id();";
- out << nl << "_e.expectedType = type();";
- out << nl << "throw _e;";
+ out << nl << "IceInternal.Ex.throwUOE(type(), v.ice_id());
out << eb;
out << eb;