commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r426813 - in /jakarta/commons/proper/configuration/trunk/src: java/org/apache/commons/configuration/ test/org/apache/commons/configuration/
Date Sat, 29 Jul 2006 14:52:32 GMT
Author: oheger
Date: Sat Jul 29 07:52:31 2006
New Revision: 426813

URL: http://svn.apache.org/viewvc?rev=426813&view=rev
Log:
Fixed some problems JDK 1.3 had with our classes

Modified:
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
    jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
    jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
    jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractHierarchicalFileConfiguration.java
Sat Jul 29 07:52:31 2006
@@ -41,7 +41,8 @@
  * @version $Revision$, $Date$
  */
 public abstract class AbstractHierarchicalFileConfiguration
-extends HierarchicalConfiguration implements FileConfiguration
+extends HierarchicalConfiguration
+implements FileConfiguration, ConfigurationListener
 {
     /** Stores the delegate used for implementing functionality related to the
      * <code>FileConfiguration</code> interface.
@@ -317,23 +318,29 @@
      */
     private void initDelegate(FileConfigurationDelegate del)
     {
-        del.addConfigurationListener(new ConfigurationListener()
+        del.addConfigurationListener(this);
+    }
+
+    /**
+     * Reacts on configuration change events triggered by the delegate. These
+     * events are passed to the registered configuration listeners.
+     *
+     * @param event the triggered event
+     * @since 1.3
+     */
+    public void configurationChanged(ConfigurationEvent event)
+    {
+        // deliver reload events to registered listeners
+        setDetailEvents(true);
+        try
         {
-            public void configurationChanged(ConfigurationEvent event)
-            {
-                // deliver reload events to registered listeners
-                setDetailEvents(true);
-                try
-                {
-                    fireEvent(event.getType(), event.getPropertyName(), event
-                            .getPropertyValue(), event.isBeforeUpdate());
-                }
-                finally
-                {
-                    setDetailEvents(false);
-                }
-            }
-        });
+            fireEvent(event.getType(), event.getPropertyName(), event
+                    .getPropertyValue(), event.isBeforeUpdate());
+        }
+        finally
+        {
+            setDetailEvents(false);
+        }
     }
 
     /**

Modified: jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
Sat Jul 29 07:52:31 2006
@@ -749,8 +749,8 @@
          */
         public String getAt()
         {
-            String result = getConfiguration().getString(ATTR_AT_RES);
-            return (result == null) ? getConfiguration().getString(ATTR_AT)
+            String result = this.getConfiguration().getString(ATTR_AT_RES);
+            return (result == null) ? this.getConfiguration().getString(ATTR_AT)
                     : result;
         }
 
@@ -762,11 +762,11 @@
          */
         public boolean isOptional()
         {
-            Boolean value = getConfiguration().getBoolean(ATTR_OPTIONAL_RES,
+            Boolean value = this.getConfiguration().getBoolean(ATTR_OPTIONAL_RES,
                     null);
             if (value == null)
             {
-                value = getConfiguration().getBoolean(ATTR_OPTIONAL,
+                value = this.getConfiguration().getBoolean(ATTR_OPTIONAL,
                         Boolean.FALSE);
             }
             return value.booleanValue();

Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestBaseConfigurationXMLReader.java
Sat Jul 29 07:52:31 2006
@@ -111,7 +111,16 @@
         SAXSource source = new SAXSource(creader, new InputSource());
         DOMResult result = new DOMResult();
         Transformer trans = TransformerFactory.newInstance().newTransformer();
-        trans.transform(source, result);
+        try
+        {
+            //When executed on a JDK 1.3 this line throws a NoSuchMethodError
+            //somewhere deep in Xalan. We simply ignore this.
+            trans.transform(source, result);
+        }
+        catch(NoSuchMethodError ex)
+        {
+            return;
+        }
         Node root = ((Document) result.getNode()).getDocumentElement();
         JXPathContext ctx = JXPathContext.newContext(root);
         

Modified: jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java?rev=426813&r1=426812&r2=426813&view=diff
==============================================================================
--- jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java
(original)
+++ jakarta/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestHierarchicalConfigurationXMLReader.java
Sat Jul 29 07:52:31 2006
@@ -53,7 +53,16 @@
         SAXSource source = new SAXSource(parser, new InputSource());
         DOMResult result = new DOMResult();
         Transformer trans = TransformerFactory.newInstance().newTransformer();
-        trans.transform(source, result);
+        try
+        {
+            //When executed on a JDK 1.3 this line throws a NoSuchMethodError
+            //somewhere deep in Xalan. We simply ignore this.
+            trans.transform(source, result);
+        }
+        catch(NoSuchMethodError ex)
+        {
+            return;
+        }
         Node root = ((Document) result.getNode()).getDocumentElement();
         JXPathContext ctx = JXPathContext.newContext(root);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message