summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-22 10:07:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-08-22 15:07:15 +0200
commit28f9791b9649f700971624700aa0ecc25b2eae79 (patch)
tree8cfb373dff25f08d1b4f6627a9fdc2841a91117e /qadevOOo
parentdd0ca80d887ad174511302ffadacd61447e93420 (diff)
cid#1509396 Explicit null dereferenced
and cid#1509395 Explicit null dereferenced Change-Id: Ifd8dffe2ff2432ee2f0ef18bb2a480c2f042910b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138674 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java56
1 files changed, 34 insertions, 22 deletions
diff --git a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
index dc775c6e1d8c..c7009a88ab18 100644
--- a/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
+++ b/qadevOOo/tests/java/ifc/view/_XMultiSelectionSupplier.java
@@ -318,21 +318,27 @@ public class _XMultiSelectionSupplier extends MultiMethodTest {
Object shouldElement = selections[i];
i++;
- if (ObjCompare != null) {
- compRes = ObjCompare.compare(shouldElement, nextElement) == 0;
- } else {
- compRes = util.ValueComparer.equalValue(shouldElement, nextElement);
- }
+ if (nextElement != null)
+ {
+ if (ObjCompare != null) {
+ compRes = ObjCompare.compare(shouldElement, nextElement) == 0;
+ } else {
+ compRes = util.ValueComparer.equalValue(shouldElement, nextElement);
+ }
- log.println("nextElement()-object and expected object 'selections["+i+"]' are equal: "+compRes);
+ log.println("nextElement()-object and expected object 'selections["+i+"]' are equal: "+compRes);
- if (!compRes && (selections[i]) instanceof Object[]) {
- if (((Object[])selections[i])[0] instanceof Integer) {
- log.println("Getting: "+((Integer) ((Object[])shouldElement)[0]).intValue());
- log.println("Expected: "+((Integer) ((Object[])selections[i])[0]).intValue());
+ if (!compRes && (selections[i]) instanceof Object[]) {
+ if (((Object[])selections[i])[0] instanceof Integer) {
+ log.println("Getting: "+((Integer) ((Object[])shouldElement)[0]).intValue());
+ log.println("Expected: "+((Integer) ((Object[])selections[i])[0]).intValue());
+ }
}
+ bOK &= compRes;
+
+ } else {
+ bOK = false;
}
- bOK &= compRes;
}
tRes.tested("createSelectionEnumeration()", bOK);
@@ -389,21 +395,27 @@ public class _XMultiSelectionSupplier extends MultiMethodTest {
Object shouldElement = selections[i];
i--;
- if (ObjCompare != null) {
- compRes = ObjCompare.compare(shouldElement, nextElement) == 0;
- } else {
- compRes = util.ValueComparer.equalValue(shouldElement, nextElement);
- }
+ if (nextElement != null) {
+ if (ObjCompare != null) {
+ compRes = ObjCompare.compare(shouldElement, nextElement) == 0;
+ } else {
+ compRes = util.ValueComparer.equalValue(shouldElement, nextElement);
+ }
- log.println("nextElement()-object and expected object 'selections["+i+"]' are equal: "+compRes);
+ log.println("nextElement()-object and expected object 'selections["+i+"]' are equal: "+compRes);
- if (!compRes && (selections[i]) instanceof Object[]){
- if (((Object[])selections[i])[0] instanceof Integer) {
- log.println("Getting: "+((Integer) ((Object[])shouldElement)[0]).intValue());
- log.println("Expected: "+((Integer) ((Object[])selections[i])[0]).intValue());
+ if (!compRes && (selections[i]) instanceof Object[]){
+ if (((Object[])selections[i])[0] instanceof Integer) {
+ log.println("Getting: "+((Integer) ((Object[])shouldElement)[0]).intValue());
+ log.println("Expected: "+((Integer) ((Object[])selections[i])[0]).intValue());
+ }
}
+ bOK &= compRes;
+
+ } else {
+ bOK = false;
}
- bOK &= compRes;
+
}
tRes.tested("createReverseSelectionEnumeration()", bOK);