hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r374787 - /lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java
Date Fri, 03 Feb 2006 23:38:42 GMT
Author: cutting
Date: Fri Feb  3 15:38:41 2006
New Revision: 374787

URL: http://svn.apache.org/viewcvs?rev=374787&view=rev
Log:
Don't require final resoureces.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java?rev=374787&r1=374786&r2=374787&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/conf/Configuration.java Fri Feb  3 15:38:41
2006
@@ -325,9 +325,9 @@
     if (properties == null) {
       Properties defaults = new Properties();     // keep defaults separate
       Properties newProps = new Properties(defaults);
-      loadResources(defaults, defaultResources, false);
-      loadResources(newProps, appResources, false);
-      loadResources(newProps, finalResources, true);
+      loadResources(defaults, defaultResources, false, false);
+      loadResources(newProps, appResources, false, false);
+      loadResources(newProps, finalResources, true, true);
       properties = newProps;
     }
     return properties;
@@ -335,14 +335,14 @@
 
   private void loadResources(Properties props,
                              ArrayList resources,
-                             boolean reverse) {
+                             boolean reverse, boolean quiet) {
     ListIterator i = resources.listIterator(reverse ? resources.size() : 0);
     while (reverse ? i.hasPrevious() : i.hasNext()) {
-      loadResource(props, reverse ? i.previous() : i.next());
+      loadResource(props, reverse ? i.previous() : i.next(), quiet);
     }
   }
 
-  private void loadResource(Properties properties, Object name) {
+  private void loadResource(Properties properties, Object name, boolean quiet) {
     try {
       DocumentBuilder builder =
         DocumentBuilderFactory.newInstance().newDocumentBuilder();
@@ -363,6 +363,8 @@
       }
 
       if (doc == null) {
+        if (quiet)
+          return;
         throw new RuntimeException(name + " not found");
       }
 



Mime
View raw message