Methods in the trait become volatile when mixed in specific classes in 2.9.0-1, but not in 2.8.1

I noticed this violation (for me its use with OGNL) changed in 2.9.0-1:

I find that in 2.9 the methods declared in the tag become unstable when mixed in a class:

Example in 2.9.0-1

import java.lang.reflect.Modifier trait SuperTrait { def getKnoll = "Kanutten" } class KlassWithKnoll extends SuperTrait { def getKnall = "Mars" } val qsc = classOf[KlassWithKnoll] val knollGetter = qsc.getDeclaredMethod("getKnoll") println("isVolatile: " + Modifier.isVolatile(knollGetter.getModifiers())) 

Will print

 isVolatile: true 

But in 2.8.1:

displays

 isVolatile: false 

Actually this changes for me, as OGNL refuses to execute volatile (why I don't know) in its expressions.

So, my question; Why was this change made?

+4
source share
1 answer

There is no such thing as a volatile method. You see that flag 0x0040 is set, which is ACC_VOLATILE for fields, but ACC_BRIDGE for methods. Since the Modifier.isVolatile method accepts Int, it cannot really tell you that what you are asking does not make sense.

+3
source

All Articles