1
1
/*
2
- * Copyright (c) 2020, 2022 Oracle and/or its affiliates.
2
+ * Copyright (c) 2020, 2024 Oracle and/or its affiliates.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -155,10 +155,10 @@ private static ObjectNode fromConfig(ConfigObject config) {
155
155
ObjectNode .Builder builder = ObjectNode .builder ();
156
156
config .forEach ((unescapedKey , value ) -> {
157
157
String key = io .helidon .config .Config .Key .escapeName (unescapedKey );
158
- if (value instanceof ConfigList ) {
159
- builder .addList (key , fromList (( ConfigList ) value ));
160
- } else if (value instanceof ConfigObject ) {
161
- builder .addObject (key , fromConfig (( ConfigObject ) value ));
158
+ if (value instanceof ConfigList configList ) {
159
+ builder .addList (key , fromList (configList ));
160
+ } else if (value instanceof ConfigObject configObject ) {
161
+ builder .addObject (key , fromConfig (configObject ));
162
162
} else {
163
163
try {
164
164
Object unwrapped = value .unwrapped ();
@@ -181,10 +181,10 @@ private static ObjectNode fromConfig(ConfigObject config) {
181
181
private static ListNode fromList (ConfigList list ) {
182
182
ListNode .Builder builder = ListNode .builder ();
183
183
list .forEach (value -> {
184
- if (value instanceof ConfigList ) {
185
- builder .addList (fromList (( ConfigList ) value ));
186
- } else if (value instanceof ConfigObject ) {
187
- builder .addObject (fromConfig (( ConfigObject ) value ));
184
+ if (value instanceof ConfigList configList ) {
185
+ builder .addList (fromList (configList ));
186
+ } else if (value instanceof ConfigObject configObject ) {
187
+ builder .addObject (fromConfig (configObject ));
188
188
} else {
189
189
try {
190
190
Object unwrapped = value .unwrapped ();
0 commit comments