From 356d994e3905dd6b3287aacf99167ac4334e478b Mon Sep 17 00:00:00 2001 From: mercyblitz Date: Wed, 3 Oct 2018 21:58:09 +0800 Subject: [PATCH] Fixed PMD issue --- .../NacosDefaultPropertySourceEnvironmentPostProcessor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java b/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java index 9d044b310..eaf7594b2 100644 --- a/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java +++ b/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java @@ -97,7 +97,8 @@ public class NacosDefaultPropertySourceEnvironmentPostProcessor implements Envir ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(resourceLoader); Resource[] resources = resourcePatternResolver.getResources(RESOURCE_LOCATION_PATTERN); for (Resource resource : resources) { - if (resource.exists()) { // Add if exists + // Add if exists + if (resource.exists()) { String internalName = String.valueOf(resource.getURL()); propertySource.addPropertySource(new ResourcePropertySource(internalName, new EncodedResource(resource, FILE_ENCODING)));