Bug 114729 - Unable to pick out system method-call with varargs
Summary: Unable to pick out system method-call with varargs
Status: RESOLVED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M4   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 04:42 EST by Wes Isberg CLA
Modified: 2005-11-08 15:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2005-11-02 04:42:28 EST
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;
		}
	}
}
Comment 1 Andrew Clement CLA 2005-11-08 03:51:32 EST
take a quick look ...
Comment 2 Helen Beeken CLA 2005-11-08 09:34:54 EST
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.
Comment 3 Wes Isberg CLA 2005-11-08 15:15:02 EST
doh!

Thanks for your time...