Community
Participate
Working Groups
This is an error in cvs head and in 1.1.0. It works correctly (no compiler errors) in 1.0.6. If you get rid of the within(..) restriction, the code works. Output: C:\eclipse\workspace\atrack>ajc -d debug @narrow.lst C:\eclipse\workspace\atrack\src\test\NoSoftener.java:17 Unhandled exception type NoSuchMethodException Constructor ctor = clazz.getConstructor(keyArgType); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 error Source: /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ package org.atrack.model.error.impl; import test.NoSoftener; package test; import java.lang.reflect.Constructor; /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ /** * @author Ron Bodkin * */ public class NoSoftener { public void foo(Class clazz) { Class[] keyArgType = {}; Constructor ctor = clazz.getConstructor(keyArgType); } } /* * Created on Sep 8, 2003 * * Copyright (c) 2003 New Aspects of Security. All Rights Reserved. */ package org.atrack.model.error.impl; import test.NoSoftener; /** * @author Ron Bodkin * */ public aspect Softener { public pointcut scope() : within(NoSoftener); public pointcut callsThrowingChecked() : call(* *(..)) && scope(); declare soft: NoSuchMethodException: callsThrowingChecked(); }
contributing the sources per the CPL: package test; import java.lang.reflect.Constructor; /** * @author Ron Bodkin */ public class NoSoftener { public void foo(Class clazz) { Class[] keyArgType = {}; Constructor ctor = clazz.getConstructor(keyArgType); } } --- package org.atrack.model.error.impl; import test.NoSoftener; /** * @author Ron Bodkin */ public aspect Softener { public pointcut scope() : within(NoSoftener); public pointcut callsThrowingChecked() : call(* *(..)) && scope(); declare soft: NoSuchMethodException: callsThrowingChecked(); }
the test provided below is now in the tree, and this bug should be fixed in the current cvs head