From 1ec0f42390a9ec680ff2b37fc986d545b756f520 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Wed, 20 May 2009 11:28:36 +0000 Subject: [PATCH] Remove redundant null checks git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@776665 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/collections/ExtendedProperties.java | 2 +- .../apache/commons/collections/functors/PrototypeFactory.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/commons/collections/ExtendedProperties.java b/src/java/org/apache/commons/collections/ExtendedProperties.java index 6b113707e..00b3a08de 100644 --- a/src/java/org/apache/commons/collections/ExtendedProperties.java +++ b/src/java/org/apache/commons/collections/ExtendedProperties.java @@ -624,7 +624,7 @@ public class ExtendedProperties extends Hashtable { file = new File(basePath + value); } - if (file != null && file.exists() && file.canRead()) { + if (file.exists() && file.canRead()) { load(new FileInputStream(file)); } } else { diff --git a/src/java/org/apache/commons/collections/functors/PrototypeFactory.java b/src/java/org/apache/commons/collections/functors/PrototypeFactory.java index 5ba69ebd5..2066a66c8 100644 --- a/src/java/org/apache/commons/collections/functors/PrototypeFactory.java +++ b/src/java/org/apache/commons/collections/functors/PrototypeFactory.java @@ -196,9 +196,7 @@ public class PrototypeFactory { // ignore } try { - if (baos != null) { - baos.close(); - } + baos.close(); } catch (IOException ex) { // ignore }