~ubuntu-branches/ubuntu/wily/aspectj/wily-proposed

« back to all changes in this revision

Viewing changes to org.aspectj/modules/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-03-15 23:54:31 UTC
  • mfrom: (1.2.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110315235431-iq2gxbsx08kpwuiw
* New upstream release.
* Updated Standards-Version to 3.9.1 (no changes needed).
* Fix local Javadoc links:
  - d/patches/07_javadoc_links.diff: Use locally installed
   javadoc packages and hyperlink with them.
  - d/control: Add B-D on default-java-doc and libasm3-java-doc.
* d/control: Drop B-D on itself (our new bootstrap infrastructure doesn't need
  that anymore).
* Split packages into :
  - aspectj: only contains CLI tools.
  - libaspectj-java: JAR librairies for /usr/share/java.
  - libaspectj-java-doc: 4 API's Javadoc.
  - aspectj-doc: Programming Guides and SDK Documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
package org.aspectj.weaver.bcel;
15
15
 
16
16
import java.lang.reflect.Modifier;
 
17
import java.util.ArrayList;
 
18
import java.util.HashMap;
17
19
import java.util.HashSet;
18
20
import java.util.Iterator;
19
21
import java.util.List;
32
34
import org.aspectj.apache.bcel.generic.InstructionList;
33
35
import org.aspectj.apache.bcel.generic.InvokeInstruction;
34
36
import org.aspectj.apache.bcel.generic.Type;
 
37
import org.aspectj.asm.AsmManager;
 
38
import org.aspectj.asm.IProgramElement;
35
39
import org.aspectj.bridge.IMessage;
36
40
import org.aspectj.bridge.ISourceLocation;
37
41
import org.aspectj.bridge.Message;
45
49
import org.aspectj.weaver.BCException;
46
50
import org.aspectj.weaver.ConcreteTypeMunger;
47
51
import org.aspectj.weaver.Member;
 
52
import org.aspectj.weaver.MemberUtils;
48
53
import org.aspectj.weaver.MethodDelegateTypeMunger;
49
54
import org.aspectj.weaver.NameMangler;
50
55
import org.aspectj.weaver.NewConstructorTypeMunger;
133
138
                }
134
139
 
135
140
                if (changed && worthReporting) {
136
 
                        AsmRelationshipProvider.addRelationship(((BcelWorld) getWorld()).getModelAsAsmManager(), weaver.getLazyClassGen()
137
 
                                        .getType(), munger, getAspectType());
 
141
                        ResolvedType declaringAspect = null;
 
142
                        AsmManager model = ((BcelWorld) getWorld()).getModelAsAsmManager();
 
143
                        if (model != null) {
 
144
                                if (munger instanceof NewParentTypeMunger) {
 
145
                                        NewParentTypeMunger nptMunger = (NewParentTypeMunger) munger;
 
146
                                        declaringAspect = nptMunger.getDeclaringType();
 
147
                                        if (declaringAspect.isParameterizedOrGenericType()) {
 
148
                                                declaringAspect = declaringAspect.getRawType();
 
149
                                        }
 
150
                                        ResolvedType thisAspect = getAspectType();
 
151
                                        AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, thisAspect);
 
152
 
 
153
                                        // Add a relationship on the actual declaring aspect too
 
154
                                        if (!thisAspect.equals(declaringAspect)) {
 
155
                                                // Might be the case the declaring aspect is generic and thisAspect is parameterizing it. In that case
 
156
                                                // record the actual parameterizations
 
157
 
 
158
                                                ResolvedType target = weaver.getLazyClassGen().getType();
 
159
                                                ResolvedType newParent = nptMunger.getNewParent();
 
160
                                                IProgramElement thisAspectNode = model.getHierarchy().findElementForType(thisAspect.getPackageName(),
 
161
                                                                thisAspect.getClassName());
 
162
                                                Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
 
163
                                                if (declareParentsMap == null) {
 
164
                                                        declareParentsMap = new HashMap<String, List<String>>();
 
165
                                                        thisAspectNode.setDeclareParentsMap(declareParentsMap);
 
166
                                                }
 
167
                                                String tname = target.getName();
 
168
                                                String pname = newParent.getName();
 
169
                                                List<String> newparents = declareParentsMap.get(tname);
 
170
                                                if (newparents == null) {
 
171
                                                        newparents = new ArrayList<String>();
 
172
                                                        declareParentsMap.put(tname, newparents);
 
173
                                                }
 
174
                                                newparents.add(pname);
 
175
                                                AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, declaringAspect);
 
176
                                        }
 
177
                                } else {
 
178
                                        declaringAspect = getAspectType();
 
179
                                        AsmRelationshipProvider.addRelationship(model, weaver.getLazyClassGen().getType(), munger, declaringAspect);
 
180
                                }
 
181
                        }
138
182
                }
139
183
 
140
184
                // TAG: WeavingMessage
151
195
                                // if doing parents munging at compile time only...
152
196
                                NewParentTypeMunger parentTM = (NewParentTypeMunger) munger;
153
197
                                if (parentTM.isMixin()) {
154
 
                                        weaver.getWorld().getMessageHandler().handleMessage(
155
 
                                                        WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_MIXIN,
156
 
                                                                        new String[] { parentTM.getNewParent().getName(), fName,
157
 
                                                                                        weaver.getLazyClassGen().getType().getName(), tName }, weaver.getLazyClassGen()
158
 
                                                                                        .getClassName(), getAspectType().getName()));
 
198
                                        weaver.getWorld()
 
199
                                                        .getMessageHandler()
 
