commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: [PATCH 1/1] daemon : Fix DaemonLoader to check that class implements 'Daemon' interface
Date Thu, 19 Aug 2004 05:46:05 GMT
Patch applied.  Thanks much!

"Nigel Rantor" <wiggly@wiggly.org> wrote in message
news:41221F2D.6090308@wiggly.org...
> Index: DaemonLoader.java
> ===================================================================
> RCS file:
>
/home/cvspublic/jakarta-commons/daemon/src/java/org/apache/commons/daemon/su
pport/DaemonLoader.java,v
> retrieving revision 1.4
> diff -u -r1.4 DaemonLoader.java
> --- DaemonLoader.java 27 Feb 2004 07:57:51 -0000 1.4
> +++ DaemonLoader.java 17 Aug 2004 13:48:11 -0000
> @@ -110,14 +110,9 @@
>               if (c==null) throw new ClassNotFoundException(cn);
>
>               /* Check interface */
> -            Class[] interf = c.getInterfaces();
> -            boolean isdaemon = false;
> -            if ( interf != null ) {
> -              for(int i=0;i<interf.length;i++) {
> -                if
> (interf[i].getName().equals("org.apache.commons.daemon.Daemon"))
> -                  isdaemon = true;
> -              }
> -            }
> +            Class daemon_class =
> Class.forName("org.apache.commons.daemon.Daemon");
> +            boolean isdaemon = daemon_class.isAssignableFrom(c);
> +
>               /* Check methods */
>               Class[] myclass = new Class[1];
>               if (isdaemon) {




---------------------------------------------------------------------
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