@@ -25,7 +25,7 @@ class PropertiesFile {
2525
2626 private boolean loaded ;
2727
28- public PropertiesFile (Path path , Charset charset , Properties root ) {
28+ public PropertiesFile (final Path path , final Charset charset , final Properties root ) {
2929 this .charset = charset ;
3030 this .defaultRoot = root ;
3131 this .path = path ;
@@ -34,42 +34,42 @@ public PropertiesFile(Path path, Charset charset, Properties root) {
3434
3535 protected Properties load () {
3636 if (!Files .isRegularFile (getFile ())) return (Properties ) getRoot ().clone ();
37- try (var reader = new InputStreamReader (Files .newInputStream (getFile (), READ ), charset );
38- var buffer = new BufferedReader (reader )) {
39- var properties = new Properties ();
37+ try (final var reader = new InputStreamReader (Files .newInputStream (getFile (), READ ), charset );
38+ final var buffer = new BufferedReader (reader )) {
39+ final var properties = new Properties ();
4040 properties .load (buffer );
4141 return properties ;
42- } catch (IOException e ) {
42+ } catch (final IOException e ) {
4343 throw new RuntimeException (e );
4444 }
4545 }
4646
47- public PropertiesFile save (FileAttribute <?>... attributes ) {
47+ public PropertiesFile save (final FileAttribute <?>... attributes ) {
4848 try {
49- var root = getRoot ();
49+ final var root = getRoot ();
5050 Files .createDirectories (getFile ().toAbsolutePath ().getParent (), attributes );
51- try (var writer = new BufferedWriter (new OutputStreamWriter (
51+ try (final var writer = new BufferedWriter (new OutputStreamWriter (
5252 Files .newOutputStream (getFile (), WRITE , CREATE , TRUNCATE_EXISTING ),
5353 charset
5454 ))) {
5555 root .store (writer , null );
5656 return this ;
5757 }
58- } catch (IOException e ) {
58+ } catch (final IOException e ) {
5959 throw new RuntimeException (e );
6060 }
6161 }
6262
63- public PropertiesFile validate (ComponentBundle .Scope scope ) {
64- var root = getRoot ();
63+ public PropertiesFile validate (final ComponentBundle .Scope scope ) {
64+ final var root = getRoot ();
6565 if (root == defaultRoot ) return this ;
6666 if (scope .isFiltering ()) root .entrySet ().removeIf (entry ->
6767 !defaultRoot .containsKey (entry .getKey ()));
6868 if (scope .isFilling ()) merge (defaultRoot );
6969 return this ;
7070 }
7171
72- public PropertiesFile setRoot (Properties root ) {
72+ public PropertiesFile setRoot (final Properties root ) {
7373 this .loaded = true ;
7474 this .root = root ;
7575 return this ;
@@ -85,8 +85,8 @@ public Path getFile() {
8585 return path ;
8686 }
8787
88- public PropertiesFile merge (Properties properties ) {
89- var root = getRoot ();
88+ public PropertiesFile merge (final Properties properties ) {
89+ final var root = getRoot ();
9090 properties .forEach ((key , value ) -> {
9191 if (root .containsKey (key )) return ;
9292 root .put (key , value );
0 commit comments