mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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:
parent
803d6ed7df
commit
dae2e05f3c
@ -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");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user