200
                                                        .handleMessage(
 
201
                                                                        WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_MIXIN, new String[] {
 
202
                                                                                        parentTM.getNewParent().getName(), fName, weaver.getLazyClassGen().getType().getName(),
 
203
                                                                                        tName }, weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
159
204
                                } else {
160
205
                                        if (parentTM.getNewParent().isInterface()) {
161
 
                                                weaver.getWorld().getMessageHandler().handleMessage(
162
 
                                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSIMPLEMENTS,
163
 
                                                                                new String[] { weaver.getLazyClassGen().getType().getName(), tName,
164
 
                                                                                                parentTM.getNewParent().getName(), fName },
165
 
                                                                                weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
 
206
                                                weaver.getWorld()
 
207
                                                                .getMessageHandler()
 
208
                                                                .handleMessage(
 
209
                                                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSIMPLEMENTS,
 
210
                                                                                                new String[] { weaver.getLazyClassGen().getType().getName(), tName,
 
211
                                                                                                                parentTM.getNewParent().getName(), fName }, weaver.getLazyClassGen()
 
212
                                                                                                                .getClassName(), getAspectType().getName()));
166
213
                                        } else {
167
 
                                                weaver.getWorld().getMessageHandler().handleMessage(
168
 
                                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSEXTENDS, new String[] {
169
 
                                                                                weaver.getLazyClassGen().getType().getName(), tName, parentTM.getNewParent().getName(),
170
 
                                                                                fName }));
 
214
                                                weaver.getWorld()
 
215
                                                                .getMessageHandler()
 
216
                                                                .handleMessage(
 
217
                                                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSEXTENDS,
 
218
                                                                                                new String[] { weaver.getLazyClassGen().getType().getName(), tName,
 
219
                                                                                                                parentTM.getNewParent().getName(), fName }));
171
220
                                                // TAG: WeavingMessage DECLARE PARENTS: EXTENDS
172
221
                                                // reportDeclareParentsMessage(WeaveMessage.
173
222
                                                // WEAVEMESSAGE_DECLAREPARENTSEXTENDS,sourceType,parent);
185
234
                                        kindString = "member class";
186
235
                                        fromString = fName;
187
236
                                }
188
 
                                weaver.getWorld().getMessageHandler().handleMessage(
189
 
                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ITD, new String[] {
190
 
                                                                weaver.getLazyClassGen().getType().getName(), tName, kindString, getAspectType().getName(),
191
 
                                                                fromString }, weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
 
237
                                weaver.getWorld()
 
238
                                                .getMessageHandler()
 
239
                                                .handleMessage(
 
240
                                                                WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ITD, new String[] {
 
241
                                                                                weaver.getLazyClassGen().getType().getName(), tName, kindString, getAspectType().getName(),
 
242
                                                                                fromString }, weaver.getLazyClassGen().getClassName(), getAspectType().getName()));
192
243
                        }
193
244
                }
194
245
 
215
266
         * For a long time, AspectJ did not allow binary weaving of declare parents. This restriction is now lifted but could do with
216
267
         * more testing!
217
268
         */
