Kaydet (Commit) 7a3f0921 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1231674 Uncaught exception

and

coverity#1231675 Uncaught exception

Change-Id: If0907f2048fc5e492d5b8b49388c3bfad542e5f7
üst 209cdaa1
...@@ -425,13 +425,13 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getSt ...@@ -425,13 +425,13 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getSt
return getStructuredCondition(F_tmp); return getStructuredCondition(F_tmp);
} }
void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, RuntimeException, std::exception) void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, WrappedTargetException, RuntimeException, std::exception)
{ {
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetHavingClause); ::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetHavingClause);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator); setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
} }
void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, RuntimeException, std::exception) void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, WrappedTargetException, RuntimeException, std::exception)
{ {
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetFilter); ::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetFilter);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator); setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
......
...@@ -227,12 +227,12 @@ namespace dbaccess ...@@ -227,12 +227,12 @@ namespace dbaccess
virtual void SAL_CALL setElementaryQuery( const OUString& _rElementary ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setElementaryQuery( const OUString& _rElementary ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setFilter( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setFilter( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setStructuredFilter( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setStructuredFilter( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendFilterByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL appendFilterByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendGroupByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL appendGroupByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setGroup( const OUString& group ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setGroup( const OUString& group ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setHavingClause( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setHavingClause( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setStructuredHavingClause( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setStructuredHavingClause( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendHavingClauseByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL appendHavingClauseByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendOrderByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool ascending ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL appendOrderByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool ascending ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setOrder( const OUString& order ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setOrder( const OUString& order ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
...@@ -20,11 +20,9 @@ ...@@ -20,11 +20,9 @@
#define __com_sun_star_sdb_XSingleSelectQueryComposer_idl__ #define __com_sun_star_sdb_XSingleSelectQueryComposer_idl__
#include <com/sun/star/beans/XPropertySet.idl> #include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/beans/PropertyValue.idl> #include <com/sun/star/beans/PropertyValue.idl>
#include <com/sun/star/lang/WrappedTargetException.idl>
#include <com/sun/star/sdbc/SQLException.idl> #include <com/sun/star/sdbc/SQLException.idl>
#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl> #include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl>
...@@ -84,7 +82,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer ...@@ -84,7 +82,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer
if a database access error occurs. if a database access error occurs.
*/ */
void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator) void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator)
raises (com::sun::star::sdbc::SQLException); raises (com::sun::star::sdbc::SQLException, com::sun::star::lang::WrappedTargetException);
// GROUP BY // GROUP BY
...@@ -153,7 +151,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer ...@@ -153,7 +151,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer
if a database access error occurs. if a database access error occurs.
*/ */
void appendHavingClauseByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator) void appendHavingClauseByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator)
raises (com::sun::star::sdbc::SQLException); raises (com::sun::star::sdbc::SQLException, com::sun::star::lang::WrappedTargetException);
// ORDER BY // ORDER BY
......
...@@ -198,6 +198,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -198,6 +198,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
log.println("unexpected Exception: " + e.toString()); log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false); tRes.tested("appendFilterByColumn()", false);
} }
catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try try
{ {
...@@ -218,6 +223,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -218,6 +223,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
log.println("unexpected Exception: " + e.toString()); log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false); tRes.tested("appendFilterByColumn()", false);
} }
catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try{ try{
...@@ -228,6 +238,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -228,6 +238,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){ } catch (SQLException e){
log.println("unexpected Exception: " + e.toString()); log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false); tRes.tested("appendFilterByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
} }
try{ try{
...@@ -239,7 +253,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -239,7 +253,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){ } catch (SQLException e){
log.println("expected Exception"); log.println("expected Exception");
ok = ok && true; ok = ok && true;
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
} }
try try
{ {
xReSet.beforeFirst(); xReSet.beforeFirst();
...@@ -388,6 +407,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -388,6 +407,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
ok = ok && true; ok = ok && true;
} }
catch (SQLException e) catch (SQLException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{ {
log.println("unexpected Exception: " + e.toString()); log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false); tRes.tested("appendHavingClauseByColumn()", false);
...@@ -411,9 +434,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -411,9 +434,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){ } catch (SQLException e){
log.println("unexpected Exception: " + e.toString()); log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false); tRes.tested("appendHavingClauseByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
} }
try{ try{
XPropertySet dummy = null; XPropertySet dummy = null;
oObj.appendHavingClauseByColumn(dummy, true,SQLFilterOperator.EQUAL); oObj.appendHavingClauseByColumn(dummy, true,SQLFilterOperator.EQUAL);
...@@ -423,6 +449,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest { ...@@ -423,6 +449,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){ } catch (SQLException e){
log.println("expected Exception"); log.println("expected Exception");
ok = ok && true; ok = ok && true;
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
} }
// cleanup // cleanup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment