velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11924] - Add Support for Static Utility Classes
Date Thu, 22 Aug 2002 13:47:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11924>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11924

Add Support for Static Utility Classes





------- Additional Comments From jwseach@yahoo.com  2002-08-22 13:47 -------
I haven't tested this, but would changing UberspectImpl.getMethod() to 
something like this work:


public VelMethod getMethod(Object obj, String methodName,
        Object[] args, Info i)
        throws Exception
{
    if (obj == null)
        return null;

    Class c = obj.getClass();
    Method m = null;

    if (c == java.lang.Class)
    {
        m = introspector.getMethod(obj, methodName, args);
        if (!java.lang.reflect.Modifier.isStatic(m.getModifiers()))
        {
            m = null;
        }
    }
    else
    {
        m = introspector.getMethod(c, methodName, args);
    }


    return (m != null) ? new VelMethodImpl(m) : null;
}

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


Mime
View raw message