From fd60dd5226b6cefb1eb621f8e479ba59bf11b0b7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 10 Dec 2014 13:35:17 +0200 Subject: java: improve use of WrappedTargetException to set cause properly since we introduced the new constructors that pass the cause all the way up to java.lang.Throwable. Also simplify some exeception printing sites, because Throwable will correctly print out child exceptions for us. Change-Id: Ibbecce3c6f971fbc80d6de2052ab4f33a4503c0a --- javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java | 6 +++--- javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'javaunohelper/com') diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java index 47407b1e78ad..ed82d92a4870 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java @@ -688,11 +688,11 @@ XMultiPropertySet } catch (java.lang.NoSuchFieldException e) { - throw new WrappedTargetException("Field does not exist", this, e); + throw new WrappedTargetException(e, "Field does not exist", this, e); } catch (java.lang.IllegalAccessException e) { - throw new WrappedTargetException("", this ,e); + throw new WrappedTargetException(e, "", this ,e); } return ret; } @@ -808,7 +808,7 @@ XMultiPropertySet } catch(java.lang.Exception e) { - throw new WrappedTargetException("PropertySet.setPropertyValueNoBroadcast", this, e); + throw new WrappedTargetException(e, "PropertySet.setPropertyValueNoBroadcast", this, e); } } /** Retrieves the value of a property. This implementation presumes that the values are stored in member variables diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java index 7e2af48e1e56..26d94649174a 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java @@ -479,7 +479,7 @@ public final class PropertySetMixin { } catch (UnknownPropertyException e) { continue; } catch (WrappedTargetException e) { - throw new WrappedTargetRuntimeException(e, + throw new WrappedTargetRuntimeException(e.getCause(), e.getMessage(), object, e.TargetException); } s[n++] = new PropertyValue(handleMap[i], i, value, state[0]); @@ -742,7 +742,7 @@ public final class PropertySetMixin { { throw new PropertyVetoException(e, name, object); } else { - throw new WrappedTargetException( + throw new WrappedTargetException(e.getCause(), e.getMessage(), object, e.TargetException); } } @@ -774,7 +774,7 @@ public final class PropertySetMixin { { throw new UnknownPropertyException(e, name, object); } else { - throw new WrappedTargetException( + throw new WrappedTargetException(e.getCause(), e.getMessage(), object, e.TargetException); } } -- cgit