Community
Participate
Working Groups
Not matching printf(String, Object...) as I can foo({same}) using call(void {blah}(..)). (Sorry if this is a dup or fixed in head - decide to report sooner rather than investigate next week.) --------------------------------------- package bugs; import java.io.PrintStream; import junit.framework.TestCase; public class CallWildcard extends TestCase { static boolean foo; static boolean printf; public void testWildcard() { assertFalse(foo); assertFalse(printf); C.foo("", null); System.out.printf("format %s", "ok"); assertTrue(foo); // ok assertTrue(printf); // fails } static class C { static void foo(String s, Object...objects) {} //static void foo(String s, Object[] objects) {} } static aspect A { before() : call(void C.foo(..)) { foo = true; } before() : call(void PrintStream.printf(..)) { printf = true; } } }
take a quick look ...
Looking into this in more depth, the method PrintStream.printf(...) method returns a PrintStream rather than void. Changing before() : call(void PrintStream.printf(..)) { printf = true; } to be: before() : call(PrintStream PrintStream.printf(..)) { printf = true; } means we now match as expected.
doh! Thanks for your time...