coverity 1291768: file input stream not severe unless repetitive (property file usually aren't)

Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
Daan Hoogland 2015-07-07 12:45:34 +02:00
parent 803d6ed7df
commit dae2e05f3c

View File

@ -59,9 +59,7 @@ public class KafkaEventBus extends ManagerBase implements EventBus {
final Properties props = new Properties(); final Properties props = new Properties();
try { try (final FileInputStream is = new FileInputStream(PropertiesUtil.findConfigFile("kafka.producer.properties"));) {
final FileInputStream is = new FileInputStream(PropertiesUtil.findConfigFile("kafka.producer.properties"));
props.load(is); props.load(is);
_topic = (String)props.remove("topic"); _topic = (String)props.remove("topic");
@ -76,9 +74,6 @@ public class KafkaEventBus extends ManagerBase implements EventBus {
if (!props.containsKey("value.serializer")) { if (!props.containsKey("value.serializer")) {
props.put("value.serializer", DEFAULT_SERIALIZER); props.put("value.serializer", DEFAULT_SERIALIZER);
} }
is.close();
} catch (Exception e) { } catch (Exception e) {
throw new ConfigurationException("Could not read kafka properties"); throw new ConfigurationException("Could not read kafka properties");
} }