diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesResolver.java b/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesResolver.java index 4b1727fc70..d2e1135662 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesResolver.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/PropertiesResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -84,16 +84,15 @@ public T resolveProperty(String name, T defaultValue) { } private T resolveProperty(final String name, Object defaultValue, final Class type) { - // Check runtime configuration first - Object result = configuration.getProperty(name); - if (result != null) { - defaultValue = result; - } - - // Check request properties next - result = delegate.getProperty(name); + // Check request properties property + Object result = delegate.getProperty(name); if (result == null) { - result = defaultValue; + + // Check runtime configuration next + result = configuration.getProperty(name); + if (result == null) { + result = defaultValue; + } } return (result == null) ? null : PropertiesHelper.convertValue(result, type);