Makes SongodaYamlConfig#cannotCreateBackupCopyExceptionPrefix static

It already is `final`.
By making it static we reduce the memory required by each instance of the class.
This commit is contained in:
Christian Koop 2022-11-26 20:25:11 +01:00
parent bba5fa5f3e
commit 8e91cc18eb
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ import java.util.logging.Logger;
// TODO: Allow registering load-Listeners
// TODO: Provide method to only save if changed
public class SongodaYamlConfig extends YamlConfiguration {
protected final String cannotCreateBackupCopyExceptionPrefix = "Unable to create backup copy of config file: ";
protected static final String cannotCreateBackupCopyExceptionPrefix = "Unable to create backup copy of config file: ";
public final @NotNull File file;
protected final @NotNull Logger logger;
@ -239,7 +239,7 @@ public class SongodaYamlConfig extends YamlConfiguration {
this.logger.info("Created backup copy of config file '" + this.file.getPath() + "' to '" + targetPath + "'");
} catch (IOException ex) {
throw new IOException(this.cannotCreateBackupCopyExceptionPrefix + this.file.getPath(), ex);
throw new IOException(cannotCreateBackupCopyExceptionPrefix + this.file.getPath(), ex);
}
}
}