incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r609670 - /incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java
Date Mon, 07 Jan 2008 16:26:47 GMT
Author: bdelacretaz
Date: Mon Jan  7 08:26:37 2008
New Revision: 609670

URL: http://svn.apache.org/viewvc?rev=609670&view=rev
Log:
For SLING-149: fail more gracefully if sling.properties is missing

Modified:
    incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java

Modified: incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java?rev=609670&r1=609669&r2=609670&view=diff
==============================================================================
--- incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java
(original)
+++ incubator/sling/trunk/launcher/app/src/main/java/org/apache/sling/launcher/app/Sling.java
Mon Jan  7 08:26:37 2008
@@ -335,7 +335,7 @@
      *         an error.
      */
     private Map<String, String> loadConfigProperties(
-            Map<String, String> propOverwrite) {
+            Map<String, String> propOverwrite) throws BundleException {
         // The config properties file is either specified by a system
         // property or it is in the same directory as the Felix JAR file.
         // Try to load it from one of these places.
@@ -511,8 +511,12 @@
      * @param prefix The prefix of properties to handle.
      */
     private void resolve(Map<String, String> props, String osgiProp,
-            String prefix) {
-        StringBuffer prop = new StringBuffer(props.get(osgiProp));
+            String prefix) throws BundleException {
+        final String propVal = props.get(osgiProp);
+        if(propVal == null) {
+            throw new BundleException(osgiProp + " property is null, Sling.resolve() fails");
+        }
+        StringBuffer prop = new StringBuffer(propVal);
         boolean mod = false;
         for (Entry<String, String> pEntry : props.entrySet()) {
             String key = pEntry.getKey();



Mime
View raw message