@@ -88,8 +88,9 @@ public void unregister(@NotNull ValueType<?> type) {
8888
8989 @ SuppressWarnings ("unchecked" )
9090 public <T > @ Nullable ValueAdapter <T > adapterOf (@ NotNull ValueType <T > type ) {
91- ValueAdapter <?> cached = adapterCache .get (type );
92- if (cached != null ) return (ValueAdapter <T >) cached ;
91+ if (adapterCache .containsKey (type )) {
92+ return (ValueAdapter <T >) adapterCache .get (type );
93+ }
9394
9495 for (ValueAdapter <?> adapter : adapters ) {
9596 if (adapter .type ().equals (type )) {
@@ -154,11 +155,14 @@ private <T> T deserializeWithoutAdapter(@NotNull ConfigurationHolder<?> holder,
154155
155156 private <T > T deserializeArray (@ NotNull ConfigurationHolder <?> holder , @ NotNull ValueType <T > type ,
156157 @ NotNull Object source , @ NotNull Class <?> rawType ) throws Exception {
157- if (!(source instanceof List <?>)) {
158- source = deserializeList (holder , type , source );
158+ List <?> list ;
159+ if (source instanceof List <?>) {
160+ list = (List <?>) source ;
161+ } else {
162+ // For non-list sources, treat as single element array
163+ list = Collections .singletonList (source );
159164 }
160165
161- List <?> list = (List <?>) source ;
162166 int size = list .size ();
163167 if (size == 0 ) {
164168 return type .cast (Array .newInstance (rawType .getComponentType (), 0 ));
0 commit comments