Kaydet (Commit) 8fb3808f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 3c496d80
...@@ -402,16 +402,9 @@ public class CalcRTL ...@@ -402,16 +402,9 @@ public class CalcRTL
System.out.println("Read only property '" + propName + System.out.println("Read only property '" + propName +
"' has changed"); "' has changed");
try { System.out.println("old = " + toString(oldValue));
if (!util.utils.isVoid(oldValue) && oldValue instanceof Any) { System.out.println("new = " + toString(newValue));
oldValue = AnyConverter.toObject( new Type(oldValue.getClass()), oldValue); System.out.println("result = " + toString(resValue));
}
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) {
}
return false; return false;
} else { } else {
...@@ -431,19 +424,9 @@ public class CalcRTL ...@@ -431,19 +424,9 @@ public class CalcRTL
System.out.println("Value for '" + propName + System.out.println("Value for '" + propName +
"' hasn't changed as expected"); "' hasn't changed as expected");
try { System.out.println("old = " + toString(oldValue));
if (!util.utils.isVoid(oldValue) && System.out.println("new = " + toString(newValue));
oldValue instanceof Any) { System.out.println("result = " + toString(resValue));
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) {
}
if (resValue != null) { if (resValue != null) {
if ((!ValueComparer.equalValue(resValue, oldValue)) || if ((!ValueComparer.equalValue(resValue, oldValue)) ||
...@@ -460,19 +443,9 @@ public class CalcRTL ...@@ -460,19 +443,9 @@ public class CalcRTL
} else { } else {
System.out.println("Property '" + propName + "' OK"); System.out.println("Property '" + propName + "' OK");
try { System.out.println("old = " + toString(oldValue));
if (!util.utils.isVoid(oldValue) && System.out.println("new = " + toString(newValue));
oldValue instanceof Any) { System.out.println("result = " + toString(resValue));
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) {
}
return true; return true;
} }
......
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