[Libreoffice-commits] core.git: sc/qa

Stephan Bergmann sbergman at redhat.com
Wed Oct 14 03:26:11 PDT 2015


 sc/qa/complex/sc/CalcRTL.java |   45 ++++++++----------------------------------
 1 file changed, 9 insertions(+), 36 deletions(-)

New commits:
commit 8fb3808f555ad5b5c66cb894f9402647ca9ba341
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 14 12:21:24 2015 +0200

    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

diff --git a/sc/qa/complex/sc/CalcRTL.java b/sc/qa/complex/sc/CalcRTL.java
index 9f946a5..f30fed0 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;
                 }


More information about the Libreoffice-commits mailing list