Class[] adviceSignature = advMethod.getParameterTypes();
Object[] actualParams = new Object[adviceSignature.length];
for (int i =0; i<adviceSignature.length; i++) {
Object crtLocParam = localThis;
if (i>0) {
try { crtLocParam=localPar[i-1]; }
catch (IndexOutOfBoundsException e) {
// we can actually ignore this case. It happens
// if the advice signature looks like (XXX,REST)
// but the joinpointed method has no parameters.
// then localParams(0) does not exist.
// formally, i set crtLocParam to zero
crtLocParam=null;
}
}
if (Wildcard.class.isAssignableFrom(adviceSignature[i])) {
Wildcard oscarWild;
try {
oscarWild = (Wildcard)adviceSignature[i].newInstance();
if (i < localPar.length + 1 &&
(crtLocParam == null || oscarWild.isAssignableFrom(crtLocParam.getClass())))
oscarWild.setObject(crtLocParam);
else {
Object rest = new Object[localPar.length - i +1];
System.arraycopy(localPar,i-1,rest,0,localPar.length -i +1);
oscarWild.setObject(rest);
}
}
// the Wilcard specification states that wildcard classes