// the iterator is on a list and the loop body does list.remove
// which is forbidden
List methodMetaDataListFiltered = new ArrayList();
for (Iterator it2 = methodMetaDataList.iterator(); it2.hasNext();) {
MethodMetaData methodMetaData = (MethodMetaData)it2.next();
// remove the ___AW_getUuid, ___AW_getMetaData, ___AW_addMetaData and class$ methods
// as well as some other methods before sorting the method list
if (!(
methodMetaData.getName().equals("equals") ||
methodMetaData.getName().equals("hashCode") ||
methodMetaData.getName().equals("getClass") ||
methodMetaData.getName().equals("toString") ||
methodMetaData.getName().equals("wait") ||
methodMetaData.getName().equals("notify") ||
methodMetaData.getName().equals("notifyAll") ||
methodMetaData.getName().equals(
TransformationUtil.GET_UUID_METHOD) ||
methodMetaData.getName().equals(
TransformationUtil.GET_UUID_METHOD) ||
methodMetaData.getName().equals(
TransformationUtil.GET_META_DATA_METHOD) ||
methodMetaData.getName().equals(
TransformationUtil.SET_META_DATA_METHOD) ||
methodMetaData.getName().equals(
TransformationUtil.CLASS_LOOKUP_METHOD) ||
methodMetaData.getName().startsWith(
TransformationUtil.ORIGINAL_METHOD_PREFIX))) {
methodMetaDataListFiltered.add(methodMetaData);
}
}
// sort the list so that we can enshure that the indexes are in synch
// see AbstractIntroductionContainerStrategy#AbstractIntroductionContainerStrategy
Collections.sort(methodMetaDataListFiltered, MethodComparator.
getInstance(MethodComparator.METHOD_META_DATA));
int methodIndex = -1; // start with -1 since the method array is 0 indexed
for (Iterator it2 = methodMetaDataListFiltered.iterator(); it2.hasNext();) {
MethodMetaData methodMetaData = (MethodMetaData)it2.next();
if (methodMetaData.getReturnType() == null) {
continue; // constructor => skip
}
methodIndex++;
createProxyMethod(
cg, cpg, factory,