开发者

Why does OGNL ignore synthetic and volatile methods?

开发者 https://www.devze.com 2023-03-22 05:12 出处:网络
In OgnlRuntime we have: static boolean isMethodCallable(Method m) { if ((isJdk15() && m.isSynthetic()) || Modifier.isVolatile(m.getModifiers()))

In OgnlRuntime we have:

static boolean isMethodCallable(Method m)
{
    if ((isJdk15() && m.isSynthetic()) || Modifier.isVolatile(m.getModifiers()))
        return false;

    return true;
}

Which get called in getDeclaredMethods() and the method is skipped if isMethodCallable() returns true. This means that all methods in a scala-trait (starting from scala-2.9) never will get executed.

What is the reason behind skipping volatile (and for that matter synthetic, compiler-generated) methods?

Related question (by me): Methods in trait become volatile methods when mixed in concre开发者_Python百科te classes in 2.9.0-1 but not 2.8.1

0

精彩评论

暂无评论...
验证码 换一张
取 消