commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Smith" <mich...@iammichael.org>
Subject RE: cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging LogSource.java
Date Wed, 16 Jan 2002 02:19:24 GMT
The 'catch' in this patch probably should be for a
java.lang.SecurityException (at most: java.lang.RuntimeException) and
not a Throwable.  You probably don't want to swallow any java.lang.Error
that may be generated by the enclosed code.  I'm a firm believer of
catching the most specific exception/error possible.

michael

> -----Original Message-----
> From: craigmcc@apache.org [mailto:craigmcc@apache.org]
> Sent: Tuesday, January 15, 2002 7:55 PM
> To: jakarta-commons-cvs@apache.org
> Subject: cvs commit:
> jakarta-commons/logging/src/java/org/apache/commons/logging
> LogSource.java
>
>
> craigmcc    02/01/15 16:54:51
>
>   Modified:    logging/src/java/org/apache/commons/logging
> LogSource.java
>   Log:
>   Make LogSource more applet-friendly by swallowing any
> security exception
>   thrown when System.getProperty() is called.
>
>   Submitted by:  Anthony Martin <Anthony@TRAMS.com>
>
>   Revision  Changes    Path
>   1.8       +8 -6
> jakarta-commons/logging/src/java/org/apache/commons/logging/Lo
> gSource.java
>
>   Index: LogSource.java
>   ===================================================================
>   RCS file:
> /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/
> logging/LogSource.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- LogSource.java	5 Jan 2002 22:40:40 -0000	1.7
>   +++ LogSource.java	16 Jan 2002 00:54:51 -0000	1.8
>   @@ -1,7 +1,7 @@
>    /*
>   - * $Header:
> /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/
> logging/LogSource.java,v 1.7 2002/01/05 22:40:40 craigmcc Exp $
>   - * $Revision: 1.7 $
>   - * $Date: 2002/01/05 22:40:40 $
>   + * $Header:
> /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/
> logging/LogSource.java,v 1.8 2002/01/16 00:54:51 craigmcc Exp $
>   + * $Revision: 1.8 $
>   + * $Date: 2002/01/16 00:54:51 $
>     *
>     *
> ====================================================================
>     *
>   @@ -92,7 +92,7 @@
>     * </ul>
>     *
>     * @author Rod Waldhoff
>   - * @version $Id: LogSource.java,v 1.7 2002/01/05 22:40:40
> craigmcc Exp $
>   + * @version $Id: LogSource.java,v 1.8 2002/01/16 00:54:51
> craigmcc Exp $
>     */
>    public class LogSource {
>
>   @@ -137,8 +137,10 @@
>            }
>
>            // Set the default Log implementation
>   -        String name =
>   -            System.getProperty("org.apache.commons.logging.log");
>   +        String name = null;
>   +        try {
>   +            name =
> System.getProperty("org.apache.commons.logging.log");
>   +        } catch (Throwable t) { }
>            if (name != null) {
>                try {
>                    setLogImplementation(name);
>
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
>



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