From 435a3a32b12f4f13ab4d693c1b06780f77ed7a8d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 27 Dec 2014 20:23:47 +0000 Subject: coverity#1019331 Unchecked dynamic_cast Change-Id: I902fdbcfd171e93ac57b5021269d2279610b4b0d --- codemaker/source/javamaker/javatype.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'codemaker') diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index f60b1635c5cb..09ba4af9b51a 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -1579,20 +1579,19 @@ void addExceptionBaseArguments( "unexpected entity \"" + base + "\" in call to addExceptionBaseArguments"); } - rtl::Reference< unoidl::ExceptionTypeEntity > ent2( - dynamic_cast< unoidl::ExceptionTypeEntity * >(ent.get())); - assert(ent2.is()); + unoidl::ExceptionTypeEntity& ent2( + dynamic_cast(*ent.get())); bool baseException = base == "com.sun.star.uno.Exception"; if (!baseException) { addExceptionBaseArguments( manager, dependencies, methodDescriptor, code, - ent2->getDirectBase(), index); + ent2.getDirectBase(), index); } for (std::vector< unoidl::ExceptionTypeEntity::Member >::const_iterator i( - ent2->getDirectMembers().begin()); - i != ent2->getDirectMembers().end(); ++i) + ent2.getDirectMembers().begin()); + i != ent2.getDirectMembers().end(); ++i) { - if (!baseException || i != ent2->getDirectMembers().begin()) { + if (!baseException || i != ent2.getDirectMembers().begin()) { methodDescriptor->addParameter(i->type, false, true, 0); addLoadLocal( manager, code, index, false, i->type, false, dependencies); -- cgit