You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sk...@apache.org on 2006/04/16 23:30:21 UTC

svn commit: r394563 - /jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java

Author: skitching
Date: Sun Apr 16 14:30:19 2006
New Revision: 394563

URL: http://svn.apache.org/viewcvs?rev=394563&view=rev
Log:
Remove recently-added implementation of getResources. As javadoc already stated,
this can't be implemented because in java 1.4 getResources is final :-(. Unit
tests that care about getResources() order will just have to use parentFirst=true.

Modified:
    jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java

Modified: jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java?rev=394563&r1=394562&r2=394563&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java (original)
+++ jakarta/commons/proper/logging/trunk/src/test/org/apache/commons/logging/PathableClassLoader.java Sun Apr 16 14:30:19 2006
@@ -98,6 +98,10 @@
      * child-first lookup instead, to allow the components to override libs
      * which are visible in shared classloaders provided by the container.
      * <p>
+     * Note that the method getResources always behaves as if parentFirst=true,
+     * because of limitations in java 1.4; see the javadoc for method
+     * getResourcesInOrder for details.
+     * <p>
      * This value defaults to true.
      */
     public void setParentFirst(boolean state) {
@@ -237,11 +241,14 @@
     }
     
     /**
-     * Same as parent class method except that when parentFirst is false
-     * any resources in the local classpath are returned before resources
-     * in the parent.
+     * Emulate a proper implementation of getResources which respects the
+     * setting for parentFirst.
+     * <p>
+     * Note that it's not possible to override the inherited getResources, as
+     * it's declared final in java1.4 (thought that's been removed for 1.5).
+     * The inherited implementation always behaves as if parentFirst=true.
      */
-    public Enumeration getResources(String name) throws IOException {
+    public Enumeration getResourcesInOrder(String name) throws IOException {
         if (parentFirst) {
             return super.getResources(name);
         } else {



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