pinal-shah commented on code in PR #476:
URL: https://github.com/apache/atlas/pull/476#discussion_r2559994555
##########
intg/src/main/java/org/apache/atlas/ApplicationProperties.java:
##########
@@ -124,36 +126,67 @@ public static Configuration set(Configuration
configuration) throws AtlasExcepti
return instance;
}
- public static Configuration get(String fileName) throws AtlasException {
- String confLocation =
System.getProperty(ATLAS_CONFIGURATION_DIRECTORY_PROPERTY);
+ public static Configuration getConf(String propertyFileName) throws
AtlasException {
+ if (instance == null) {
+ synchronized (ApplicationProperties.class) {
+ if (instance == null) {
+ set(get(propertyFileName));
+ }
+ }
+ }
+ return instance;
+ }
+ public static Configuration getConf(Configuration clientConf) throws
AtlasException {
+ if (instance == null) {
+ synchronized (ApplicationProperties.class) {
+ if (instance == null) {
+ set(clientConf);
+ }
+ }
+ }
+ return instance;
+ }
+
+ public static Configuration get(String fileName) throws AtlasException {
try {
- URL url;
+ URL url = null;
+
+ Path path = null;
+ path = Paths.get(fileName);
- if (confLocation == null) {
- LOG.info("Looking for {} in classpath", fileName);
+ if (path != null && path.getParent() != null) {
Review Comment:
path is always != null, hence should be removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]