Skip to content

Commit 79b050d

Browse files
vishwab1claude
andauthored
Fix ConfigProperties to resolve env variable placeholders via Spring Environment (#390)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 72f0c28 commit 79b050d

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/main/java/com/iemr/common/utils/config/ConfigProperties.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,21 @@ public static String getPropertyByName(String propertyName)
144144
String result = null;
145145
try
146146
{
147-
if (properties == null)
147+
if (environment != null)
148148
{
149-
initalizeProperties();
149+
result = environment.getProperty(propertyName);
150+
}
151+
if (result == null)
152+
{
153+
if (properties == null)
154+
{
155+
initalizeProperties();
156+
}
157+
result = properties.getProperty(propertyName).trim();
158+
} else
159+
{
160+
result = result.trim();
150161
}
151-
result = properties.getProperty(propertyName).trim();
152162
} catch (Exception e)
153163
{
154164
logger.error(propertyName + " retrival failed.", e);

0 commit comments

Comments
 (0)