~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/BcelAdvice.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:
91
91
                                        if (bm.getMethod() != null && bm.getMethod().getAnnotations() != null) {
92
92
                                                return adviceSignature;
93
93
                                        }
94
 
                                        ResolvedMemberImpl simplermember = new ResolvedMemberImpl(bm.getKind(), bm.getDeclaringType(), bm
95
 
                                                        .getModifiers(), bm.getReturnType(), bm.getName(), bm.getParameterTypes());// ,bm.getExceptions(),bm.getBackingGenericMember()
 
94
                                        ResolvedMemberImpl simplermember = new ResolvedMemberImpl(bm.getKind(), bm.getDeclaringType(),
 
95
                                                        bm.getModifiers(), bm.getReturnType(), bm.getName(), bm.getParameterTypes());// ,bm.getExceptions(),bm.getBackingGenericMember()
96
96
                                        // );
97
97
                                        simplermember.setParameterNames(bm.getParameterNames());
98
98
                                        return simplermember;
126
126
        }
127
127
 
128
128
        @Override
129
 
        public ShadowMunger parameterizeWith(ResolvedType declaringType, Map typeVariableMap) {
 
129
        public ShadowMunger parameterizeWith(ResolvedType declaringType, Map<String, UnresolvedType> typeVariableMap) {
130
130
                Pointcut pc = getPointcut().parameterizeWith(typeVariableMap, declaringType.getWorld());
131
131
 
132
132
                BcelAdvice ret = null;
274
274
                                if (resolvedMember instanceof BcelMethod && shadow.getEnclosingShadow() instanceof BcelShadow) {
275
275
                                        Member enclosingMember = shadow.getEnclosingShadow().getSignature();
276
276
                                        if (enclosingMember instanceof BcelMethod) {
277
 
                                                removeUnnecessaryProblems((BcelMethod) enclosingMember, ((BcelMethod) resolvedMember)
278
 
                                                                .getDeclarationLineNumber());
 
277
                                                removeUnnecessaryProblems((BcelMethod) enclosingMember,
 
278
                                                                ((BcelMethod) resolvedMember).getDeclarationLineNumber());
279
279
                                        }
280
280
                                }
281
281
                        }
283
283
 
284
284
                if (shadow.getIWorld().isJoinpointSynchronizationEnabled() && shadow.getKind() == Shadow.MethodExecution
285
285
                                && (s.getSignature().getModifiers() & Modifier.SYNCHRONIZED) != 0) {
286
 
                        shadow.getIWorld().getLint().advisingSynchronizedMethods.signal(new String[] { shadow.toString() }, shadow
287
 
                                        .getSourceLocation(), new ISourceLocation[] { getSourceLocation() });
 
286
                        shadow.getIWorld().getLint().advisingSynchronizedMethods.signal(new String[] { shadow.toString() },
 
287
                                        shadow.getSourceLocation(), new ISourceLocation[] { getSourceLocation() });
288
288
                }
289
289
 
290
290
                // FIXME AV - see #75442, this logic is not enough so for now comment it out until we fix the bug
334
334
                        LazyClassGen enclosingClass = shadow.getEnclosingClass();
335
335
                        if (enclosingClass != null && enclosingClass.isInterface() && shadow.getEnclosingMethod().getName().charAt(0) == '<') {
336
336
                                // Do not add methods with bodies to an interface (252198, 163005)
337
 
                                shadow.getWorld().getLint().cannotAdviseJoinpointInInterfaceWithAroundAdvice.signal(shadow.toString(), shadow
338
 
                                                .getSourceLocation());
 
337
                                shadow.getWorld().getLint().cannotAdviseJoinpointInInterfaceWithAroundAdvice.signal(shadow.toString(),
 
338
                                                shadow.getSourceLocation());
339
339
                                return false;
340
340
                        }
341
341
                        if (!canInline(s)) {
384
384
                for (int i = 0, len = excs.length; i < len; i++) {
385
385
                        ResolvedType t = world.resolve(excs[i], true);
386
386
                        if (t.isMissing()) {
387
 
                                world.getLint().cantFindType.signal(WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE, excs[i]
388
 
                                                .getName()), getSourceLocation());
 
387
                                world.getLint().cantFindType
 
388
                                                .signal(WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE, excs[i].getName()),
 
389
                                                                getSourceLocation());
389
390
                                // IMessage msg = new Message(
390
391
                                // WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE,excs[i].getName()),
391
392
                                // "",IMessage.ERROR,getSourceLocation(),null,null);
468
469
                if (hasExtraParameter() && getKind() == AdviceKind.AfterReturning) {
469
470
                        UnresolvedType extraParameterType = getExtraParameterType();
470
471
                        if (!extraParameterType.equals(UnresolvedType.OBJECT) && !extraParameterType.isPrimitiveType()) {
471
 
                                il.append(BcelRenderer.renderTest(fact, world, Test.makeInstanceof(extraArgVar, getExtraParameterType().resolve(
472
 
                                                world)), null, ifNoAdvice, null));
 
472
                                il.append(BcelRenderer.renderTest(fact, world,
 
473
                                                Test.makeInstanceof(extraArgVar, getExtraParameterType().resolve(world)), null, ifNoAdvice, null));
473
474
                        }
474
475
                }
475
476
                il.append(getAdviceArgSetup(shadow, extraArgVar, null));
522
523
                // BcelWorld.makeBcelType(targetAspectField.getType()),
523
524
                // Constants.GETSTATIC));
524
525
                // }
525
 
                //        
 
526
                //
526
527
                // System.err.println("BcelAdvice: " + exposedState);
527
528
 
528
529
                if (exposedState.getAspectInstance() != null) {
551
552
                                                // make sure we are in an around, since we deal with the closure, not the arg here
552
553
                                                if (getKind() != AdviceKind.Around) {
553
554
                                                        previousIsClosure = false;
554
 
                                                        getConcreteAspect().getWorld().getMessageHandler().handleMessage(
555
 
                                                                        new Message("use of ProceedingJoinPoint is allowed only on around advice (" + "arg " + i
556
 
                                                                                        + " in " + toString() + ")", this.getSourceLocation(), true));
 
555
                                                        getConcreteAspect()
 
556
                                                                        .getWorld()
 
557
                                                                        .getMessageHandler()
 
558
                                                                        .handleMessage(
 
559
                                                                                        new Message("use of ProceedingJoinPoint is allowed only on around advice (" + "arg "
 
560
                                                                                                        + i + " in " + toString() + ")", this.getSourceLocation(), true));
557
561
                                                        // try to avoid verify error and pass in null
558
562
                                                        il.append(InstructionConstants.ACONST_NULL);
559
563
                                                } else {
586
590
                                                extraVar.appendLoadAndConvert(il, fact, getExtraParameterType().resolve(world));
587
591
                                        } else {
588
592
                                                previousIsClosure = false;
589
 
                                                getConcreteAspect().getWorld().getMessageHandler().handleMessage(
590
 
                                                                new Message("use of ProceedingJoinPoint is allowed only on around advice (" + "arg " + i + " in "
591
 
                                                                                + toString() + ")", this.getSourceLocation(), true));
 
593
                                                getConcreteAspect()
 
594
                                                                .getWorld()
 
595
                                                                .getMessageHandler()
 
596
                                                                .handleMessage(
 
597
                                                                                new Message("use of ProceedingJoinPoint is allowed only on around advice (" + "arg " + i
 
598
                                                                                                + " in " + toString() + ")", this.getSourceLocation(), true));
592
599
                                                // try to avoid verify error and pass in null
593
600
                                                il.append(InstructionConstants.ACONST_NULL);
594
601
                                        }