Community
Participate
Working Groups
Created attachment 249664 [details] Eclipse project reproducing the problem Andrew Eisenberg and I were dealing with this problem: http://stackoverflow.com/questions/27673960/aspectj-and-mapstring-object-array I have taken some time to create a reproduceable Eclipse project (see attachment). Problem description: In an annotation-style aspect targetting a method with a parameter type such as Map<String, Object>[] - please note the array, it only happens when the type is an array the the generic type is specific, not raw - Ajc spits out a warning such as: [warning] can not resolve this member: void de.scrum_master.app.SampleUtil.sampleMethod(java.util.Map[]) [Xlint:unresolvableMember]
Created attachment 249665 [details] Screenshot of relevant Eclipse setting
Created attachment 249666 [details] Screenshot of Eclipse compiler warning
This appears to be due to some code that is erasing generics which fails to do its job if the generic type is an array form (the array hides the generic and this code doesn't think it has to do anything). It also seems to require that a call joinpoint is involved because that requires extra 'resolution' (chasing down what was being called) where an execution joinpoint has all the information right there and doesn't go through the broken generics erasing process. Thanks for the testcase, extremely useful.
(In reply to Andrew Clement from comment #3) > This appears to be due to some code that is erasing generics which fails to > do its job if the generic type is an array form (the array hides the generic > and this code doesn't think it has to do anything). It also seems to require > that a call joinpoint is involved because that requires extra 'resolution' > (chasing down what was being called) where an execution joinpoint has all > the information right there and doesn't go through the broken generics > erasing process. > > Thanks for the testcase, extremely useful. Hi Andrew, I don't understand what is the solution of this problem. I faced the same issue in my project. Is the use of generics arrays as parameter wrong? Or is this warning irrelevant? In generics, I have to use the generics arrays in these ways, but I want to avoid this warning... Thank you, J.
The bug was marked fixed in 1.8.5 so the problem mentioned in the testcase that Alexander created, and my fix for that are all in the code now. I just downloaded the testcase again - got the problem in 1.8.4 and no problem in 1.8.5. What version of AspectJ are you using? Can you provide me a code sample that is failing in the same way for you on a recent AspectJ? Or, what about the error - specifically what member are you seeing as unresolved and what is the parameter/return signature - where are the generics involved in it?