Combined the commit messages since they were within 10 seconds of
each other.
r500454 | eross | 2007-01-26 19:53:59 -0600 (Fri, 26 Jan 2007) | 1 line
Bug 41313 - Add some helpful debug to this class
------------------------------------------------------------------------
r500453 | eross | 2007-01-26 19:53:49 -0600 (Fri, 26 Jan 2007) | 1 line
Bug 41313 - Add some helpful debug to this class
Index: src/java/org/apache/log4j/config/PropertySetter.java
===================================================================
23d22
< import org.apache.log4j.Logger;
84a84,85
> Class c = obj.getClass();
> getLogger().debug("introspect " + c);
86c87
< BeanInfo bi = Introspector.getBeanInfo(obj.getClass());
---
> BeanInfo bi = Introspector.getBeanInfo(c);
87a89,96
> StringBuffer sb = new StringBuffer();
> for (int i = 0; i < props.length; i++) {
> PropertyDescriptor d = props[i];
> String rw = (d.getWriteMethod() == null) ? "(ro)" : "";
> sb.append(" ").append(d.getName()).append(rw);
> }
> getLogger().debug(c + " properties: " + sb);
>
91c100
< "Failed to introspect " + obj + ": " + ex.getMessage());
---
> "Failed to introspect " + c + ": " + ex.getMessage());
Index: tests/src/java/org/apache/log4j/config/PropertySetterTest.java
===================================================================
0a1,28
> package org.apache.log4j.config;
>
> import java.util.Date;
>
> import junit.framework.TestCase;
>
> public class PropertySetterTest extends TestCase {
>
> public void testSetter() {
> /*
> Properties p = new Properties();
> p.put("log4j.debug", "true");
> p.put("log4j.appender.A", "");
> p.put("log4j.rootLogger", "DEBUG,A");
> PropertyConfigurator.configure(p);
> */
>
> Date d = new Date();
> PropertySetter ps = new PropertySetter(d);
> ps.setProperty("time", "0");
> assertEquals(0L, d.getTime());
>
> // no properties to set, warn
> PropertySetter ps2 = new PropertySetter(new Object());
> ps2.setProperty("class", "abc");
> }
>
> }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]