218
 
        private boolean mungeNewParent(BcelClassWeaver weaver, NewParentTypeMunger munger) {
 
269
        private boolean mungeNewParent(BcelClassWeaver weaver, NewParentTypeMunger typeTransformer) {
219
270
                LazyClassGen newParentTarget = weaver.getLazyClassGen();
220
 
                ResolvedType newParent = munger.getNewParent();
221
 
 
222
 
                boolean cont = true; // Set to false when we error, so we don't actually
223
 
                // *do* the munge
224
 
                cont = enforceDecpRule1_abstractMethodsImplemented(weaver, munger.getSourceLocation(), newParentTarget, newParent);
225
 
                cont = enforceDecpRule2_cantExtendFinalClass(weaver, munger.getSourceLocation(), newParentTarget, newParent) && cont;
226
 
 
227
 
                List methods = newParent.getMethodsWithoutIterator(false, true, false);
228
 
                for (Iterator iter = methods.iterator(); iter.hasNext();) {
229
 
                        ResolvedMember superMethod = (ResolvedMember) iter.next();
230
 
                        if (!superMethod.getName().equals("<init>")) {
231
 
                                LazyMethodGen subMethod = findMatchingMethod(newParentTarget, superMethod);
 
271
                ResolvedType newParent = typeTransformer.getNewParent();
 
272
 
 
273
                boolean performChange = true;
 
274
                performChange = enforceDecpRule1_abstractMethodsImplemented(weaver, typeTransformer.getSourceLocation(), newParentTarget,
 
275
                                newParent);
 
276
                performChange = enforceDecpRule2_cantExtendFinalClass(weaver, typeTransformer.getSourceLocation(), newParentTarget,
 
277
                                newParent) && performChange;
 
278
 
 
279
                List<ResolvedMember> methods = newParent.getMethodsWithoutIterator(false, true, false);
 
280
                for (ResolvedMember method : methods) {
 
281
                        if (!method.getName().equals("<init>")) {
 
282
                                LazyMethodGen subMethod = findMatchingMethod(newParentTarget, method);
232
283
                                // FIXME asc is this safe for all bridge methods?
233
284
                                if (subMethod != null && !subMethod.isBridgeMethod()) {
234
 
                                        if (!(subMethod.isSynthetic() && superMethod.isSynthetic())) {
235
 
                                                if (!(subMethod.isStatic() && subMethod.getName().startsWith("access$"))) { // ignore generated
236
 
                                                        // accessors
237
 
                                                        cont = enforceDecpRule3_visibilityChanges(weaver, newParent, superMethod, subMethod) && cont;
238
 
                                                        cont = enforceDecpRule4_compatibleReturnTypes(weaver, superMethod, subMethod) && cont;
239
 
                                                        cont = enforceDecpRule5_cantChangeFromStaticToNonstatic(weaver, munger.getSourceLocation(),
240
 
                                                                        superMethod, subMethod)
241
 
                                                                        && cont;
 
285
                                        if (!(subMethod.isSynthetic() && method.isSynthetic())) {
 
286
                                                if (!(subMethod.isStatic() && subMethod.getName().startsWith("access$"))) {
 
287
                                                        // ignore generated accessors
 
288
                                                        performChange = enforceDecpRule3_visibilityChanges(weaver, newParent, method, subMethod)
 
289
                                                                        && performChange;
 
290
                                                        performChange = enforceDecpRule4_compatibleReturnTypes(weaver, method, subMethod) && performChange;
 
291
                                                        performChange = enforceDecpRule5_cantChangeFromStaticToNonstatic(weaver,
 
292
                                                                        typeTransformer.getSourceLocation(), method, subMethod)
 
293
                                                                        && performChange;
242
294
                                                }
243
295
                                        }
244
296
                                }
245
297
                        }
246
298
                }
247
 
                if (!cont) {
248
 
                        return false; // A rule was violated and an error message already
249
 
                        // reported
 
299
                if (!performChange) {
 
300
                        // A rule was violated and an error message already reported
 
301
                        return false;
250
302
                }
251
303
 
252
 
                if (newParent.isClass()) { // Changing the supertype
 
304
                if (newParent.isClass()) {
 
305
                        // Changing the supertype
253
306
                        if (!attemptToModifySuperCalls(weaver, newParentTarget, newParent)) {
254
307
                                return false;
255
308
                        }
256
309
                        newParentTarget.setSuperClass(newParent);
257
 
                } else { // Adding a new interface
 
310
                } else {
 
311
                        // Add a new interface
258
312
                        newParentTarget.addInterface(newParent, getSourceLocation());
259
313
                }
260
314
                return true;
266
320
         */
267
321
        private boolean enforceDecpRule1_abstractMethodsImplemented(BcelClassWeaver weaver, ISourceLocation mungerLoc,
268
322
                        LazyClassGen newParentTarget, ResolvedType newParent) {
 
323
                // Ignore abstract classes or interfaces
 
324
                if (newParentTarget.isAbstract() || newParentTarget.isInterface()) {
 
325
                        return true;
 
326
                }
269
327
                boolean ruleCheckingSucceeded = true;
270
 
                if (!(newParentTarget.isAbstract() || newParentTarget.isInterface())) { // Ignore
271
 
                        // abstract
272
 
                        // classes
273
 
                        // or
274
 
                        // interfaces
275
 
                        List methods = newParent.getMethodsWithoutIterator(false, true, false);
276
 
                        for (Iterator i = methods.iterator(); i.hasNext();) {
277
 
                                ResolvedMember o = (ResolvedMember) i.next();
278
 
                                if (o.isAbstract() && !o.getName().startsWith("ajc$interField")) { // Ignore
279
 
                                        // abstract
280
 
                                        // methods
281
 
                                        // of
282
 
                                        // ajc$interField
283
 
                                        // prefixed
284
 
                                        // methods
285
 
                                        ResolvedMember discoveredImpl = null;
286
 
                                        List newParentTargetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true, false);
287
 
                                        for (Iterator ii = newParentTargetMethods.iterator(); ii.hasNext() && discoveredImpl == null;) {
288
 
                                                ResolvedMember gen2 = (ResolvedMember) ii.next();
289
 
                                                if (gen2.getName().equals(o.getName()) && !gen2.isAbstract()) {
290
 
                                                        String oSig = o.getParameterSignature();
291
 
                                                        // could be a match
292
 
                                                        if (gen2.getParameterSignature().equals(oSig)) {
293
 
                                                                discoveredImpl = gen2;
294
 
                                                        } else {
295
 
                                                                // Does the erasure match? In which case a bridge method will be created later to
296
 
                                                                // satisfy the abstract method
297
 
                                                                if (gen2.hasBackingGenericMember()
298
 
                                                                                && gen2.getBackingGenericMember().getParameterSignature().equals(oSig)) {
299
 
                                                                        discoveredImpl = gen2;
300
 
                                                                }
301
 
                                                        }
302
 
                                                }
303
 
                                        }
304
 
                                        if (discoveredImpl == null) {
305
 
                                                // didnt find a valid implementation, lets check the
306
 
                                                // ITDs on this type to see if they satisfy it
307
 
                                                boolean satisfiedByITD = false;
308
 
                                                for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext();) {
309
 
                                                        ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next();
310
 
                                                        if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
311
 
                                                                ResolvedMember sig = m.getSignature();
312
 
                                                                if (!Modifier.isAbstract(sig.getModifiers())) {
313
 
 
314
 
                                                                        // If the ITD shares a type variable with
315
 
                                                                        // some target type, we need to tailor it
316
 
                                                                        // for that
317
 
                                                                        // type
318
 
                                                                        if (m.isTargetTypeParameterized()) {
319
 
                                                                                ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
320
 
                                                                                m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
321
 
                                                                                sig = m.getSignature(); // possible sig
322
 
                                                                                // change when
323
 
                                                                                // type
324
 
                                                                                // parameters
325
 
                                                                                // filled in
326
 
                                                                        }
327
 
                                                                        if (ResolvedType.matches(AjcMemberMaker.interMethod(sig, m.getAspectType(), sig
328
 
                                                                                        .getDeclaringType().resolve(weaver.getWorld()).isInterface()), o)) {
329
 
                                                                                satisfiedByITD = true;
330
 
                                                                        }
331
 
                                                                }
332
 
                                                        } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
333
 
                                                                satisfiedByITD = true;// AV - that should be
334
 
                                                                // enough, no need to
335
 
                                                                // check more
336
 
                                                        }
337
 
                                                }
338
 
                                                if (!satisfiedByITD) {
339
 
                                                        error(weaver, "The type " + newParentTarget.getName()
340
 
                                                                        + " must implement the inherited abstract method " + o.getDeclaringType() + "." + o.getName()
341
 
                                                                        + o.getParameterSignature(), newParentTarget.getType().getSourceLocation(),
342
 
                                                                        new ISourceLocation[] { o.getSourceLocation(), mungerLoc });
343
 
                                                        ruleCheckingSucceeded = false;
344
 
                                                }
 
328
                List<ResolvedMember> newParentMethods = newParent.getMethodsWithoutIterator(false, true, false);
 
329
                for (ResolvedMember newParentMethod : newParentMethods) {
 
330
                        String newParentMethodName = newParentMethod.getName();
 
331
                        // Ignore abstract ajc$interField prefixed methods
 
332
                        if (newParentMethod.isAbstract() && !newParentMethodName.startsWith("ajc$interField")) {
 
333
                                ResolvedMember discoveredImpl = null;
 
334
                                List<ResolvedMember> targetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true, false);
 
335
                                for (ResolvedMember targetMethod : targetMethods) {
 
336
                                        if (!targetMethod.isAbstract() && targetMethod.getName().equals(newParentMethodName)) {
 
337
                                                String newParentMethodSig = newParentMethod.getParameterSignature(); // ([TT;)
 
338
                                                String targetMethodSignature = targetMethod.getParameterSignature(); // ([Ljava/lang/Object;)
 
339
                                                // could be a match
 
340
                                                if (targetMethodSignature.equals(newParentMethodSig)) {
 
341
                                                        discoveredImpl = targetMethod;
 
342
                                                } else {
 
343
                                                        // Does the erasure match? In which case a bridge method will be created later to
 
344
                                                        // satisfy the abstract method
 
345
                                                        if (targetMethod.hasBackingGenericMember()
 
346
                                                                        && targetMethod.getBackingGenericMember().getParameterSignature().equals(newParentMethodSig)) {
 
347
                                                                discoveredImpl = targetMethod;
 
348
                                                        } else if (newParentMethod.hasBackingGenericMember()) {
 
349
                                                                if (newParentMethod.getBackingGenericMember().getParameterSignature().equals(targetMethodSignature)) {
 
350
                                                                        discoveredImpl = targetMethod;
 
351
                                                                }
 
352
                                                        }
 
353
                                                }
 
354
                                                if (discoveredImpl != null) {
 
355
                                                        break;
 
356
                                                }
 
357
                                        }
 
358
                                }
 
359
                                if (discoveredImpl == null) {
 
360
                                        // didnt find a valid implementation, lets check the
 
361
                                        // ITDs on this type to see if they satisfy it
 
362
                                        boolean satisfiedByITD = false;
 
363
                                        for (ConcreteTypeMunger m : newParentTarget.getType().getInterTypeMungersIncludingSupers()) {
 
364
                                                if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) {
 
365
                                                        ResolvedMember sig = m.getSignature();
 
366
                                                        if (!Modifier.isAbstract(sig.getModifiers())) {
 
367
                                                                // If the ITD shares a type variable with some target type, we need to tailor it
 
368
                                                                // for that type
 
369
                                                                if (m.isTargetTypeParameterized()) {
 
370
                                                                        ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType();
 
371
                                                                        m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType));
 
372
                                                                        // possible sig change when type parameters filled in
 
373
                                                                        sig = m.getSignature();
 
374
                                                                }
 
375
                                                                if (ResolvedType.matches(
 
376
                                                                                AjcMemberMaker.interMethod(sig, m.getAspectType(),
 
377
                                                                                                sig.getDeclaringType().resolve(weaver.getWorld()).isInterface()), newParentMethod)) {
 
378
                                                                        satisfiedByITD = true;
 
379
                                                                }
 
380
                                                        }
 
381
                                                } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) {
 
382
                                                        // AV - that should be enough, no need to check more
 
383
                                                        satisfiedByITD = true;
 
384
                                                }
 
385
                                        }
 
386
                                        if (!satisfiedByITD) {
 
387
                                                error(weaver,
 
388
                                                                "The type " + newParentTarget.getName() + " must implement the inherited abstract method "
 
389
                                                                                + newParentMethod.getDeclaringType() + "." + newParentMethodName
 
390
                                                                                + newParentMethod.getParameterSignature(), newParentTarget.getType().getSourceLocation(),
 
391
                                                                new ISourceLocation[] { newParentMethod.getSourceLocation(), mungerLoc });
 
392
                                                ruleCheckingSucceeded = false;
345
393
                                        }
346
394
                                }
347
395
                        }
352
400
        /**
353
401
         * Rule 2. Can't extend final types
354
402
         */
355
 
        private boolean enforceDecpRule2_cantExtendFinalClass(BcelClassWeaver weaver, ISourceLocation mungerLoc,
356
 
                        LazyClassGen newParentTarget, ResolvedType newParent) {
 
403
        private boolean enforceDecpRule2_cantExtendFinalClass(BcelClassWeaver weaver, ISourceLocation transformerLoc,
 
404
                        LazyClassGen targetType, ResolvedType newParent) {
357
405
                if (newParent.isFinal()) {
358
 
                        error(weaver, "Cannot make type " + newParentTarget.getName() + " extend final class " + newParent.getName(),
359
 
                                        newParentTarget.getType().getSourceLocation(), new ISourceLocation[] { mungerLoc });
 
406
                        error(weaver, "Cannot make type " + targetType.getName() + " extend final class " + newParent.getName(), targetType
 
407
                                        .getType().getSourceLocation(), new ISourceLocation[] { transformerLoc });
360
408
                        return false;
361
409
                }
362
410
                return true;
370
418
                boolean cont = true;
371
419
                if (Modifier.isPublic(superMethod.getModifiers())) {
372
420
                        if (subMethod.isProtected() || subMethod.isDefault() || subMethod.isPrivate()) {
373
 
                                weaver.getWorld().getMessageHandler().handleMessage(
374
 
                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from "
375
 
                                                                + newParent.getName(), superMethod.getSourceLocation()));
 
421
                                weaver.getWorld()
 
422
                                                .getMessageHandler()
 
423
                                                .handleMessage(
 
424
                                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
 
425
                                                                                + "' from " + newParent.getName(), superMethod.getSourceLocation()));
376
426
                                cont = false;
377
427
                        }
378
428
                } else if (Modifier.isProtected(superMethod.getModifiers())) {
379
429
                        if (subMethod.isDefault() || subMethod.isPrivate()) {
380
 
                                weaver.getWorld().getMessageHandler().handleMessage(
381
 
                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from "
382
 
                                                                + newParent.getName(), superMethod.getSourceLocation()));
 
430
                                weaver.getWorld()
 
431
                                                .getMessageHandler()
 
432
                                                .handleMessage(
 
433
                                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
 
434
                                                                                + "' from " + newParent.getName(), superMethod.getSourceLocation()));
383
435
                                cont = false;
384
436
                        }
385
437
                } else if (superMethod.isDefault()) {
386
438
                        if (subMethod.isPrivate()) {
387
 
                                weaver.getWorld().getMessageHandler().handleMessage(
388
 
                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from "
389
 
                                                                + newParent.getName(), superMethod.getSourceLocation()));
 
439
                                weaver.getWorld()
 
440
                                                .getMessageHandler()
 
441
                                                .handleMessage(
 
442
                                                                MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod
 
443
                                                                                + "' from " + newParent.getName(), superMethod.getSourceLocation()));
390
444
                                cont = false;
391
445
                        }
392
446
                }
408
462
                        ResolvedType subType = weaver.getWorld().resolve(subMethod.getReturnType());
409
463
                        ResolvedType superType = weaver.getWorld().resolve(superMethod.getReturnType());
410
464
                        if (!superType.isAssignableFrom(subType)) {
411
 
                                weaver.getWorld().getMessageHandler().handleMessage(
412
 
                                                MessageUtil.error("The return type is incompatible with " + superMethod.getDeclaringType() + "."
413
 
                                                                + superMethod.getName() + superMethod.getParameterSignature(), subMethod.getSourceLocation()));
 
465
                                weaver.getWorld()
 
466
                                                .getMessageHandler()
 
467
                                                .handleMessage(
 
468
                                                                MessageUtil.error("The return type is incompatible with " + superMethod.getDeclaringType() + "."
 
469
                                                                                + superMethod.getName() + superMethod.getParameterSignature(),
 
470
                                                                                subMethod.getSourceLocation()));
414
471
                                // this just might be a better error message...
415
472
                                // "The return type '"+subReturnTypeSig+
416
473
                                // "' is incompatible with the overridden method "
432
489
                boolean superMethodStatic = Modifier.isStatic(superMethod.getModifiers());
433
490
                if (superMethodStatic && !subMethod.isStatic()) {
434
491
                        error(weaver, "This instance method " + subMethod.getName() + subMethod.getParameterSignature()
435
 
                                        + " cannot override the static method from " + superMethod.getDeclaringType().getName(), subMethod
436
 
                                        .getSourceLocation(), new ISourceLocation[] { mungerLoc });
 
492
                                        + " cannot override the static method from " + superMethod.getDeclaringType().getName(),
 
493
                                        subMethod.getSourceLocation(), new ISourceLocation[] { mungerLoc });
437
494
                        return false;
438
495
                } else if (!superMethodStatic && subMethod.isStatic()) {
439
496
                        error(weaver, "The static method " + subMethod.getName() + subMethod.getParameterSignature()
440
 
                                        + " cannot hide the instance method from " + superMethod.getDeclaringType().getName(), subMethod
441
 
                                        .getSourceLocation(), new ISourceLocation[] { mungerLoc });
 
497
                                        + " cannot hide the instance method from " + superMethod.getDeclaringType().getName(),
 
498
                                        subMethod.getSourceLocation(), new ISourceLocation[] { mungerLoc });
442
499
                        return false;
443
500
                }
