From 6bad4f6aed63c3fd54c46b269a285013e3ced553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 6 Sep 2022 12:41:25 +0100 Subject: [PATCH] cid#1509284 DMI: Dubious method invocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1fd1f710ae2a6b8ebc9506a56d522006509fc935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139515 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java | 3 ++- qadevOOo/tests/java/ifc/table/_XAutoFormattable.java | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java index 8ab74dcda173..a7821ba2b88d 100644 --- a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java @@ -53,6 +53,8 @@ import com.sun.star.uno.UnoRuntime; * @see com.sun.star.beans.XFastPropertySet */ public class _XFastPropertySet extends MultiMethodTest { + public Random rnd = new Random(); + private static final class Prop { public final int handle; public final String name; @@ -184,7 +186,6 @@ public class _XFastPropertySet extends MultiMethodTest { props.add(new Prop(handle, name)); } // endfor - Random rnd = new Random(); int nr = rnd.nextInt(props.size()); prop = props.get(nr); } diff --git a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java index 6473f17b7380..0c1d9a30009c 100644 --- a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java +++ b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java @@ -44,6 +44,7 @@ import com.sun.star.uno.XInterface; */ public class _XAutoFormattable extends MultiMethodTest { public XAutoFormattable oObj = null; + public Random rnd = new Random(); /** * First 'Default' autoformat is set and a background of a cell @@ -82,8 +83,6 @@ public class _XAutoFormattable extends MultiMethodTest { String[] names = formats.getElementNames(); // getting one random not default style name - Random rnd = new Random(); - if (names.length > 1) { while (name.equals("Default")) { name = names[rnd.nextInt(names.length)]; @@ -123,4 +122,4 @@ public class _XAutoFormattable extends MultiMethodTest { protected void after() { disposeEnvironment(); } -} \ No newline at end of file +}