From 8fb3808f555ad5b5c66cb894f9402647ca9ba341 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 14 Oct 2015 12:21:24 +0200 Subject: These places apparently want to unbox a value boxed as an Any ...but what the original code would have done is try to unbox as an Any again, which would throw IllegalArgumentException. As the unboxed value would only be used for printing to System.out (and Any.toString result is just fine), just don't bother to unbox at all. (In the second place, the oldValue result would further be used in a util.ValueComparer.equalValue call, but that internally takes care of correctly unboxing its arguments, anyway.) Change-Id: I6802d1acd787f19346f66b418372be1701f69139 --- sc/qa/complex/sc/CalcRTL.java | 45 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) (limited to 'sc/qa/complex') diff --git a/sc/qa/complex/sc/CalcRTL.java b/sc/qa/complex/sc/CalcRTL.java index 9f946a51235a..f30fed0d5a91 100644 --- a/sc/qa/complex/sc/CalcRTL.java +++ b/sc/qa/complex/sc/CalcRTL.java @@ -402,16 +402,9 @@ public class CalcRTL System.out.println("Read only property '" + propName + "' has changed"); - try { - if (!util.utils.isVoid(oldValue) && oldValue instanceof Any) { - oldValue = AnyConverter.toObject( new Type(oldValue.getClass()), oldValue); - } - - System.out.println("old = " + toString(oldValue)); - System.out.println("new = " + toString(newValue)); - System.out.println("result = " + toString(resValue)); - } catch (com.sun.star.lang.IllegalArgumentException iae) { - } + System.out.println("old = " + toString(oldValue)); + System.out.println("new = " + toString(newValue)); + System.out.println("result = " + toString(resValue)); return false; } else { @@ -431,19 +424,9 @@ public class CalcRTL System.out.println("Value for '" + propName + "' hasn't changed as expected"); - try { - if (!util.utils.isVoid(oldValue) && - oldValue instanceof Any) { - oldValue = AnyConverter.toObject( - new Type(((Any) oldValue).getClass()), - oldValue); - } - - System.out.println("old = " + toString(oldValue)); - System.out.println("new = " + toString(newValue)); - System.out.println("result = " + toString(resValue)); - } catch (com.sun.star.lang.IllegalArgumentException iae) { - } + System.out.println("old = " + toString(oldValue)); + System.out.println("new = " + toString(newValue)); + System.out.println("result = " + toString(resValue)); if (resValue != null) { if ((!ValueComparer.equalValue(resValue, oldValue)) || @@ -460,19 +443,9 @@ public class CalcRTL } else { System.out.println("Property '" + propName + "' OK"); - try { - if (!util.utils.isVoid(oldValue) && - oldValue instanceof Any) { - oldValue = AnyConverter.toObject( - new Type(((Any) oldValue).getClass()), - oldValue); - } - - System.out.println("old = " + toString(oldValue)); - System.out.println("new = " + toString(newValue)); - System.out.println("result = " + toString(resValue)); - } catch (com.sun.star.lang.IllegalArgumentException iae) { - } + System.out.println("old = " + toString(oldValue)); + System.out.println("new = " + toString(newValue)); + System.out.println("result = " + toString(resValue)); return true; } -- cgit