summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-05 13:11:50 +0200
committerNoel Grandin <noel@peralex.com>2014-08-08 09:48:19 +0200
commit8f020a45fa69c9458844b8b621df2e0b15ec3d16 (patch)
treed428a990718d1c7f14ab22f058f74daf7ffebacc
parente5bc8b60ecfca09a2014ab7090659f3428c8efa0 (diff)
java: redundant assignment, variable can only be null
Change-Id: I91209c5c185cf097a1609244419d73d4757d7d18
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java2
-rw-r--r--jurt/com/sun/star/comp/loader/JavaLoader.java2
-rw-r--r--qadevOOo/runner/convwatch/OfficePrint.java2
-rw-r--r--qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java1
-rw-r--r--qadevOOo/runner/helper/APIDescGetter.java7
-rw-r--r--qadevOOo/runner/helper/URLHelper.java1
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java3
-rw-r--r--qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java1
-rw-r--r--scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java1
-rw-r--r--toolkit/test/accessibility/AccessibilityTree.java3
10 files changed, 3 insertions, 20 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index 3f84fb3f9a4d..fb2c6e105e20 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -722,7 +722,7 @@ XMultiPropertySet
//The member that keeps the value of the Property is an Object.Objects are similar to Anys in that they can
// hold all types.
if (obj == null || (obj instanceof Any && ((Any) obj).getObject() == null))
- retVal= null;
+ {}
else if(cl.equals(Object.class))
{
if (obj instanceof Any)
diff --git a/jurt/com/sun/star/comp/loader/JavaLoader.java b/jurt/com/sun/star/comp/loader/JavaLoader.java
index 708a2ee18fc4..d7f757a701f9 100644
--- a/jurt/com/sun/star/comp/loader/JavaLoader.java
+++ b/jurt/com/sun/star/comp/loader/JavaLoader.java
@@ -316,9 +316,7 @@ public class JavaLoader implements XImplementationLoader,
try {
method = clazz.getMethod("__getServiceFactory", paramTypes);
} catch ( NoSuchMethodException noSuchMethodEx) {
- method = null;
} catch ( SecurityException secEx) {
- method = null;
}
}
diff --git a/qadevOOo/runner/convwatch/OfficePrint.java b/qadevOOo/runner/convwatch/OfficePrint.java
index 801987849d9c..6476f44e4226 100644
--- a/qadevOOo/runner/convwatch/OfficePrint.java
+++ b/qadevOOo/runner/convwatch/OfficePrint.java
@@ -175,7 +175,6 @@ public class OfficePrint {
GlobalLogWriter.get().println("UNO Exception caught.");
GlobalLogWriter.get().println("Message: " + e.getMessage());
e.printStackTrace();
- aDoc = null;
}
return aDoc;
}
@@ -706,7 +705,6 @@ public class OfficePrint {
String sInputPath = FileHelper.getPath(_sAbsoluteInputFile);
sOutputPath = sInputPath;
}
- sOutputFileURL = null;
String sPrintFilename = FileHelper.getNameNoSuffix(sInputFileBasename);
String sPrintFileURL;
diff --git a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
index 37cba43a2dc2..75acf919b130 100644
--- a/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
+++ b/qadevOOo/runner/graphical/OpenOfficePostscriptCreator.java
@@ -261,7 +261,6 @@ public class OpenOfficePostscriptCreator implements IOffice
GlobalLogWriter.println("UNO Exception caught.");
GlobalLogWriter.println("Message: " + e.getMessage());
e.printStackTrace();
- aDoc = null;
}
return aDoc;
}
diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java
index a7c97dc37b17..ef1e7513db73 100644
--- a/qadevOOo/runner/helper/APIDescGetter.java
+++ b/qadevOOo/runner/helper/APIDescGetter.java
@@ -791,12 +791,7 @@ public class APIDescGetter extends DescGetter
{
File dirs = new File(descPath);
- if (!dirs.exists())
- {
- modules = null;
- }
- else
- {
+ if (dirs.exists()) {
modules = dirs.list();
}
}
diff --git a/qadevOOo/runner/helper/URLHelper.java b/qadevOOo/runner/helper/URLHelper.java
index 9bb6f7d9deaa..9cd18fb9d3f5 100644
--- a/qadevOOo/runner/helper/URLHelper.java
+++ b/qadevOOo/runner/helper/URLHelper.java
@@ -60,7 +60,6 @@ public class URLHelper
}
catch( MalformedURLException exWrong )
{
- sFileURL = null;
}
// problem of java: file URL's are coded with 1 slash instead of 2 or 3 ones!
diff --git a/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java b/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java
index ae25433d1277..64997de99028 100644
--- a/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java
+++ b/qadevOOo/tests/java/ifc/frame/_XFramesSupplier.java
@@ -71,7 +71,6 @@ public class _XFramesSupplier extends MultiMethodTest {
for (int i = 0; i < frames.getCount(); i++) {
XFrame fr = null ;
try {
- fr = null;
try {
fr = (XFrame) AnyConverter.toObject(
new Type(XFrame.class),frames.getByIndex(i));
@@ -181,8 +180,6 @@ public class _XFramesSupplier extends MultiMethodTest {
}
} else if (frames.getCount() > 0) {
sFrame = active ;
- } else {
- sFrame = null;
}
oObj.setActiveFrame(sFrame) ;
diff --git a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
index c44e903a4e8f..baecaa3e8673 100644
--- a/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
+++ b/qadevOOo/tests/java/mod/_cached/CachedDynamicResultSetStubFactory.java
@@ -131,7 +131,6 @@ public class CachedDynamicResultSetStubFactory extends TestCase {
(OpenMode.ALL, 10000, null, new Property[] {prop},
new NumberedSortingInfo[0])) ;
- dynResSet = null;
try {
dynResSet = (XDynamicResultSet)
AnyConverter.toObject(new Type(XDynamicResultSet.class),
diff --git a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
index 01c7151b2788..c231a3152863 100644
--- a/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
+++ b/scripting/java/org/openoffice/idesupport/zip/ParcelZipper.java
@@ -496,7 +496,6 @@ public class ParcelZipper
}
}
catch (IOException ioe) {
- result = null;
}
finally {
try {
diff --git a/toolkit/test/accessibility/AccessibilityTree.java b/toolkit/test/accessibility/AccessibilityTree.java
index 67c2db5a3cb9..aa8ab1da4e4d 100644
--- a/toolkit/test/accessibility/AccessibilityTree.java
+++ b/toolkit/test/accessibility/AccessibilityTree.java
@@ -160,8 +160,7 @@ public class AccessibilityTree
if( aExpander.expand( aObj ) )
{
maTree.expandPath (aPath);
- if( aFirst == null )
- aFirst = aPath;
+ aFirst = aPath;
}
// visit all children