Replace try with try-with-resources statement
Issue-ID: SO-703
Change-Id: I971b61af2070a6856c751ed36050dd018216fe03
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
public DefaultAAIPropertiesImpl() {
File initialFile = new File("src/test/resources/aai.properties");
Map<Object, Object> temp;
- try {
- InputStream targetStream = new FileInputStream(initialFile);
+ try(InputStream targetStream = new FileInputStream(initialFile)) {
Properties properties = new Properties();
properties.load(targetStream);
temp = properties;
final Map<Object, Object> props;
public PolicyRestPropertiesImpl() {
File initialFile = new File("src/test/resources/policy.properties");
- InputStream targetStream;
+
Map<Object, Object> temp;
- try {
- targetStream = new FileInputStream(initialFile);
+ try(InputStream targetStream = new FileInputStream(initialFile)) {
Properties properties = new Properties();
properties.load(targetStream);
temp = properties;