commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@apache.org
Subject cvs commit: jakarta-commons/discovery/src/java/org/apache/commons/discovery ResourceDiscovery.java
Date Wed, 21 Aug 2002 20:58:00 GMT
rsitze      2002/08/21 13:58:00

  Modified:    discovery/src/java/org/apache/commons/discover/jdk
                        JDKHooks.java
               discovery/src/java/org/apache/commons/discovery
                        ResourceDiscovery.java
  Log:
  minor cleanup
  
  Revision  Changes    Path
  1.2       +6 -5      jakarta-commons/discovery/src/java/org/apache/commons/discover/jdk/JDKHooks.java
  
  Index: JDKHooks.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/discovery/src/java/org/apache/commons/discover/jdk/JDKHooks.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JDKHooks.java	21 Aug 2002 20:31:41 -0000	1.1
  +++ JDKHooks.java	21 Aug 2002 20:58:00 -0000	1.2
  @@ -69,7 +69,11 @@
    * @author Richard A. Sitze
    */
   public abstract class JDKHooks {
  -    private static JDKHooks jdkHooks = null;
  +    private static final JDKHooks jdkHooks;
  +    
  +    static {
  +        jdkHooks = new JDK12Hooks();
  +    }
       
       protected JDKHooks() { }
       
  @@ -78,10 +82,7 @@
        * 
        * TODO: add logic to detect JDK level.
        */
  -    public static JDKHooks getJDKHooks() {
  -        if (jdkHooks == null) {
  -            jdkHooks = new JDK12Hooks();
  -        }
  +    public static final JDKHooks getJDKHooks() {
           return jdkHooks;
       }
   
  
  
  
  1.2       +7 -4      jakarta-commons/discovery/src/java/org/apache/commons/discovery/ResourceDiscovery.java
  
  Index: ResourceDiscovery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/discovery/src/java/org/apache/commons/discovery/ResourceDiscovery.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ResourceDiscovery.java	21 Aug 2002 20:31:40 -0000	1.1
  +++ ResourceDiscovery.java	21 Aug 2002 20:58:00 -0000	1.2
  @@ -82,22 +82,25 @@
    */
   public class ResourceDiscovery
   {
  +    /**
  +     * this doesn't buy anything except +/- style (subjective).
  +     */
       protected static JDKHooks jdkHooks = JDKHooks.getJDKHooks();
       
       protected Vector classLoaders=new Vector();
       
  -    /** Construct a new service discoverer
  +    /** Construct a new resource discoverer
        */
  -    protected ResourceDiscovery() {
  +    public ResourceDiscovery() {
       }
   
       /**
  -     * Creates a new instance of a ResourceDiscovery instance.
  +     * @deprecated
        */
       public static ResourceDiscovery newInstance() {
           // This is _not_ singleton.
           return new ResourceDiscovery();
  -        // XXX Check if JDK1.1 is used and return the specific version 
  +        // XXX Check if JDK1.1 is used no longer necessary.
       }
   
       /** Specify a new class loader to be used in searching.
  
  
  

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


Mime
View raw message