Bug 124808 - [generics] detecting field-get of field of parameterized type.
Summary: [generics] detecting field-get of field of parameterized type.
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 1.5.1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-22 11:12 EST by Misha Kantarovich CLA
Modified: 2006-01-24 06:14 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 Misha Kantarovich CLA 2006-01-22 11:12:27 EST
Hi,

Here is the second generics issue:

Java code:
==========

public class Test<T extends Integer> {
	Set<T> ints = new HashSet<T>();

	public Set<T> foo() {
		return ints;
	}

	public static void main(String[] args) {
		Test<Integer> t = new Test<Integer>();
		Set<Integer> ints = t.foo();
	}
}

Aspect:
=======
public privileged aspect TestAspect {

    pointcut gettingMemberCollection(Test t) :
                   target(t) &&
                   get(!public Set<Number+> com.mprv.secsph.*.*) &&
                   !within(TestAspect);

	after (Test test) : gettingMemberCollection(test) {
		System.out.println("GO Aspects!");
	}
}

Compiler output:
================
warning at after (Test test) : gettingMemberCollection(test) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/root/IdeaProjects/aspectsTest/src/com/mprv/secsph/TestAspect.aj:19:0::0 advice defined in com.mprv.secsph.TestAspect has not been applied [Xlint:adviceDidNotMatch]


I would expect "gettingMemberCollection" to catch access to "ints" member of "Test" ...

Thanks a lot!
Misha.
Comment 1 Andrew Clement CLA 2006-01-23 09:23:49 EST
fix checked in.  changed: ExactTypePattern and TypePattern.
Comment 2 Misha Kantarovich CLA 2006-01-23 09:29:56 EST
(In reply to comment #1)
> fix checked in.  changed: ExactTypePattern and TypePattern.

I have no words ... :)

Thanks for the fixes!

Comment 3 Andrew Clement CLA 2006-01-24 06:14:27 EST
fix available.