summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-05 12:18:20 +0200
committerNoel Grandin <noel@peralex.com>2014-08-08 09:48:19 +0200
commite5bc8b60ecfca09a2014ab7090659f3428c8efa0 (patch)
tree479fea82acab2e4fe48a796706b73b69a0a938e7 /qadevOOo
parentb58c053fed3c7e2e1e6a4195254e639976a3a809 (diff)
java: variable cannot be null
remove null check where null-analyis reveals the variable cannot be null Change-Id: Ied0a24665514bbf68c2ed5f15af9e5c2232a8033
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/base/java_fat.java2
-rw-r--r--qadevOOo/runner/stats/SQLExecution.java2
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java2
-rw-r--r--qadevOOo/tests/java/ifc/util/_XChangesBatch.java10
-rw-r--r--qadevOOo/tests/java/ifc/util/_XChangesNotifier.java12
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java1
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java3
-rw-r--r--qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java3
8 files changed, 13 insertions, 22 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java
index 9e5efaebe494..04f159a4336a 100644
--- a/qadevOOo/runner/base/java_fat.java
+++ b/qadevOOo/runner/base/java_fat.java
@@ -181,7 +181,7 @@ public class java_fat implements TestBase
aSubEntry.UserDefinedParams = m_aParams;
aSubEntry.Logger = ifclog;
- if ((tEnv == null) || tEnv.isDisposed())
+ if (tEnv.isDisposed())
{
closeExistingOffice();
tEnv = getEnv(entry, m_aParams);
diff --git a/qadevOOo/runner/stats/SQLExecution.java b/qadevOOo/runner/stats/SQLExecution.java
index e65ac26d3f12..1401156e6d82 100644
--- a/qadevOOo/runner/stats/SQLExecution.java
+++ b/qadevOOo/runner/stats/SQLExecution.java
@@ -242,8 +242,6 @@ public class SQLExecution {
}
}
}
- if (!update && sqlOutput == null)
- return false;
return true;
}
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
index de87ca91e436..c5ca5ea5f8d2 100644
--- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
+++ b/qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer.java
@@ -60,13 +60,13 @@ public class _XCellRangeReferrer extends MultiMethodTest {
("Relation 'DATAAREA' not found"));
XCellRange cr = oObj.getReferredCells();
- log.println(cr.toString());
if (cr == null) {
log.println("getReferredCells returned NULL.");
tRes.tested("getReferredCells()", false);
return;
}
+ log.println(cr.toString());
XCellRangeAddressable xCRA = UnoRuntime.queryInterface(XCellRangeAddressable.class, cr);
diff --git a/qadevOOo/tests/java/ifc/util/_XChangesBatch.java b/qadevOOo/tests/java/ifc/util/_XChangesBatch.java
index 759304e0db69..e46cc034ca1f 100644
--- a/qadevOOo/tests/java/ifc/util/_XChangesBatch.java
+++ b/qadevOOo/tests/java/ifc/util/_XChangesBatch.java
@@ -66,11 +66,11 @@ public class _XChangesBatch extends MultiMethodTest {
if (changeElement == null || originalElement == null || elementName == null || (xProp == null && xNameReplace == null)) {
log.println(
- changeElement == null?"Missing property 'XChangesBatch.ChangeElement'\n":"" +
- originalElement == null?"Missing property 'XChangesBatch.OriginalElement'\n":"" +
- elementName == null?"Missing property 'XChangesBatch.PropertyName'\n":"" +
- xProp == null?"Missing property 'XChangesBatch.PropertySet'":"" +
- xNameReplace == null?"Missing property 'XChangesBatch.NameReplace'":""
+ (changeElement == null?"Missing property 'XChangesBatch.ChangeElement'\n":"") +
+ (originalElement == null?"Missing property 'XChangesBatch.OriginalElement'\n":"") +
+ (elementName == null?"Missing property 'XChangesBatch.PropertyName'\n":"") +
+ (xProp == null?"Missing property 'XChangesBatch.PropertySet'":"") +
+ (xNameReplace == null?"Missing property 'XChangesBatch.NameReplace'":"")
);
throw new StatusException("Some needed object relations are missing.", new Exception());
}
diff --git a/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java b/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java
index cf358959cc8b..263cc2e2c2eb 100644
--- a/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java
+++ b/qadevOOo/tests/java/ifc/util/_XChangesNotifier.java
@@ -112,12 +112,12 @@ public class _XChangesNotifier extends MultiMethodTest {
if (changeElement == null || originalElement == null || elementName == null || (xProp == null && xNameReplace == null) || xBatch == null) {
log.println(
- changeElement == null?"Missing property 'XChangesNotifier.ChangeElement'\n":"" +
- originalElement == null?"Missing property 'XChangesNotifier.OriginalElement'\n":"" +
- elementName == null?"Missing property 'XChangesNotifier.PropertyName'\n":"" +
- xProp == null?"Missing property 'XChangesNotifier.PropertySet'":"" +
- xNameReplace == null?"Missing property 'XChangesNotifier.NameReplace'":"" +
- xBatch == null?"Missing property 'XChangesNotifier.ChangesBatch'":""
+ (changeElement == null?"Missing property 'XChangesNotifier.ChangeElement'\n":"") +
+ (originalElement == null?"Missing property 'XChangesNotifier.OriginalElement'\n":"") +
+ (elementName == null?"Missing property 'XChangesNotifier.PropertyName'\n":"") +
+ (xProp == null?"Missing property 'XChangesNotifier.PropertySet'":"") +
+ (xNameReplace == null?"Missing property 'XChangesNotifier.NameReplace'":"") +
+ (xBatch == null?"Missing property 'XChangesNotifier.ChangesBatch'":"")
);
throw new StatusException("Some needed object relations are missing.", new Exception());
}
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
index 908f5b4cbafb..9646f703f874 100644
--- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTableObj.java
@@ -155,7 +155,6 @@ public class ScDataPilotTableObj extends TestCase {
e.printStackTrace(log);
throw new StatusException( "Couldn't get a spreadsheet", e);
}
- log.println("Getting sheet - " + (oSheet == null ? "FAILED" : "OK"));
try {
log.println("Filing a table");
for (int i = 1; i < 6; i++) {
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
index 4112e448f164..69350766e446 100644
--- a/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
+++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotTablesObj.java
@@ -166,9 +166,6 @@ public class ScDataPilotTablesObj extends TestCase {
oObj = DPT;
- log.println("Creating object - " +
- ((oObj == null) ? "FAILED" : "OK"));
-
TestEnvironment tEnv = new TestEnvironment( oObj );
// Other parameters required for interface tests
diff --git a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
index 0e893f86ac01..e204bfa45a3a 100644
--- a/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DataPilotTablesEnumeration.java
@@ -131,9 +131,6 @@ public class ScIndexEnumeration_DataPilotTablesEnumeration extends TestCase {
oObj = DPT;
- log.println("Creating object - " +
- ((oObj == null) ? "FAILED" : "OK"));
-
XEnumerationAccess ea = UnoRuntime.queryInterface(XEnumerationAccess.class,oObj);
oObj = ea.createEnumeration();