asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Maxon (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[release-0.8.9]: Check for nonexistant git.properties
Date Wed, 18 Jan 2017 23:59:08 GMT
Ian Maxon has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1453

Change subject: Check for nonexistant git.properties
......................................................................

Check for nonexistant git.properties

Change-Id: I1821416abb0387ee05b9add9f9c15798deed25d2
---
M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/53/1453/1

diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
index 492282c..75891fd 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
@@ -234,9 +234,15 @@
     private void loadAsterixBuildProperties() throws AsterixException {
         Properties gitProperties = new Properties();
         try {
-            gitProperties.load(getClass().getClassLoader().getResourceAsStream("git.properties"));
-            for (final String name : gitProperties.stringPropertyNames()) {
-                asterixBuildProperties.put(name, gitProperties.getProperty(name));
+            InputStream propertyStream = getClass().getClassLoader().getResourceAsStream("git.properties");
+            if(propertyStream != null) {
+                gitProperties.load(propertyStream);
+                for (final String name : gitProperties.stringPropertyNames()) {
+                    asterixBuildProperties.put(name, gitProperties.getProperty(name));
+                }
+            }
+            else{
+                LOGGER.info("Build properties not found on classpath. Version API will return
empty object");
             }
         } catch (IOException e) {
             throw new AsterixException(e);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1453
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1821416abb0387ee05b9add9f9c15798deed25d2
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: release-0.8.9
Gerrit-Owner: Ian Maxon <imaxon@apache.org>

Mime
View raw message