From fced31697bcc2a2a4da34d804582002de0320302 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 19 Nov 2014 18:16:18 +0100 Subject: comphelper::SequenceAsHashMap: throw IllegalArgumentException ...instead of IllegalTypeException (where the latter is not a RuntimeException). Fixes cid#707218, cid#1224993, etc., and reverts previous fix 358f5280e0f6afb968edc295d8f1dce55f05e18f "Fix coverity#1224993 w/o breaking JunitTest_framework_unoapi." Change-Id: I13ce153e1513749fb0be2ee8e560cec86a30c5ba --- comphelper/source/misc/sequenceashashmap.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index 35f2d6bf118a..46df283f3278 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include #include @@ -75,8 +78,9 @@ void SequenceAsHashMap::operator<<(const css::uno::Any& aSource) return; } - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw css::lang::IllegalArgumentException( + "Any contains wrong type.", css::uno::Reference(), + -1); } @@ -94,8 +98,9 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lP.Name.isEmpty()) || (!lP.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "PropertyValue struct contains no useful information." ); + throw css::lang::IllegalArgumentException( + "PropertyValue struct contains no useful information.", + css::uno::Reference(), -1); (*this)[lP.Name] = lP.Value; continue; } @@ -107,16 +112,18 @@ void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lS (lN.Name.isEmpty()) || (!lN.Value.hasValue()) ) - throw css::beans::IllegalTypeException( - "NamedValue struct contains no useful information." ); + throw css::lang::IllegalArgumentException( + "NamedValue struct contains no useful information.", + css::uno::Reference(), -1); (*this)[lN.Name] = lN.Value; continue; } // ignore VOID Any ... but reject wrong filled ones! if (lSource[i].hasValue()) - throw css::beans::IllegalTypeException( - "Any contains wrong type." ); + throw css::lang::IllegalArgumentException( + "Any contains wrong type.", + css::uno::Reference(), -1); } } -- cgit