CDV ❯ AW set(..) pointcut fails with final fields
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Won't Fix
-
X-AspectWerkz
-
-
drb
-
Reporter: jboner
-
May 30, 2006
-
0
-
Watchers: 0
-
July 27, 2012
-
May 11, 2009
Description
@Set pc on final field breaks it but we should still support some constructs (f.e before / after)
might need change in the weaving model since Reflection cannot be use
see:
package test;
import java.lang.reflect.Field;
/** *
* @author <a href="mailto:[email protected]">Alexandre Vasseur</a>
*/
public class AlexRef {
public final double d = -1;
public static void main(String args[]) { try { Class cls = Class.forName(“test.AlexRef”); Field fld = cls.getField(“d”); fld.setAccessible(true); AlexRef f2obj = new AlexRef(); System.out.println(“d = “ + f2obj.d); fld.setDouble(f2obj, 12.34); System.out.println(“d = “ + f2obj.d); } catch (Throwable e) { System.err.println(e); } } }