asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [07/12] asterixdb git commit: Check for nonexistant git.properties
Date Thu, 19 Jan 2017 03:35:31 GMT
Check for nonexistant git.properties

Change-Id: I1821416abb0387ee05b9add9f9c15798deed25d2
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1453
Reviewed-by: Michael Blow <mblow@apache.org>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/f3588fa2
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/f3588fa2
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/f3588fa2

Branch: refs/heads/release-0.8.9
Commit: f3588fa291368d3519acdbecf26528efb5720d6b
Parents: e2cf491
Author: Ian Maxon <imaxon@apache.org>
Authored: Wed Jan 18 15:58:18 2017 -0800
Committer: Ian Maxon <imaxon@apache.org>
Committed: Wed Jan 18 18:17:56 2017 -0800

----------------------------------------------------------------------
 .../apache/asterix/common/config/PropertiesAccessor.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/f3588fa2/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
----------------------------------------------------------------------
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..1f503ec 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,14 @@ public class PropertiesAccessor {
     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);


Mime
View raw message