Skip to content

Commit 0c66f91

Browse files
committed
apply formatting
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
1 parent 39a293c commit 0c66f91

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/ModelConstructor.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,24 @@ class ModelConstructor extends Constructor {
5252
* Matches variable interpolation patterns in YAML strings.
5353
*
5454
* Supported syntax (subset of bash variable substitution):
55-
* - ${var} : Simple variable substitution. If 'var' is not set, returns empty string.
56-
* - ${var-default} : If 'var' is set but empty, returns empty string . If not set, returns 'default'.
57-
* - ${var:-default} : If 'var' is set but empty, returns 'default'. If not set, returns 'default'.
58-
* - Default values can be single-quoted, double-quoted, or unquoted.
55+
* - ${var} : Simple variable substitution. If 'var' is not set, returns empty string.
56+
* - ${var-default} : If 'var' is set but empty, returns empty string . If not set, returns 'default'.
57+
* - ${var:-default} : If 'var' is set but empty, returns 'default'. If not set, returns 'default'.
58+
* - Default values can be single-quoted, double-quoted, or unquoted.
5959
*
6060
* Regex breakdown:
61-
* - (?<name>\\w+) : Captures the variable name (alphanumeric and underscore).
62-
* - (?<separator>:?-) : Optionally captures the separator (either '-' or ':-').
63-
* - '(?<defaultsq>[^']*)' : Captures single-quoted default value (inside quotes).
64-
* - "(?<defaultdq>[^"]*)" : Captures double-quoted default value (inside quotes).
65-
* - (?<default>[^}]*) : Captures unquoted default value (up to closing brace).
66-
* - All default value groups are optional.
61+
* - (?<name>\\w+) : Captures the variable name (alphanumeric and underscore).
62+
* - (?<separator>:?-) : Optionally captures the separator (either '-' or ':-').
63+
* - '(?<defaultsq>[^']*)' : Captures single-quoted default value (inside quotes).
64+
* - "(?<defaultdq>[^"]*)" : Captures double-quoted default value (inside quotes).
65+
* - (?<default>[^}]*) : Captures unquoted default value (up to closing brace).
66+
* - All default value groups are optional.
6767
*
6868
* Additional notes:
69-
* - If no default value is provided, an empty string is returned.
70-
* - Whitespace inside default values is preserved.
71-
* - Nested variable patterns are not matched by this regex (handled separately).
72-
* - Invalid patterns (e.g., missing closing brace) will not match.
69+
* - If no default value is provided, an empty string is returned.
70+
* - Whitespace inside default values is preserved.
71+
* - Nested variable patterns are not matched by this regex (handled separately).
72+
* - Invalid patterns (e.g., missing closing brace) will not match.
7373
*/
7474
private static final Pattern VARIABLE_PATTERN = Pattern.compile("""
7575
\\$\\{

bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/YamlPreprocessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ private static Object loadIncludeFile(Path file, IncludeObject includeObject, Ma
195195
includeCallback.accept(includeFile);
196196
return loadedFile;
197197
} catch (IOException e) {
198-
LOGGER.warn("Error loading include file '{}' (included from '{}'): {}", includeObject.fileName(), file, e.getMessage());
198+
LOGGER.warn("Error loading include file '{}' (included from '{}'): {}", includeObject.fileName(), file,
199+
e.getMessage());
199200
return Map.of();
200201
}
201202
}

0 commit comments

Comments
 (0)