444
501
                return true;
453
510
         * Search the specified type for a particular method - do not use the return value in the comparison as it is not considered for
454
511
         * overriding.
455
512
         */
456
 
        private LazyMethodGen findMatchingMethod(LazyClassGen newParentTarget, ResolvedMember m) {
457
 
                LazyMethodGen found = null;
458
 
                List methodGens = newParentTarget.getMethodGens();
459
 
                for (Iterator i = methodGens.iterator(); i.hasNext() && found == null;) {
460
 
                        LazyMethodGen gen = (LazyMethodGen) i.next();
461
 
                        if (gen.getName().equals(m.getName()) && gen.getParameterSignature().equals(m.getParameterSignature())) {
462
 
                                found = gen;
 
513
        private LazyMethodGen findMatchingMethod(LazyClassGen type, ResolvedMember searchMethod) {
 
514
                String searchName = searchMethod.getName();
 
515
                String searchSig = searchMethod.getParameterSignature();
 
516
                for (LazyMethodGen method : type.getMethodGens()) {
 
517
                        if (method.getName().equals(searchName) && method.getParameterSignature().equals(searchSig)) {
 
518
                                return method;
463
519
                        }
464
520
                }
465
 
                return found;
 
521
                return null;
466
522
        }
467
523
 
468
524
        /**
482
538
 
483
539
                // Look for ctors to modify
484
540
                for (LazyMethodGen aMethod : mgs) {
485
 
                        if (aMethod.getName().equals("<init>")) {
 
541
                        if (LazyMethodGen.isConstructor(aMethod)) {
486
542
                                InstructionList insList = aMethod.getBody();
487
543
                                InstructionHandle handle = insList.getStart();
488
544
                                while (handle != null) {
501
557
 
502
558
                                                                // 2. Check ITDCs to see if the necessary ctor is provided that way
503
559
                                                                boolean satisfiedByITDC = false;
504
 
                                                                for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii
505
 
                                                                                .hasNext()
506
 
                                                                                && !satisfiedByITDC;) {
507
 
                                                                        ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next();
 
560
                                                                for (Iterator<ConcreteTypeMunger> ii = newParentTarget.getType()
 
561
                                                                                .getInterTypeMungersIncludingSupers().iterator(); ii.hasNext() && !satisfiedByITDC;) {
 
562
                                                                        ConcreteTypeMunger m = ii.next();
508
563
                                                                        if (m.getMunger() instanceof NewConstructorTypeMunger) {
509
564
                                                                                if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) {
510
565
                                                                                        satisfiedByITDC = true;
514
569
 
515
570
                                                                if (!satisfiedByITDC) {
516
571
                                                                        String csig = createReadableCtorSig(newParent, cpg, invokeSpecial);
517
 
                                                                        weaver.getWorld().getMessageHandler().handleMessage(
518
 
                                                                                        MessageUtil.error("Unable to modify hierarchy for " + newParentTarget.getClassName()
519
 
                                                                                                        + " - the constructor " + csig + " is missing", this.getSourceLocation()));
 
572
                                                                        weaver.getWorld()
 
573
                                                                                        .getMessageHandler()
 
574
                                                                                        .handleMessage(
 
575
                                                                                                        MessageUtil.error(
 
576
                                                                                                                        "Unable to modify hierarchy for " + newParentTarget.getClassName()
 
577
                                                                                                                                        + " - the constructor " + csig + " is missing",
 
578
                                                                                                                        this.getSourceLocation()));
520
579
                                                                        return false;
521
580
                                                                }
522
581
                                                        }
523
582
 
524
 
                                                        int idx = cpg.addMethodref(newParent.getName(), invokeSpecial.getMethodName(cpg), invokeSpecial
525
 
                                                                        .getSignature(cpg));
 
583
                                                        int idx = cpg.addMethodref(newParent.getName(), invokeSpecial.getMethodName(cpg),
 
584
                                                                        invokeSpecial.getSignature(cpg));
526
585
                                                        invokeSpecial.setIndex(idx);
527
586
                                                }
528
587
                                        }
556
615
                return sb.toString();
557
616
        }
558
617
 
559
 
        private ResolvedMember getConstructorWithSignature(ResolvedType tx, String signature) {
560
 
                ResolvedMember[] mems = tx.getDeclaredJavaMethods();
561
 
                for (int i = 0; i < mems.length; i++) {
562
 
                        ResolvedMember rm = mems[i];
563
 
                        if (rm.getName().equals("<init>")) {
564
 
                                if (rm.getSignature().equals(signature)) {
565
 
                                        return rm;
 
618
        private ResolvedMember getConstructorWithSignature(ResolvedType type, String searchSig) {
 
619
                for (ResolvedMember method : type.getDeclaredJavaMethods()) {
 
620
                        if (MemberUtils.isConstructor(method)) {
 
621
                                if (method.getSignature().equals(searchSig)) {
 
622
                                        return method;
566
623
                                }
567
624
                        }
568
625
                }
582
639
                if (onType.equals(gen.getType())) {
583
640
                        if (member.getKind() == Member.FIELD) {
584
641
                                // System.out.println("matched: " + gen);
585
 
                                addFieldGetter(gen, member, AjcMemberMaker
586
 
                                                .privilegedAccessMethodForFieldGet(aspectType, member, munger.shortSyntax));
587
 
                                addFieldSetter(gen, member, AjcMemberMaker
588
 
                                                .privilegedAccessMethodForFieldSet(aspectType, member, munger.shortSyntax));
 
642
                                addFieldGetter(gen, member,
 
643
                                                AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType, member, munger.shortSyntax));
 
644
                                addFieldSetter(gen, member,
 
645
                                                AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType, member, munger.shortSyntax));
589
646
                                return true;
590
647
                        } else if (member.getKind() == Member.METHOD) {
591
648
                                addMethodDispatch(gen, member, AjcMemberMaker.privilegedAccessMethodForMethod(aspectType, member));
592
649
                                return true;
593
650
                        } else if (member.getKind() == Member.CONSTRUCTOR) {
594
 
                                for (Iterator i = gen.getMethodGens().iterator(); i.hasNext();) {
595
 
                                        LazyMethodGen m = (LazyMethodGen) i.next();
 
651
                                for (Iterator<LazyMethodGen> i = gen.getMethodGens().iterator(); i.hasNext();) {
 
652
                                        LazyMethodGen m = i.next();
596
653
                                        if (m.getMemberView() != null && m.getMemberView().getKind() == Member.CONSTRUCTOR) {
597
654
                                                // m.getMemberView().equals(member)) {
598
655
                                                m.forcePublic();
677
734
        }
678
735
 
679
736
        protected LazyMethodGen makeMethodGen(LazyClassGen gen, ResolvedMember member) {
680
 
                LazyMethodGen ret = new LazyMethodGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()), member
681
 
                                .getName(), BcelWorld.makeBcelTypes(member.getParameterTypes()), UnresolvedType.getNames(member.getExceptions()),
682
 
                                gen);
 
737
                LazyMethodGen ret = new LazyMethodGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()),
 
738
                                member.getName(), BcelWorld.makeBcelTypes(member.getParameterTypes()), UnresolvedType.getNames(member
 
739
                                                .getExceptions()), gen);
683
740
 
684
741
                // 43972 : Static crosscutting makes interfaces unusable for javac
685
742
                // ret.makeSynthetic();
687
744
        }
688
745
 
689
746
        protected FieldGen makeFieldGen(LazyClassGen gen, ResolvedMember member) {
690
 
                return new FieldGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()), member.getName(), gen
691
 
                                .getConstantPool());
 
747
                return new FieldGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()), member.getName(),
 
748
                                gen.getConstantPool());
692
749
        }
693
750
 
694
751
        private boolean mungePerObjectInterface(BcelClassWeaver weaver, PerObjectInterfaceTypeMunger munger) {
749
806
                // e.g.
750
807
                // "public com_blah_SecurityAspect ajc$com_blah_SecurityAspect$localAspectOf()"
751
808
                Type fieldType = BcelWorld.makeBcelType(aspectType);
752
 
                LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC | Modifier.STATIC, fieldType, NameMangler
753
 
                                .perTypeWithinLocalAspectOf(aspectType), new Type[0], new String[0], gen);
 
809
                LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC | Modifier.STATIC, fieldType,
 
810
                                NameMangler.perTypeWithinLocalAspectOf(aspectType), new Type[0], new String[0], gen);
754
811
                InstructionList il = new InstructionList();
755
812
                // PTWIMPL ?? Should check if it is null and throw
756
813
                // NoAspectBoundException
938
995
                                        ResolvedType rt = classGen.getType();
939
996
                                        if (rt.isInterface()) {
940
997
                                                ISourceLocation sloc = munger.getSourceLocation();
941
 
                                                classWeaver.getWorld().getMessageHandler().handleMessage(
942
 
                                                                MessageUtil.error("ITD target " + rt.getName()
943
 
                                                                                + " is an interface but has been incorrectly determined to be the topmost implementor of "
944
 
                                                                                + onType.getName() + ". ITD is " + this.getSignature(), sloc));
 
998
                                                classWeaver
 
999
                                                                .getWorld()
 
1000
                                                                .getMessageHandler()
 
1001
                                                                .handleMessage(
 
1002
                                                                                MessageUtil.error(
 
1003
                                                                                                "ITD target "
 
1004
                                                                                                                + rt.getName()
 
1005
                                                                                                                + " is an interface but has been incorrectly determined to be the topmost implementor of "
 
1006
                                                                                                                + onType.getName() + ". ITD is " + this.getSignature(), sloc));
945
1007
                                        }
946
1008
                                        if (!onType.isAssignableFrom(rt)) {
947
1009
                                                ISourceLocation sloc = munger.getSourceLocation();
948
 
                                                classWeaver.getWorld().getMessageHandler().handleMessage(
949
 
                                                                MessageUtil.error("ITD target " + rt.getName() + " doesn't appear to implement " + onType.getName()
950
 
                                                                                + " why did we consider it the top most implementor? ITD is " + this.getSignature(), sloc));
 
1010
                                                classWeaver
 
1011
                                                                .getWorld()
 
1012
                                                                .getMessageHandler()
 
1013
                                                                .handleMessage(
 
1014
                                                                                MessageUtil.error(
 
1015
                                                                                                "ITD target " + rt.getName() + " doesn't appear to implement " + onType.getName()
 
1016
                                                                                                                + " why did we consider it the top most implementor? ITD is "
 
1017
                                                                                                                + this.getSignature(), sloc));
951
1018
                                        }
952
1019
                                } else if (!rtx.isExposedToWeaver()) {
953
1020
                                        ISourceLocation sLoc = munger.getSourceLocation();
954
 
                                        classWeaver.getWorld().getMessageHandler().handleMessage(
955
 
                                                        MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_NON_EXPOSED_IMPLEMENTOR, rtx,
956
 
                                                                        getAspectType().getName()), (sLoc == null ? getAspectType().getSourceLocation() : sLoc)));
 
1021
                                        classWeaver
 
1022
                                                        .getWorld()
 
1023
                                                        .getMessageHandler()
 
1024
                                                        .handleMessage(
 
1025
                                                                        MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_NON_EXPOSED_IMPLEMENTOR, rtx,
 
1026
                                                                                        getAspectType().getName()), (sLoc == null ? getAspectType().getSourceLocation() : sLoc)));
957
1027
                                } else {
958
1028
                                        // XXX what does this state mean?
959
1029
                                        // We have incorrectly identified what is the top most
1178
1248
                if (!alreadyDone) {
1179
1249
                        // Use the iterator form of 'getMethods()' so we do as little work
1180
1250
                        // as necessary
1181
 
                        for (Iterator iter = onType.getSuperclass().getMethods(true, true); iter.hasNext() && !quitRightNow;) {
1182
 
                                ResolvedMember aMethod = (ResolvedMember) iter.next();
 
1251
                        for (Iterator<ResolvedMember> iter = onType.getSuperclass().getMethods(true, true); iter.hasNext() && !quitRightNow;) {
 
1252
                                ResolvedMember aMethod = iter.next();
1183
1253
                                if (aMethod.getName().equals(localMethodName) && aMethod.getParameterSignature().equals(localParameterSig)) {
1184
1254
                                        // check the return types, if they are different we need a
1185
1255
                                        // bridging method.
1329
1399
                                return true;
1330
1400
                        }
1331
1401
 
1332
 
                        LazyMethodGen mg = new LazyMethodGen(introduced.getModifiers() - Modifier.ABSTRACT, bcelReturnType, introduced
1333
 
                                        .getName(), BcelWorld.makeBcelTypes(introduced.getParameterTypes()), BcelWorld
1334
 
                                        .makeBcelTypesAsClassNames(introduced.getExceptions()), gen);
 
1402
                        LazyMethodGen mg = new LazyMethodGen(introduced.getModifiers() - Modifier.ABSTRACT, bcelReturnType,
 
1403
                                        introduced.getName(), BcelWorld.makeBcelTypes(introduced.getParameterTypes()),
 
1404
                                        BcelWorld.makeBcelTypesAsClassNames(introduced.getExceptions()), gen);
1335
1405
 
1336
1406
                        // annotation copy from annotation on ITD interface
1337
1407
                        if (weaver.getWorld().isInJava5Mode()) {
1407
1477
                        } else {
1408
1478
                                body.append(fact.createNew(munger.getImplClassName()));
1409
1479
                                body.append(InstructionConstants.DUP);
1410
 
                                body.append(fact
1411
 
                                                .createInvoke(munger.getImplClassName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
 
1480
                                body.append(fact.createInvoke(munger.getImplClassName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL));
1412
1481
                                body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType())));
1413
1482
                        }
1414
1483
 
1527
1596
                return realMember;
1528
1597
        }
1529
1598
 
1530
 
        private void addNeededSuperCallMethods(BcelClassWeaver weaver, ResolvedType onType, Set neededSuperCalls) {
 
1599
        private void addNeededSuperCallMethods(BcelClassWeaver weaver, ResolvedType onType, Set<ResolvedMember> neededSuperCalls) {
1531
1600
                LazyClassGen gen = weaver.getLazyClassGen();
1532
1601
 
1533
 
                for (Iterator iter = neededSuperCalls.iterator(); iter.hasNext();) {
1534
 
                        ResolvedMember superMethod = (ResolvedMember) iter.next();
 
1602
                for (Iterator<ResolvedMember> iter = neededSuperCalls.iterator(); iter.hasNext();) {
 
1603
                        ResolvedMember superMethod = iter.next();
1535
1604
                        if (weaver.addDispatchTarget(superMethod)) {
1536
1605
                                // System.err.println("super type: " +
1537
1606
                                // superMethod.getDeclaringType() + ", " + gen.getType());
1555
1624
                weaver.getWorld().getMessageHandler().handleMessage(msg);
1556
1625
        }
1557
1626
 
1558
 
        private void signalWarning(String msgString, BcelClassWeaver weaver) {
1559
 
                IMessage msg = MessageUtil.warn(msgString, getSourceLocation());
1560
 
                weaver.getWorld().getMessageHandler().handleMessage(msg);
1561
 
        }
 
1627
        // private void signalWarning(String msgString, BcelClassWeaver weaver) {
 
1628
        // IMessage msg = MessageUtil.warn(msgString, getSourceLocation());
 
1629
        // weaver.getWorld().getMessageHandler().handleMessage(msg);
 
1630
        // }
1562
1631
 
1563
1632
        private void signalError(String msgString, BcelClassWeaver weaver) {
1564
1633
                IMessage msg = MessageUtil.error(msgString, getSourceLocation());
1624
1693
                        // the below loop fixes the very special (and very stupid)
1625
1694
                        // case where an aspect declares an annotation
1626
1695
                        // on an ITD it declared on itself.
1627
 
                        List allDecams = weaver.getWorld().getDeclareAnnotationOnMethods();
1628
 
                        for (Iterator i = allDecams.iterator(); i.hasNext();) {
1629
 
                                DeclareAnnotation decaMC = (DeclareAnnotation) i.next();
 
1696
                        List<DeclareAnnotation> allDecams = weaver.getWorld().getDeclareAnnotationOnMethods();
 
1697
                        for (Iterator<DeclareAnnotation> i = allDecams.iterator(); i.hasNext();) {
 
1698
                                DeclareAnnotation decaMC = i.next();
1630
1699
                                if (decaMC.matches(explicitConstructor, weaver.getWorld()) && mg.getEnclosingClass().getType() == aspectType) {
1631
1700
                                        mg.addAnnotation(decaMC.getAnnotation());
1632
1701
                                }
1637
1706
                // TODO could have tagged the type munger when the fact we needed to do this was detected earlier
1638
1707
                if (mg.getArgumentTypes().length == 0) {
1639
1708
                        LazyMethodGen toRemove = null;
1640
 
                        List existingMethods = currentClass.getMethodGens();
1641
 
                        for (Iterator iterator = existingMethods.iterator(); iterator.hasNext() && toRemove == null;) {
1642
 
                                LazyMethodGen object = (LazyMethodGen) iterator.next();
 
1709
                        for (LazyMethodGen object : currentClass.getMethodGens()) {
1643
1710
                                if (object.getName().equals("<init>") && object.getArgumentTypes().length == 0) {
1644
1711
                                        toRemove = object;
1645
1712
                                }
1885
1952
                                ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,
1886
1953
                                                munger.getSignature().getDeclaringType().resolve(getWorld()), false, munger.getTypeVariableAliases());
1887
1954
                                boolean needsbridging = false;
1888
 
                                if (!toBridgeTo.getReturnType().getErasureSignature().equals(
1889
 
                                                munger.getSignature().getReturnType().getErasureSignature())) {
 
1955
                                if (!toBridgeTo.getReturnType().getErasureSignature()
 
1956
                                                .equals(munger.getSignature().getReturnType().getErasureSignature())) {
1890
1957
                                        needsbridging = true;
1891
1958
                                }
1892
1959
                                if (needsbridging) {
1915
1982
                                ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null,
1916
1983
                                                munger.getSignature().getDeclaringType().resolve(getWorld()), false, munger.getTypeVariableAliases());
1917
1984
                                boolean needsbridging = false;
1918
 
                                if (!toBridgeTo.getReturnType().getErasureSignature().equals(
1919
 
                                                munger.getSignature().getReturnType().getErasureSignature())) {
 
1985
                                if (!toBridgeTo.getReturnType().getErasureSignature()
 
1986
                                                .equals(munger.getSignature().getReturnType().getErasureSignature())) {
1920
1987
                                        needsbridging = true;
1921
1988
                                }
1922
1989
                                if (needsbridging) {
1970
2037
        }
1971
2038
 
1972
2039
        @Override
1973
 
        public ConcreteTypeMunger parameterizeWith(Map m, World w) {
 
2040
        public ConcreteTypeMunger parameterizeWith(Map<String, UnresolvedType> m, World w) {
1974
2041
                return new BcelTypeMunger(munger.parameterizeWith(m, w), aspectType);
1975
2042
        }
1976
2043