Using try-with-resources in a few places
@@ -537,8 +537,7 @@ public final class ResourceUtils {
public static List<UserResource> getUserResources(String loc, Bus bus) {
- try {
- InputStream is = ResourceUtils.getResourceStream(loc, bus);
+ try (InputStream is = ResourceUtils.getResourceStream(loc, bus)) {
if (is == null) {
return null;
}
@@ -602,8 +601,9 @@ public final class ResourceUtils {
public static Properties loadProperties(String propertiesLocation, Bus bus) throws Exception {
Properties props = new Properties();
- InputStream is = getResourceStream(propertiesLocation, bus);
+ try (InputStream is = getResourceStream(propertiesLocation, bus)) {
props.load(is);
+ }
return props;
}
