fix: resource leak in case prop file doesn't exist
@@ -34,8 +34,8 @@ public abstract class Plugin {
public void loadProperties() {
properties = new Properties();
log.trace("Loading properties");
- try {
- properties.load(this.getClass().getResourceAsStream("/plugin.conf.properties"));
+ try (InputStream inputStream = this.getClass().getResourceAsStream("/plugin.conf.properties")) {
+ properties.load(inputStream);
if (properties.getProperty("external-properties-file") != null) {
File externalPropertiesFile = new File(properties.getProperty("external-properties-file"));
if (externalPropertiesFile.exists()) {
