issue_id
int64
2.04k
425k
title
stringlengths
9
251
body
stringlengths
4
32.8k
status
stringclasses
6 values
after_fix_sha
stringlengths
7
7
project_name
stringclasses
6 values
repo_url
stringclasses
6 values
repo_name
stringclasses
6 values
language
stringclasses
1 value
issue_url
null
before_fix_sha
null
pull_url
null
commit_datetime
timestamp[us, tz=UTC]
report_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
23
187
chunk_content
stringlengths
1
22k
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} } return true; } return false; } private boolean doesAlreadyHaveAnnotation(LazyMethodGen rm, ResolvedMember itdfieldsig, DeclareAnnotation deca, List reportedProblems) { if (rm != null && rm.hasAnnotation(deca.getAnnotationTypeX())) { if (world.getLint().elementAlreadyAnnotated.isEnabled()) { Integer uniqueID = new Integer(rm.hashCode() * deca.hashCode()); if (!reportedProblems.contains(uniqueID)) { reportedProblems.add(uniqueID); reportedProblems.add(new Integer(itdfieldsig.hashCode() * deca.hashCode())); world.getLint().elementAlreadyAnnotated.signal(new String[] { itdfieldsig.toString(), deca.getAnnotationTypeX().toString() }, rm.getSourceLocation(), new ISourceLocation[] { deca .getSourceLocation() }); } } return true; } return false; } private Set findAspectsForMungers(LazyMethodGen mg) { Set aspectsAffectingType = new HashSet(); for (Iterator iter = mg.matchedShadows.iterator(); iter.hasNext();) { BcelShadow aShadow = (BcelShadow) iter.next(); for (Iterator iter2 = aShadow.getMungers().iterator(); iter2.hasNext();) { ShadowMunger aMunger = (ShadowMunger) iter2.next();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
if (aMunger instanceof BcelAdvice) { BcelAdvice bAdvice = (BcelAdvice) aMunger; if (bAdvice.getConcreteAspect() != null) { aspectsAffectingType.add(bAdvice.getConcreteAspect().getName()); } } else { } } } return aspectsAffectingType; } private boolean inlineSelfConstructors(List methodGens) { boolean inlinedSomething = false; for (Iterator i = methodGens.iterator(); i.hasNext();) { LazyMethodGen mg = (LazyMethodGen) i.next(); if (!mg.getName().equals("<init>")) continue; InstructionHandle ih = findSuperOrThisCall(mg); if (ih != null && isThisCall(ih)) { LazyMethodGen donor = getCalledMethod(ih); inlineMethod(donor, mg, ih); inlinedSomething = true; } } return inlinedSomething; } private void positionAndImplement(List initializationShadows) { for (Iterator i = initializationShadows.iterator(); i.hasNext();) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
BcelShadow s = (BcelShadow) i.next(); positionInitializationShadow(s); s.implement(); } } private void positionInitializationShadow(BcelShadow s) { LazyMethodGen mg = s.getEnclosingMethod(); InstructionHandle call = findSuperOrThisCall(mg); InstructionList body = mg.getBody(); ShadowRange r = new ShadowRange(body); r.associateWithShadow(s); if (s.getKind() == Shadow.PreInitialization) { r.associateWithTargets(Range.genStart(body, body.getStart().getNext()), Range.genEnd(body, call.getPrev())); } else { r.associateWithTargets(Range.genStart(body, call.getNext()), Range.genEnd(body)); } } private boolean isThisCall(InstructionHandle ih) { InvokeInstruction inst = (InvokeInstruction) ih.getInstruction(); return inst.getClassName(cpg).equals(clazz.getName()); } /** * inline a particular call in bytecode. *
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
* @param donor the method we want to inline * @param recipient the method containing the call we want to inline * @param call the instructionHandle in recipient's body holding the call we want to inline. */ public static void inlineMethod(LazyMethodGen donor, LazyMethodGen recipient, InstructionHandle call) { /* * Implementation notes: * * We allocate two slots for every tempvar so we don't screw up longs and doubles which may share space. This could be * conservatively avoided (no reference to a long/double instruction, don't do it) or packed later. Right now we don't * bother to pack. * * Allocate a new var for each formal param of the inlined. Fill with stack contents. Then copy the inlined instructions in * with the appropriate remap table. Any framelocs used by locals in inlined are reallocated to top of frame, */ final InstructionFactory fact = recipient.getEnclosingClass().getFactory(); IntMap frameEnv = new IntMap(); InstructionList argumentStores = genArgumentStores(donor, recipient, frameEnv, fact); InstructionList inlineInstructions = genInlineInstructions(donor, recipient, frameEnv, fact, false); inlineInstructions.insert(argumentStores); recipient.getBody().append(call, inlineInstructions); Utility.deleteInstruction(call, recipient); } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} /** * Input method is a synchronized method, we remove the bit flag for synchronized and then insert a try..finally block * * Some jumping through firey hoops required - depending on the input code level (1.5 or not) we may or may not be able to use * the LDC instruction that takes a class literal (doesnt on <1.5). * * FIXME asc Before promoting -Xjoinpoints:synchronization to be a standard option, this needs a bunch of tidying up - there is * some duplication that can be removed. */ public static void transformSynchronizedMethod(LazyMethodGen synchronizedMethod) { if (trace.isTraceEnabled()) trace.enter("transformSynchronizedMethod", synchronizedMethod); final InstructionFactory fact = synchronizedMethod.getEnclosingClass().getFactory(); InstructionList body = synchronizedMethod.getBody(); InstructionList prepend = new InstructionList(); Type enclosingClassType = BcelWorld.makeBcelType(synchronizedMethod.getEnclosingClass().getType()); if (synchronizedMethod.isStatic()) { if (synchronizedMethod.getEnclosingClass().isAtLeastJava5()) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
int slotForLockObject = synchronizedMethod.allocateLocal(enclosingClassType); prepend.append(fact.createConstant(enclosingClassType)); prepend.append(InstructionFactory.createDup(1)); prepend.append(InstructionFactory.createStore(enclosingClassType, slotForLockObject)); prepend.append(InstructionFactory.MONITORENTER); InstructionList finallyBlock = new InstructionList(); finallyBlock.append(InstructionFactory.createLoad(Type.getType(java.lang.Class.class), slotForLockObject)); finallyBlock.append(InstructionConstants.MONITOREXIT); finallyBlock.append(InstructionConstants.ATHROW);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle walker = body.getStart(); List rets = new ArrayList(); while (walker != null) { if (walker.getInstruction().isReturnInstruction()) { rets.add(walker); } walker = walker.getNext(); } if (!rets.isEmpty()) { for (Iterator iter = rets.iterator(); iter.hasNext();) { InstructionHandle element = (InstructionHandle) iter.next(); InstructionList monitorExitBlock = new InstructionList(); monitorExitBlock.append(InstructionFactory.createLoad(enclosingClassType, slotForLockObject)); monitorExitBlock.append(InstructionConstants.MONITOREXIT);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle monitorExitBlockStart = body.insert(element, monitorExitBlock); InstructionTargeter[] targeters = element.getTargetersArray(); if (targeters != null) { for (int i = 0; i < targeters.length; i++) { InstructionTargeter targeter = targeters[i]; if (targeter instanceof LocalVariableTag) { } else if (targeter instanceof LineNumberTag) { } else if (targeter instanceof InstructionBranch) { targeter.updateTarget(element, monitorExitBlockStart); } else { throw new BCException("Unexpected targeter encountered during transform: " + targeter); } } } } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle finallyStart = finallyBlock.getStart(); InstructionHandle tryPosition = body.getStart(); InstructionHandle catchPosition = body.getEnd(); body.insert(body.getStart(), prepend); synchronizedMethod.getBody().append(finallyBlock); synchronizedMethod.addExceptionHandler(tryPosition, catchPosition, finallyStart, null, false); synchronizedMethod.addExceptionHandler(finallyStart, finallyStart.getNext(), finallyStart, null, false); } else {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
Type classType = BcelWorld.makeBcelType(synchronizedMethod.getEnclosingClass().getType()); Type clazzType = Type.getType(Class.class); InstructionList parttwo = new InstructionList(); parttwo.append(InstructionFactory.createDup(1)); int slotForThis = synchronizedMethod.allocateLocal(classType); parttwo.append(InstructionFactory.createStore(clazzType, slotForThis)); parttwo.append(InstructionFactory.MONITORENTER); String fieldname = synchronizedMethod.getEnclosingClass().allocateField("class$"); FieldGen f = new FieldGen(Modifier.STATIC | Modifier.PRIVATE, Type.getType(Class.class), fieldname, synchronizedMethod.getEnclosingClass().getConstantPool()); synchronizedMethod.getEnclosingClass().addField(f, null);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
String name = synchronizedMethod.getEnclosingClass().getName(); prepend.append(fact.createGetStatic(name, fieldname, Type.getType(Class.class))); prepend.append(InstructionFactory.createDup(1)); prepend.append(InstructionFactory.createBranchInstruction(Constants.IFNONNULL, parttwo.getStart())); prepend.append(InstructionFactory.POP); prepend.append(fact.createConstant(name)); InstructionHandle tryInstruction = prepend.getEnd(); prepend.append(fact.createInvoke("java.lang.Class", "forName", clazzType, new Type[] { Type.getType(String.class) }, Constants.INVOKESTATIC)); InstructionHandle catchInstruction = prepend.getEnd(); prepend.append(InstructionFactory.createDup(1)); prepend.append(fact.createPutStatic(synchronizedMethod.getEnclosingClass().getType().getName(), fieldname, Type .getType(Class.class))); prepend.append(InstructionFactory.createBranchInstruction(Constants.GOTO, parttwo.getStart())); InstructionList catchBlockForLiteralLoadingFail = new InstructionList(); catchBlockForLiteralLoadingFail.append(fact.createNew((ObjectType) Type.getType(NoClassDefFoundError.class))); catchBlockForLiteralLoadingFail.append(InstructionFactory.createDup_1(1)); catchBlockForLiteralLoadingFail.append(InstructionFactory.SWAP); catchBlockForLiteralLoadingFail.append(fact.createInvoke("java.lang.Throwable", "getMessage", Type .getType(String.class), new Type[] {}, Constants.INVOKEVIRTUAL)); catchBlockForLiteralLoadingFail.append(fact.createInvoke("java.lang.NoClassDefFoundError", "<init>", Type.VOID, new Type[] { Type.getType(String.class) }, Constants.INVOKESPECIAL)); catchBlockForLiteralLoadingFail.append(InstructionFactory.ATHROW); InstructionHandle catchBlockStart = catchBlockForLiteralLoadingFail.getStart(); prepend.append(catchBlockForLiteralLoadingFail); prepend.append(parttwo);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionList finallyBlock = new InstructionList(); finallyBlock.append(InstructionFactory.createLoad(Type.getType(java.lang.Class.class), slotForThis)); finallyBlock.append(InstructionConstants.MONITOREXIT); finallyBlock.append(InstructionConstants.ATHROW);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle walker = body.getStart(); List rets = new ArrayList(); while (walker != null) { if (walker.getInstruction().isReturnInstruction()) { rets.add(walker); } walker = walker.getNext(); } if (rets.size() > 0) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
for (Iterator iter = rets.iterator(); iter.hasNext();) { InstructionHandle element = (InstructionHandle) iter.next(); InstructionList monitorExitBlock = new InstructionList(); monitorExitBlock.append(InstructionFactory.createLoad(classType, slotForThis)); monitorExitBlock.append(InstructionConstants.MONITOREXIT); InstructionHandle monitorExitBlockStart = body.insert(element, monitorExitBlock); InstructionTargeter[] targeters = element.getTargetersArray(); if (targeters != null) { for (int i = 0; i < targeters.length; i++) { InstructionTargeter targeter = targeters[i]; if (targeter instanceof LocalVariableTag) { } else if (targeter instanceof LineNumberTag) { } else if (targeter instanceof InstructionBranch) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
targeter.updateTarget(element, monitorExitBlockStart); } else { throw new BCException("Unexpected targeter encountered during transform: " + targeter); } } } } } InstructionHandle finallyStart = finallyBlock.getStart(); InstructionHandle tryPosition = body.getStart(); InstructionHandle catchPosition = body.getEnd(); body.insert(body.getStart(), prepend); synchronizedMethod.getBody().append(finallyBlock); synchronizedMethod.addExceptionHandler(tryPosition, catchPosition, finallyStart, null, false); synchronizedMethod.addExceptionHandler(tryInstruction, catchInstruction, catchBlockStart, (ObjectType) Type .getType(ClassNotFoundException.class), true); synchronizedMethod.addExceptionHandler(finallyStart, finallyStart.getNext(), finallyStart, null, false); } } else { Type classType = BcelWorld.makeBcelType(synchronizedMethod.getEnclosingClass().getType());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
prepend.append(InstructionFactory.createLoad(classType, 0)); prepend.append(InstructionFactory.createDup(1)); int slotForThis = synchronizedMethod.allocateLocal(classType); prepend.append(InstructionFactory.createStore(classType, slotForThis)); prepend.append(InstructionFactory.MONITORENTER); InstructionList finallyBlock = new InstructionList(); finallyBlock.append(InstructionFactory.createLoad(classType, slotForThis)); finallyBlock.append(InstructionConstants.MONITOREXIT); finallyBlock.append(InstructionConstants.ATHROW);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle walker = body.getStart(); List rets = new ArrayList(); while (walker != null) { if (walker.getInstruction().isReturnInstruction()) { rets.add(walker); } walker = walker.getNext(); } if (!rets.isEmpty()) { for (Iterator iter = rets.iterator(); iter.hasNext();) { InstructionHandle element = (InstructionHandle) iter.next(); ); InstructionList monitorExitBlock = new InstructionList(); monitorExitBlock.append(InstructionFactory.createLoad(classType, slotForThis)); monitorExitBlock.append(InstructionConstants.MONITOREXIT);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle monitorExitBlockStart = body.insert(element, monitorExitBlock); InstructionTargeter[] targeters = element.getTargetersArray(); if (targeters != null) { for (int i = 0; i < targeters.length; i++) { InstructionTargeter targeter = targeters[i]; if (targeter instanceof LocalVariableTag) { } else if (targeter instanceof LineNumberTag) { } else if (targeter instanceof InstructionBranch) { targeter.updateTarget(element, monitorExitBlockStart); } else { throw new BCException("Unexpected targeter encountered during transform: " + targeter); } } } } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle finallyStart = finallyBlock.getStart(); InstructionHandle tryPosition = body.getStart(); InstructionHandle catchPosition = body.getEnd(); body.insert(body.getStart(), prepend); synchronizedMethod.getBody().append(finallyBlock); synchronizedMethod.addExceptionHandler(tryPosition, catchPosition, finallyStart, null, false); synchronizedMethod.addExceptionHandler(finallyStart, finallyStart.getNext(), finallyStart, null, false); } if (trace.isTraceEnabled()) trace.exit("transformSynchronizedMethod"); } /** * generate the instructions to be inlined. * * @param donor the method from which we will copy (and adjust frame and jumps) instructions. * @param recipient the method the instructions will go into. Used to get the frame size so we can allocate new frame locations * for locals in donor. * @param frameEnv an environment to map from donor frame to recipient frame, initially populated with argument locations. * @param fact an instruction factory for recipient */ static InstructionList genInlineInstructions(LazyMethodGen donor, LazyMethodGen recipient, IntMap frameEnv,
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionFactory fact, boolean keepReturns) { InstructionList footer = new InstructionList(); InstructionHandle end = footer.append(InstructionConstants.NOP); InstructionList ret = new InstructionList(); InstructionList sourceList = donor.getBody(); Map srcToDest = new HashMap(); ConstantPool donorCpg = donor.getEnclosingClass().getConstantPool(); ConstantPool recipientCpg = recipient.getEnclosingClass().getConstantPool(); boolean isAcrossClass = donorCpg != recipientCpg; for (InstructionHandle src = sourceList.getStart(); src != null; src = src.getNext()) { Instruction fresh = Utility.copyInstruction(src.getInstruction()); InstructionHandle dest; if (fresh.isConstantPoolInstruction()) { if (isAcrossClass) { InstructionCP cpi = (InstructionCP) fresh; cpi.setIndex(recipientCpg.addConstant(donorCpg.getConstant(cpi.getIndex()), donorCpg)); } } if (src.getInstruction() == Range.RANGEINSTRUCTION) { dest = ret.append(Range.RANGEINSTRUCTION); } else if (fresh.isReturnInstruction()) { if (keepReturns) { dest = ret.append(fresh);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} else { dest = ret.append(InstructionFactory.createBranchInstruction(Constants.GOTO, end)); } } else if (fresh instanceof InstructionBranch) { dest = ret.append((InstructionBranch) fresh); } else if (fresh.isLocalVariableInstruction() || fresh instanceof RET) { int oldIndex = fresh.getIndex(); int freshIndex; if (!frameEnv.hasKey(oldIndex)) { freshIndex = recipient.allocateLocal(2); frameEnv.put(oldIndex, freshIndex); } else { freshIndex = frameEnv.get(oldIndex); } if (fresh instanceof RET) { fresh.setIndex(freshIndex); } else { fresh = ((InstructionLV) fresh).setIndexAndCopyIfNecessary(freshIndex); } dest = ret.append(fresh); } else { dest = ret.append(fresh); } srcToDest.put(src, dest); } Map tagMap = new HashMap(); Map shadowMap = new HashMap(); for (InstructionHandle dest = ret.getStart(), src = sourceList.getStart(); dest != null; dest = dest.getNext(), src = src
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
.getNext()) { Instruction inst = dest.getInstruction(); if (inst instanceof InstructionBranch) { InstructionBranch branch = (InstructionBranch) inst; InstructionHandle oldTarget = branch.getTarget(); InstructionHandle newTarget = (InstructionHandle) srcToDest.get(oldTarget); if (newTarget == null) { } else { branch.setTarget(newTarget); if (branch instanceof InstructionSelect) { InstructionSelect select = (InstructionSelect) branch; InstructionHandle[] oldTargets = select.getTargets(); for (int k = oldTargets.length - 1; k >= 0; k--) { select.setTarget(k, (InstructionHandle) srcToDest.get(oldTargets[k])); } } } } Iterator tIter = src.getTargeters().iterator(); while (tIter.hasNext()) { InstructionTargeter old = (InstructionTargeter) tIter.next(); if (old instanceof Tag) { Tag oldTag = (Tag) old; Tag fresh = (Tag) tagMap.get(oldTag); if (fresh == null) { fresh = oldTag.copy();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
if (old instanceof LocalVariableTag) { LocalVariableTag lvTag = (LocalVariableTag) old; LocalVariableTag lvTagFresh = (LocalVariableTag) fresh; if (lvTag.getSlot() == 0) { fresh = new LocalVariableTag(lvTag.getRealType().getSignature(), "ajc$aspectInstance", frameEnv .get(lvTag.getSlot()), 0); } else { lvTagFresh.updateSlot(frameEnv.get(lvTag.getSlot())); } } tagMap.put(oldTag, fresh); } dest.addTargeter(fresh); } else if (old instanceof ExceptionRange) { ExceptionRange er = (ExceptionRange) old; if (er.getStart() == src) { ExceptionRange freshEr = new ExceptionRange(recipient.getBody(), er.getCatchType(), er.getPriority()); freshEr.associateWithTargets(dest, (InstructionHandle) srcToDest.get(er.getEnd()), (InstructionHandle) srcToDest.get(er.getHandler())); } } else if (old instanceof ShadowRange) { ShadowRange oldRange = (ShadowRange) old; if (oldRange.getStart() == src) { BcelShadow oldShadow = oldRange.getShadow(); BcelShadow freshEnclosing = oldShadow.getEnclosingShadow() == null ? null : (BcelShadow) shadowMap
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
.get(oldShadow.getEnclosingShadow()); BcelShadow freshShadow = oldShadow.copyInto(recipient, freshEnclosing); ShadowRange freshRange = new ShadowRange(recipient.getBody()); freshRange.associateWithShadow(freshShadow); freshRange.associateWithTargets(dest, (InstructionHandle) srcToDest.get(oldRange.getEnd())); shadowMap.put(oldRange, freshRange); } } } } if (!keepReturns) ret.append(footer); return ret; } {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
}
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
k, } } } } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} }*/ } } } /** * generate the argument stores in preparation for inlining. * * @param donor the method we will inline from. Used to get the signature. * @param recipient the method we will inline into. Used to get the frame size so we can allocate fresh locations. * @param frameEnv an empty environment we populate with a map from donor frame to recipient frame. * @param fact an instruction factory for recipient */ private static InstructionList genArgumentStores(LazyMethodGen donor, LazyMethodGen recipient, IntMap frameEnv, InstructionFactory fact) { InstructionList ret = new InstructionList(); int donorFramePos = 0; if (!donor.isStatic()) { int targetSlot = recipient.allocateLocal(Type.OBJECT); ret.insert(InstructionFactory.createStore(Type.OBJECT, targetSlot)); frameEnv.put(donorFramePos, targetSlot); donorFramePos += 1; }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
Type[] argTypes = donor.getArgumentTypes(); for (int i = 0, len = argTypes.length; i < len; i++) { Type argType = argTypes[i]; int argSlot = recipient.allocateLocal(argType); ret.insert(InstructionFactory.createStore(argType, argSlot)); frameEnv.put(donorFramePos, argSlot); donorFramePos += argType.getSize(); } return ret; } /** * get a called method: Assumes the called method is in this class, and the reference to it is exact (a la INVOKESPECIAL). * * @param ih The InvokeInstruction instructionHandle pointing to the called method. */ private LazyMethodGen getCalledMethod(InstructionHandle ih) { InvokeInstruction inst = (InvokeInstruction) ih.getInstruction(); String methodName = inst.getName(cpg); String signature = inst.getSignature(cpg); return clazz.getLazyMethodGen(methodName, signature); } private void weaveInAddedMethods() { Collections.sort(addedLazyMethodGens, new Comparator() { public int compare(Object a, Object b) { LazyMethodGen aa = (LazyMethodGen) a; LazyMethodGen bb = (LazyMethodGen) b; int i = aa.getName().compareTo(bb.getName()); if (i != 0) return i; return aa.getSignature().compareTo(bb.getSignature());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} }); for (Iterator i = addedLazyMethodGens.iterator(); i.hasNext();) { clazz.addMethodGen((LazyMethodGen) i.next()); } } } /** * Returns null if this is not a Java constructor, and then we won't weave into it at all */ private InstructionHandle findSuperOrThisCall(LazyMethodGen mg) { int depth = 1; InstructionHandle start = mg.getBody().getStart(); while (true) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
if (start == null) return null; Instruction inst = start.getInstruction(); if (inst.opcode == Constants.INVOKESPECIAL && ((InvokeInstruction) inst).getName(cpg).equals("<init>")) { depth--; if (depth == 0) return start; } else if (inst.opcode == Constants.NEW) { depth++; } start = start.getNext(); } } private boolean match(LazyMethodGen mg) { BcelShadow enclosingShadow; List shadowAccumulator = new ArrayList(); boolean startsAngly = mg.getName().charAt(0) == '<'; if (startsAngly && mg.getName().equals("<init>")) { return matchInit(mg, shadowAccumulator); } else if (!shouldWeaveBody(mg)) { return false; } else { if (startsAngly && mg.getName().equals("<clinit>")) { enclosingShadow = BcelShadow.makeStaticInitialization(world, mg); } else if (mg.isAdviceMethod()) { enclosingShadow = BcelShadow.makeAdviceExecution(world, mg);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} else { AjAttribute.EffectiveSignatureAttribute effective = mg.getEffectiveSignature(); if (effective == null) { enclosingShadow = BcelShadow.makeMethodExecution(world, mg, !canMatchBodyShadows); } else if (effective.isWeaveBody()) { ResolvedMember rm = effective.getEffectiveSignature(); fixParameterNamesForResolvedMember(rm, mg.getMemberView()); fixAnnotationsForResolvedMember(rm, mg.getMemberView()); enclosingShadow = BcelShadow.makeShadowForMethod(world, mg, effective.getShadowKind(), rm); } else { return false; } } if (canMatchBodyShadows) { for (InstructionHandle h = mg.getBody().getStart(); h != null; h = h.getNext()) { match(mg, h, enclosingShadow, shadowAccumulator); } } if (canMatch(enclosingShadow.getKind()) && !(mg.getName().charAt(0) == 'a' && mg.getName().startsWith("ajc$interFieldInit"))) { if (match(enclosingShadow, shadowAccumulator)) { enclosingShadow.init(); }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} mg.matchedShadows = shadowAccumulator; return !shadowAccumulator.isEmpty(); } } private boolean matchInit(LazyMethodGen mg, List shadowAccumulator) { BcelShadow enclosingShadow; InstructionHandle superOrThisCall = findSuperOrThisCall(mg); if (superOrThisCall == null) return false; enclosingShadow = BcelShadow.makeConstructorExecution(world, mg, superOrThisCall); if (mg.getEffectiveSignature() != null) { enclosingShadow.setMatchingSignature(mg.getEffectiveSignature().getEffectiveSignature()); } boolean beforeSuperOrThisCall = true; if (shouldWeaveBody(mg)) { if (canMatchBodyShadows) { for (InstructionHandle h = mg.getBody().getStart(); h != null; h = h.getNext()) { if (h == superOrThisCall) { beforeSuperOrThisCall = false; continue; } match(mg, h, beforeSuperOrThisCall ? null : enclosingShadow, shadowAccumulator); } } if (canMatch(Shadow.ConstructorExecution)) match(enclosingShadow, shadowAccumulator);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} if (!isThisCall(superOrThisCall)) { InstructionHandle curr = enclosingShadow.getRange().getStart(); for (Iterator i = addedSuperInitializersAsList.iterator(); i.hasNext();) { IfaceInitList l = (IfaceInitList) i.next(); Member ifaceInitSig = AjcMemberMaker.interfaceConstructor(l.onType); BcelShadow initShadow = BcelShadow.makeIfaceInitialization(world, mg, ifaceInitSig); InstructionList inits = genInitInstructions(l.list, false); if (match(initShadow, shadowAccumulator) || !inits.isEmpty()) { initShadow.initIfaceInitializer(curr); initShadow.getRange().insert(inits, Range.OutsideBefore); } } InstructionList inits = genInitInstructions(addedThisInitializers, false); enclosingShadow.getRange().insert(inits, Range.OutsideBefore); } boolean addedInitialization = match(BcelShadow.makeUnfinishedInitialization(world, mg), initializationShadows); addedInitialization |= match(BcelShadow.makeUnfinishedPreinitialization(world, mg), initializationShadows); mg.matchedShadows = shadowAccumulator; return addedInitialization || !shadowAccumulator.isEmpty();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} private boolean shouldWeaveBody(LazyMethodGen mg) { if (mg.isBridgeMethod()) return false; if (mg.isAjSynthetic()) return mg.getName().equals("<clinit>"); AjAttribute.EffectiveSignatureAttribute a = mg.getEffectiveSignature(); if (a != null) return a.isWeaveBody(); return true; } /** * first sorts the mungers, then gens the initializers in the right order */ private InstructionList genInitInstructions(List list, boolean isStatic) { list = PartialOrder.sort(list); if (list == null) { throw new BCException("circularity in inter-types"); } InstructionList ret = new InstructionList(); for (Iterator i = list.iterator(); i.hasNext();) { ConcreteTypeMunger cmunger = (ConcreteTypeMunger) i.next(); NewFieldTypeMunger munger = (NewFieldTypeMunger) cmunger.getMunger(); ResolvedMember initMethod = munger.getInitMethod(cmunger.getAspectType()); if (!isStatic) ret.append(InstructionConstants.ALOAD_0); ret.append(Utility.createInvoke(fact, world, initMethod)); } return ret; }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
private void match(LazyMethodGen mg, InstructionHandle ih, BcelShadow enclosingShadow, List shadowAccumulator) { Instruction i = ih.getInstruction(); if (canMatch(Shadow.ExceptionHandler) && !Range.isRangeHandle(ih)) { InstructionTargeter[] targeters = ih.getTargetersArray(); if (targeters != null) { for (int j = 0; j < targeters.length; j++) { InstructionTargeter t = targeters[j]; if (t instanceof ExceptionRange) { ExceptionRange er = (ExceptionRange) t; if (er.getCatchType() == null) continue; if (isInitFailureHandler(ih)) return; if (!ih.getInstruction().isStoreInstruction() && ih.getInstruction().getOpcode() != Constants.NOP) { mg.getBody().insert(ih, InstructionConstants.NOP); InstructionHandle newNOP = ih.getPrev();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
er.updateTarget(ih, newNOP, mg.getBody()); for (int ii = 0; ii < targeters.length; ii++) { newNOP.addTargeter(targeters[ii]); } ih.removeAllTargeters(); match(BcelShadow.makeExceptionHandler(world, er, mg, newNOP, enclosingShadow), shadowAccumulator); } else { match(BcelShadow.makeExceptionHandler(world, er, mg, ih, enclosingShadow), shadowAccumulator); } } } } } if ((i instanceof FieldInstruction) && (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet))) { FieldInstruction fi = (FieldInstruction) i; if (fi.opcode == Constants.PUTFIELD || fi.opcode == Constants.PUTSTATIC) { InstructionHandle prevHandle = ih.getPrev(); Instruction prevI = prevHandle.getInstruction(); if (Utility.isConstantPushInstruction(prevI)) { Member field = BcelWorld.makeFieldJoinPointSignature(clazz, (FieldInstruction) i);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
ResolvedMember resolvedField = field.resolve(world); if (resolvedField == null) { } else if (Modifier.isFinal(resolvedField.getModifiers())) { } else { if (canMatch(Shadow.FieldSet)) matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else { if (canMatch(Shadow.FieldSet)) matchSetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else { if (canMatch(Shadow.FieldGet)) matchGetInstruction(mg, ih, enclosingShadow, shadowAccumulator); } } else if (i instanceof InvokeInstruction) { InvokeInstruction ii = (InvokeInstruction) i; if (ii.getMethodName(clazz.getConstantPool()).equals("<init>")) { if (canMatch(Shadow.ConstructorCall)) match(BcelShadow.makeConstructorCall(world, mg, ih, enclosingShadow), shadowAccumulator); } else if (ii.opcode == Constants.INVOKESPECIAL) { String onTypeName = ii.getClassName(cpg); if (onTypeName.equals(mg.getEnclosingClass().getName())) { matchInvokeInstruction(mg, ih, ii, enclosingShadow, shadowAccumulator); } else {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
} } else { matchInvokeInstruction(mg, ih, ii, enclosingShadow, shadowAccumulator); } } else if (world.isJoinpointArrayConstructionEnabled() && i.isArrayCreationInstruction()) { if (canMatch(Shadow.ConstructorCall)) { boolean debug = false; if (debug) System.err.println("Found new array instruction: " + i); if (i.opcode == Constants.ANEWARRAY) { ObjectType arrayType = i.getLoadClassType(clazz.getConstantPool()); if (debug) System.err.println("Array type is " + arrayType); BcelShadow ctorCallShadow = BcelShadow.makeArrayConstructorCall(world, mg, ih, enclosingShadow); match(ctorCallShadow, shadowAccumulator); } else if (i.opcode == Constants.NEWARRAY) { Type arrayType = i.getType(); if (debug) System.err.println("Array type is " + arrayType); BcelShadow ctorCallShadow = BcelShadow.makeArrayConstructorCall(world, mg, ih, enclosingShadow); match(ctorCallShadow, shadowAccumulator); } else if (i instanceof MULTIANEWARRAY) { MULTIANEWARRAY arrayInstruction = (MULTIANEWARRAY) i; ObjectType arrayType = arrayInstruction.getLoadClassType(clazz.getConstantPool()); if (debug) System.err.println("Array type is " + arrayType);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
BcelShadow ctorCallShadow = BcelShadow.makeArrayConstructorCall(world, mg, ih, enclosingShadow); match(ctorCallShadow, shadowAccumulator); } } } else if (world.isJoinpointSynchronizationEnabled() && ((i.getOpcode() == Constants.MONITORENTER) || (i.getOpcode() == Constants.MONITOREXIT))) { if (i.getOpcode() == Constants.MONITORENTER) { BcelShadow monitorEntryShadow = BcelShadow.makeMonitorEnter(world, mg, ih, enclosingShadow); match(monitorEntryShadow, shadowAccumulator); } else { BcelShadow monitorExitShadow = BcelShadow.makeMonitorExit(world, mg, ih, enclosingShadow); match(monitorExitShadow, shadowAccumulator); } } } } private boolean isInitFailureHandler(InstructionHandle ih) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
InstructionHandle twoInstructionsAway = ih.getNext().getNext(); if (twoInstructionsAway.getInstruction().opcode == Constants.PUTSTATIC) { String name = ((FieldInstruction) twoInstructionsAway.getInstruction()).getFieldName(cpg); if (name.equals(NameMangler.INITFAILURECAUSE_FIELD_NAME)) return true; } return false; } private void matchSetInstruction(LazyMethodGen mg, InstructionHandle ih, BcelShadow enclosingShadow, List shadowAccumulator) { FieldInstruction fi = (FieldInstruction) ih.getInstruction(); Member field = BcelWorld.makeFieldJoinPointSignature(clazz, fi); if (field.getName().startsWith(NameMangler.PREFIX)) return; ResolvedMember resolvedField = field.resolve(world); if (resolvedField == null) { return; } else if (Modifier.isFinal(resolvedField.getModifiers()) && Utility.isConstantPushInstruction(ih.getPrev().getInstruction())) { return; } else if (resolvedField.isSynthetic()) { return; } else { BcelShadow bs = BcelShadow.makeFieldSet(world, resolvedField, mg, ih, enclosingShadow);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
String cname = fi.getClassName(cpg); if (!resolvedField.getDeclaringType().getName().equals(cname)) { bs.setActualTargetType(cname); } match(bs, shadowAccumulator); } } private void matchGetInstruction(LazyMethodGen mg, InstructionHandle ih, BcelShadow enclosingShadow, List shadowAccumulator) { FieldInstruction fi = (FieldInstruction) ih.getInstruction(); Member field = BcelWorld.makeFieldJoinPointSignature(clazz, fi); if (field.getName().startsWith(NameMangler.PREFIX)) return; ResolvedMember resolvedField = field.resolve(world); if (resolvedField == null) { return; } else if (resolvedField.isSynthetic()) { return; } else { BcelShadow bs = BcelShadow.makeFieldGet(world, resolvedField, mg, ih, enclosingShadow); String cname = fi.getClassName(cpg); if (!resolvedField.getDeclaringType().getName().equals(cname)) { bs.setActualTargetType(cname); } match(bs, shadowAccumulator); } } /**
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
* For some named resolved type, this method looks for a member with a particular name - it should only be used when you truly * believe there is only one member with that name in the type as it returns the first one it finds. */ private ResolvedMember findResolvedMemberNamed(ResolvedType type, String methodName) { ResolvedMember[] allMethods = type.getDeclaredMethods(); for (int i = 0; i < allMethods.length; i++) { ResolvedMember member = allMethods[i]; if (member.getName().equals(methodName)) return member; } return null; } /** * For a given resolvedmember, this will discover the real annotations for it. <b>Should only be used when the resolvedmember is * the contents of an effective signature attribute, as thats the only time when the annotations aren't stored directly in the * resolvedMember</b> * * @param rm the sig we want it to pretend to be 'int A.m()' or somesuch ITD like thing * @param declaredSig the real sig 'blah.ajc$xxx' */ private void fixParameterNamesForResolvedMember(ResolvedMember rm, ResolvedMember declaredSig) { UnresolvedType memberHostType = declaredSig.getDeclaringType(); String methodName = declaredSig.getName(); String[] pnames = null; if (rm.getKind() == Member.METHOD && !rm.isAbstract()) { if (methodName.startsWith("ajc$inlineAccessMethod") || methodName.startsWith("ajc$superDispatch")) { ResolvedMember resolvedDooberry = world.resolve(declaredSig); pnames = resolvedDooberry.getParameterNames(); } else { ResolvedMember realthing = AjcMemberMaker.interMethodDispatcher(rm.resolve(world), memberHostType).resolve(world);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
ResolvedMember theRealMember = findResolvedMemberNamed(memberHostType.resolve(world), realthing.getName()); if (theRealMember != null) { pnames = theRealMember.getParameterNames(); if (pnames.length > 0 && pnames[0].equals("ajc$this_")) { String[] pnames2 = new String[pnames.length - 1]; System.arraycopy(pnames, 1, pnames2, 0, pnames2.length); pnames = pnames2; } } } } rm.setParameterNames(pnames); } /** * For a given resolvedmember, this will discover the real annotations for it. <b>Should only be used when the resolvedmember is * the contents of an effective signature attribute, as thats the only time when the annotations aren't stored directly in the * resolvedMember</b> * * @param rm the sig we want it to pretend to be 'int A.m()' or somesuch ITD like thing * @param declaredSig the real sig 'blah.ajc$xxx' */ private void fixAnnotationsForResolvedMember(ResolvedMember rm, ResolvedMember declaredSig) { try { UnresolvedType memberHostType = declaredSig.getDeclaringType(); ResolvedType[] annotations = (ResolvedType[]) mapToAnnotations.get(rm); String methodName = declaredSig.getName(); if (annotations == null) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
if (rm.getKind() == Member.FIELD) { if (methodName.startsWith("ajc$inlineAccessField")) { ResolvedMember resolvedDooberry = world.resolve(rm); annotations = resolvedDooberry.getAnnotationTypes(); } else { ResolvedMember realthing = AjcMemberMaker.interFieldInitializer(rm, memberHostType); ResolvedMember resolvedDooberry = world.resolve(realthing); annotations = resolvedDooberry.getAnnotationTypes(); } } else if (rm.getKind() == Member.METHOD && !rm.isAbstract()) { if (methodName.startsWith("ajc$inlineAccessMethod") || methodName.startsWith("ajc$superDispatch")) { ResolvedMember resolvedDooberry = world.resolve(declaredSig); annotations = resolvedDooberry.getAnnotationTypes(); } else { ResolvedMember realthing = AjcMemberMaker.interMethodDispatcher(rm.resolve(world), memberHostType).resolve( world); ResolvedMember theRealMember = findResolvedMemberNamed(memberHostType.resolve(world), realthing.getName()); if (theRealMember == null) { throw new UnsupportedOperationException( "Known limitation in M4 - can't find ITD members when type variable is used as an argument and has upper bound specified"); } annotations = theRealMember.getAnnotationTypes(); } } else if (rm.getKind() == Member.CONSTRUCTOR) { ResolvedMember realThing = AjcMemberMaker.postIntroducedConstructor(memberHostType.resolve(world), rm .getDeclaringType(), rm.getParameterTypes()); ResolvedMember resolvedDooberry = world.resolve(realThing);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
if (resolvedDooberry == null) { throw new UnsupportedOperationException( "Known limitation in M4 - can't find ITD members when type variable is used as an argument and has upper bound specified"); } annotations = resolvedDooberry.getAnnotationTypes(); } if (annotations == null) annotations = new ResolvedType[0]; mapToAnnotations.put(rm, annotations); } rm.setAnnotationTypes(annotations); } catch (UnsupportedOperationException ex) { throw ex; } catch (Throwable t) { throw new BCException("Unexpectedly went bang when searching for annotations on " + rm, t); } } private void matchInvokeInstruction(LazyMethodGen mg, InstructionHandle ih, InvokeInstruction invoke, BcelShadow enclosingShadow, List shadowAccumulator) { String methodName = invoke.getName(cpg); if (methodName.startsWith(NameMangler.PREFIX)) { Member jpSig = world.makeJoinPointSignatureForMethodInvocation(clazz, invoke); ResolvedMember declaredSig = jpSig.resolve(world); if (declaredSig == null) return; if (declaredSig.getKind() == Member.FIELD) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
Shadow.Kind kind; if (jpSig.getReturnType().equals(ResolvedType.VOID)) { kind = Shadow.FieldSet; } else { kind = Shadow.FieldGet; } if (canMatch(Shadow.FieldGet) || canMatch(Shadow.FieldSet)) match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, kind, declaredSig), shadowAccumulator); } else { AjAttribute.EffectiveSignatureAttribute effectiveSig = declaredSig.getEffectiveSignature(); if (effectiveSig == null) return; if (effectiveSig.isWeaveBody()) return; ResolvedMember rm = effectiveSig.getEffectiveSignature(); fixParameterNamesForResolvedMember(rm, declaredSig); fixAnnotationsForResolvedMember(rm, declaredSig); if (canMatch(effectiveSig.getShadowKind())) match(BcelShadow.makeShadowForMethodCall(world, mg, ih, enclosingShadow, effectiveSig.getShadowKind(), rm), shadowAccumulator); } } else { if (canMatch(Shadow.MethodCall)) match(BcelShadow.makeMethodCall(world, mg, ih, enclosingShadow), shadowAccumulator); } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
private static boolean checkedXsetForLowLevelContextCapturing = false; private static boolean captureLowLevelContext = false; private boolean match(BcelShadow shadow, List shadowAccumulator) { if (captureLowLevelContext) { ContextToken shadowMatchToken = CompilationAndWeavingContext.enteringPhase( CompilationAndWeavingContext.MATCHING_SHADOW, shadow); boolean isMatched = false; for (Iterator i = shadowMungers.iterator(); i.hasNext();) { ShadowMunger munger = (ShadowMunger) i.next(); ContextToken mungerMatchToken = CompilationAndWeavingContext.enteringPhase( CompilationAndWeavingContext.MATCHING_POINTCUT, munger.getPointcut()); if (munger.match(shadow, world)) { shadow.addMunger(munger); isMatched = true; if (shadow.getKind() == Shadow.StaticInitialization) { clazz.warnOnAddedStaticInitializer(shadow, munger.getSourceLocation()); } } CompilationAndWeavingContext.leavingPhase(mungerMatchToken); } if (isMatched) shadowAccumulator.add(shadow); CompilationAndWeavingContext.leavingPhase(shadowMatchToken); return isMatched; } else { boolean isMatched = false;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
int max = shadowMungers.size(); for (int i = 0; i < max; i++) { ShadowMunger munger = (ShadowMunger) shadowMungers.get(i); if (munger.match(shadow, world)) { shadow.addMunger(munger); isMatched = true; if (shadow.getKind() == Shadow.StaticInitialization) { clazz.warnOnAddedStaticInitializer(shadow, munger.getSourceLocation()); } } } if (isMatched) { shadowAccumulator.add(shadow); } return isMatched; } } private void implement(LazyMethodGen mg) { List shadows = mg.matchedShadows; if (shadows == null) return; for (Iterator i = shadows.iterator(); i.hasNext();) { BcelShadow shadow = (BcelShadow) i.next(); ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.IMPLEMENTING_ON_SHADOW, shadow);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java
shadow.implement(); CompilationAndWeavingContext.leavingPhase(tok); } mg.getMaxLocals(); mg.matchedShadows = null; } public LazyClassGen getLazyClassGen() { return clazz; } public List getShadowMungers() { return shadowMungers; } public BcelWorld getWorld() { return world; } public static void setReweavableMode(boolean mode) { inReweavableMode = mode; } public static boolean getReweavableMode() { return inReweavableMode; } public String toString() { return "BcelClassWeaver instance for : " + clazz; } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
/* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * PARC initial implementation * Alexandre Vasseur @AspectJ ITDs * ******************************************************************/ package org.aspectj.weaver.bcel; import java.lang.reflect.Modifier; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.Signature; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.generic.FieldGen; import org.aspectj.apache.bcel.generic.InstructionBranch; import org.aspectj.apache.bcel.generic.InstructionConstants; import org.aspectj.apache.bcel.generic.InstructionFactory; import org.aspectj.apache.bcel.generic.InstructionHandle; import org.aspectj.apache.bcel.generic.InstructionList; import org.aspectj.apache.bcel.generic.InvokeInstruction; import org.aspectj.apache.bcel.generic.Type; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.ISourceLocation; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.bridge.WeaveMessage; import org.aspectj.bridge.context.CompilationAndWeavingContext; import org.aspectj.bridge.context.ContextToken; import org.aspectj.weaver.AjcMemberMaker; import org.aspectj.weaver.AnnotationAJ; import org.aspectj.weaver.AnnotationOnTypeMunger; import org.aspectj.weaver.BCException; import org.aspectj.weaver.ConcreteTypeMunger; import org.aspectj.weaver.Member; import org.aspectj.weaver.MethodDelegateTypeMunger; import org.aspectj.weaver.NameMangler; import org.aspectj.weaver.NewConstructorTypeMunger; import org.aspectj.weaver.NewFieldTypeMunger; import org.aspectj.weaver.NewMethodTypeMunger;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
import org.aspectj.weaver.NewParentTypeMunger; import org.aspectj.weaver.PerObjectInterfaceTypeMunger; import org.aspectj.weaver.PrivilegedAccessMunger; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedMemberImpl; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.ResolvedTypeMunger; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.TypeVariableReference; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.WeaverMessages; import org.aspectj.weaver.WeaverStateInfo; import org.aspectj.weaver.World; import org.aspectj.weaver.model.AsmRelationshipProvider; import org.aspectj.weaver.patterns.DeclareAnnotation; import org.aspectj.weaver.patterns.Pointcut; public class BcelTypeMunger extends ConcreteTypeMunger { public BcelTypeMunger(ResolvedTypeMunger munger, ResolvedType aspectType) { super(munger, aspectType); } public String toString() { return "(BcelTypeMunger " + getMunger() + ")"; } public boolean shouldOverwrite() { return false; } public boolean munge(BcelClassWeaver weaver) { ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.MUNGING_WITH, this); boolean changed = false; boolean worthReporting = true;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (munger.getKind() == ResolvedTypeMunger.Field) { changed = mungeNewField(weaver, (NewFieldTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.Method) { changed = mungeNewMethod(weaver, (NewMethodTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.MethodDelegate2) { changed = mungeMethodDelegate(weaver, (MethodDelegateTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.FieldHost) { changed = mungeFieldHost(weaver, (MethodDelegateTypeMunger.FieldHostTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.PerObjectInterface) { changed = mungePerObjectInterface(weaver, (PerObjectInterfaceTypeMunger) munger); worthReporting = false; } else if (munger.getKind() == ResolvedTypeMunger.PerTypeWithinInterface) { changed = mungePerTypeWithinTransformer(weaver); worthReporting = false; } else if (munger.getKind() == ResolvedTypeMunger.PrivilegedAccess) { changed = mungePrivilegedAccess(weaver, (PrivilegedAccessMunger) munger); worthReporting = false; } else if (munger.getKind() == ResolvedTypeMunger.Constructor) { changed = mungeNewConstructor(weaver, (NewConstructorTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.Parent) { changed = mungeNewParent(weaver, (NewParentTypeMunger) munger); } else if (munger.getKind() == ResolvedTypeMunger.AnnotationOnType) { changed = mungeNewAnnotationOnType(weaver, (AnnotationOnTypeMunger) munger); worthReporting = false; } else { throw new RuntimeException("unimplemented"); } if (changed && munger.changesPublicSignature()) { WeaverStateInfo info = weaver.getLazyClassGen().getOrCreateWeaverStateInfo(BcelClassWeaver.getReweavableMode());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
info.addConcreteMunger(this); } if (changed && worthReporting) { AsmRelationshipProvider.getDefault().addRelationship(((BcelWorld) getWorld()).getModelAsAsmManager(), weaver.getLazyClassGen().getType(), munger, getAspectType()); } if (changed && worthReporting && munger != null && !weaver.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) { String tName = weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getName(); if (tName.indexOf("no debug info available") != -1) tName = "no debug info available"; else tName = getShortname(weaver.getLazyClassGen().getType().getSourceLocation().getSourceFile().getPath()); String fName = getShortname(getAspectType().getSourceLocation().getSourceFile().getPath()); if (munger.getKind().equals(ResolvedTypeMunger.Parent)) { NewParentTypeMunger parentTM = (NewParentTypeMunger) munger; if (parentTM.getNewParent().isInterface()) { weaver.getWorld().getMessageHandler().handleMessage( WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSIMPLEMENTS, new String[] { weaver.getLazyClassGen().getType().getName(), tName, parentTM.getNewParent().getName(), fName }, weaver.getLazyClassGen().getClassName(), getAspectType().getName())); } else { weaver.getWorld().getMessageHandler().handleMessage( WeaveMessage .constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_DECLAREPARENTSEXTENDS, new String[] { weaver.getLazyClassGen().getType().getName(), tName, parentTM.getNewParent().getName(),
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
fName })); } } else if (munger.getKind().equals(ResolvedTypeMunger.FieldHost)) { } else { ResolvedMember declaredSig = munger.getSignature(); weaver.getWorld().getMessageHandler().handleMessage( WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ITD, new String[] { weaver.getLazyClassGen().getType().getName(), tName, munger.getKind().toString().toLowerCase(), getAspectType().getName(), fName + ":'" + declaredSig + "'" }, weaver.getLazyClassGen() .getClassName(), getAspectType().getName())); } } CompilationAndWeavingContext.leavingPhase(tok); return changed; } private String getShortname(String path) { int takefrom = path.lastIndexOf('/'); if (takefrom == -1) { takefrom = path.lastIndexOf('\\'); } return path.substring(takefrom + 1); } private boolean mungeNewAnnotationOnType(BcelClassWeaver weaver, AnnotationOnTypeMunger munger) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver.getLazyClassGen().addAnnotation(((BcelAnnotation) munger.getNewAnnotation()).getBcelAnnotation()); return true; } /** * For a long time, AspectJ did not allow binary weaving of declare parents. This restriction is now lifted but could do with * more testing! */ private boolean mungeNewParent(BcelClassWeaver weaver, NewParentTypeMunger munger) { LazyClassGen newParentTarget = weaver.getLazyClassGen(); ResolvedType newParent = munger.getNewParent(); boolean cont = true; cont = enforceDecpRule1_abstractMethodsImplemented(weaver, munger.getSourceLocation(), newParentTarget, newParent); cont = enforceDecpRule2_cantExtendFinalClass(weaver, munger.getSourceLocation(), newParentTarget, newParent) && cont; List methods = newParent.getMethodsWithoutIterator(false, true); for (Iterator iter = methods.iterator(); iter.hasNext();) { ResolvedMember superMethod = (ResolvedMember) iter.next(); if (!superMethod.getName().equals("<init>")) { LazyMethodGen subMethod = findMatchingMethod(newParentTarget, superMethod); if (subMethod != null && !subMethod.isBridgeMethod()) { if (!(subMethod.isSynthetic() && superMethod.isSynthetic())) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (!(subMethod.isStatic() && subMethod.getName().startsWith("access$"))) { cont = enforceDecpRule3_visibilityChanges(weaver, newParent, superMethod, subMethod) && cont; cont = enforceDecpRule4_compatibleReturnTypes(weaver, superMethod, subMethod) && cont; cont = enforceDecpRule5_cantChangeFromStaticToNonstatic(weaver, munger.getSourceLocation(), superMethod, subMethod) && cont; } } } } } if (!cont) return false; if (newParent.isClass()) { if (!attemptToModifySuperCalls(weaver, newParentTarget, newParent)) return false; newParentTarget.setSuperClass(newParent); } else { newParentTarget.addInterface(newParent, getSourceLocation()); } return true; } /** * Rule 1: For the declare parents to be allowed, the target type must override and implement inherited abstract methods (if the * type is not declared abstract) */ private boolean enforceDecpRule1_abstractMethodsImplemented(BcelClassWeaver weaver, ISourceLocation mungerLoc, LazyClassGen newParentTarget, ResolvedType newParent) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
boolean ruleCheckingSucceeded = true; if (!(newParentTarget.isAbstract() || newParentTarget.isInterface())) { List methods = newParent.getMethodsWithoutIterator(false, true); for (Iterator i = methods.iterator(); i.hasNext();) { ResolvedMember o = (ResolvedMember) i.next(); if (o.isAbstract() && !o.getName().startsWith("ajc$interField")) { ResolvedMember discoveredImpl = null; List newParentTargetMethods = newParentTarget.getType().getMethodsWithoutIterator(false, true); for (Iterator ii = newParentTargetMethods.iterator(); ii.hasNext() && discoveredImpl == null;) { ResolvedMember gen2 = (ResolvedMember) ii.next(); if (gen2.getName().equals(o.getName()) && gen2.getParameterSignature().equals(o.getParameterSignature()) && !gen2.isAbstract()) { discoveredImpl = gen2; } } if (discoveredImpl == null) { boolean satisfiedByITD = false;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii.hasNext();) { ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next(); if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.Method) { ResolvedMember sig = m.getSignature(); if (!Modifier.isAbstract(sig.getModifiers())) { if (m.isTargetTypeParameterized()) { ResolvedType genericOnType = getWorld().resolve(sig.getDeclaringType()).getGenericType(); m = m.parameterizedFor(newParent.discoverActualOccurrenceOfTypeInHierarchy(genericOnType)); sig = m.getSignature(); } if (ResolvedType.matches(AjcMemberMaker.interMethod(sig, m.getAspectType(), sig .getDeclaringType().resolve(weaver.getWorld()).isInterface()), o)) { satisfiedByITD = true; } } } else if (m.getMunger() != null && m.getMunger().getKind() == ResolvedTypeMunger.MethodDelegate2) { satisfiedByITD = true; } } if (!satisfiedByITD) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
error(weaver, "The type " + newParentTarget.getName() + " must implement the inherited abstract method " + o.getDeclaringType() + "." + o.getName() + o.getParameterSignature(), newParentTarget.getType().getSourceLocation(), new ISourceLocation[] { o.getSourceLocation(), mungerLoc }); ruleCheckingSucceeded = false; } } } } } return ruleCheckingSucceeded; } /** * Rule 2. Can't extend final types */ private boolean enforceDecpRule2_cantExtendFinalClass(BcelClassWeaver weaver, ISourceLocation mungerLoc, LazyClassGen newParentTarget, ResolvedType newParent) { if (newParent.isFinal()) { error(weaver, "Cannot make type " + newParentTarget.getName() + " extend final class " + newParent.getName(), newParentTarget.getType().getSourceLocation(), new ISourceLocation[] { mungerLoc }); return false; } return true; } /** * Rule 3. Can't narrow visibility of methods when overriding */ private boolean enforceDecpRule3_visibilityChanges(BcelClassWeaver weaver, ResolvedType newParent, ResolvedMember superMethod, LazyMethodGen subMethod) { boolean cont = true;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (superMethod.isPublic()) { if (subMethod.isProtected() || subMethod.isDefault() || subMethod.isPrivate()) { weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from " + newParent.getName(), superMethod.getSourceLocation())); cont = false; } } else if (superMethod.isProtected()) { if (subMethod.isDefault() || subMethod.isPrivate()) { weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from " + newParent.getName(), superMethod.getSourceLocation())); cont = false; } } else if (superMethod.isDefault()) { if (subMethod.isPrivate()) { weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error("Cannot reduce the visibility of the inherited method '" + superMethod + "' from " + newParent.getName(), superMethod.getSourceLocation())); cont = false; } } return cont; } /** * Rule 4. Can't have incompatible return types */ private boolean enforceDecpRule4_compatibleReturnTypes(BcelClassWeaver weaver, ResolvedMember superMethod, LazyMethodGen subMethod) { boolean cont = true;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
String superReturnTypeSig = superMethod.getGenericReturnType().getSignature(); String subReturnTypeSig = subMethod.getGenericReturnTypeSignature(); superReturnTypeSig = superReturnTypeSig.replace('.', '/'); subReturnTypeSig = subReturnTypeSig.replace('.', '/'); if (!superReturnTypeSig.equals(subReturnTypeSig)) { ResolvedType subType = weaver.getWorld().resolve(subMethod.getReturnType()); ResolvedType superType = weaver.getWorld().resolve(superMethod.getReturnType()); if (!superType.isAssignableFrom(subType)) { weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error("The return type is incompatible with " + superMethod.getDeclaringType() + "." + superMethod.getName() + superMethod.getParameterSignature(), subMethod.getSourceLocation())); cont = false; } } return cont; } /** * Rule5. Method overrides can't change the staticality (word?) - you can't override and make an instance method static or * override and make a static method an instance method. */ private boolean enforceDecpRule5_cantChangeFromStaticToNonstatic(BcelClassWeaver weaver, ISourceLocation mungerLoc, ResolvedMember superMethod, LazyMethodGen subMethod) { if (superMethod.isStatic() && !subMethod.isStatic()) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
error(weaver, "This instance method " + subMethod.getName() + subMethod.getParameterSignature() + " cannot override the static method from " + superMethod.getDeclaringType().getName(), subMethod .getSourceLocation(), new ISourceLocation[] { mungerLoc }); return false; } else if (!superMethod.isStatic() && subMethod.isStatic()) { error(weaver, "The static method " + subMethod.getName() + subMethod.getParameterSignature() + " cannot hide the instance method from " + superMethod.getDeclaringType().getName(), subMethod .getSourceLocation(), new ISourceLocation[] { mungerLoc }); return false; } return true; } public void error(BcelClassWeaver weaver, String text, ISourceLocation primaryLoc, ISourceLocation[] extraLocs) { IMessage msg = new Message(text, primaryLoc, true, extraLocs); weaver.getWorld().getMessageHandler().handleMessage(msg); } /** * Search the specified type for a particular method - do not use the return value in the comparison as it is not considered for * overriding. */ private LazyMethodGen findMatchingMethod(LazyClassGen newParentTarget, ResolvedMember m) { LazyMethodGen found = null; List methodGens = newParentTarget.getMethodGens(); for (Iterator i = methodGens.iterator(); i.hasNext() && found == null;) { LazyMethodGen gen = (LazyMethodGen) i.next(); if (gen.getName().equals(m.getName()) && gen.getParameterSignature().equals(m.getParameterSignature())) { found = gen; } } return found;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
} /** * The main part of implementing declare parents extends. Modify super ctor calls to target the new type. */ public boolean attemptToModifySuperCalls(BcelClassWeaver weaver, LazyClassGen newParentTarget, ResolvedType newParent) { String currentParent = newParentTarget.getSuperClass().getName(); if (newParent.getGenericType() != null) newParent = newParent.getGenericType(); List mgs = newParentTarget.getMethodGens(); for (Iterator iter = mgs.iterator(); iter.hasNext();) { LazyMethodGen aMethod = (LazyMethodGen) iter.next(); if (aMethod.getName().equals("<init>")) { InstructionList insList = aMethod.getBody(); InstructionHandle handle = insList.getStart(); while (handle != null) { if (handle.getInstruction().opcode == Constants.INVOKESPECIAL) { ConstantPool cpg = newParentTarget.getConstantPool(); InvokeInstruction invokeSpecial = (InvokeInstruction) handle.getInstruction(); if (invokeSpecial.getClassName(cpg).equals(currentParent) && invokeSpecial.getMethodName(cpg).equals("<init>")) { ResolvedMember newCtor = getConstructorWithSignature(newParent, invokeSpecial.getSignature(cpg)); if (newCtor == null) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
boolean satisfiedByITDC = false; for (Iterator ii = newParentTarget.getType().getInterTypeMungersIncludingSupers().iterator(); ii .hasNext() && !satisfiedByITDC;) { ConcreteTypeMunger m = (ConcreteTypeMunger) ii.next(); if (m.getMunger() instanceof NewConstructorTypeMunger) { if (m.getSignature().getSignature().equals(invokeSpecial.getSignature(cpg))) { satisfiedByITDC = true; } } } if (!satisfiedByITDC) { String csig = createReadableCtorSig(newParent, cpg, invokeSpecial); weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error("Unable to modify hierarchy for " + newParentTarget.getClassName() + " - the constructor " + csig + " is missing", this.getSourceLocation())); return false; } } int idx = cpg.addMethodref(newParent.getName(), invokeSpecial.getMethodName(cpg), invokeSpecial .getSignature(cpg)); invokeSpecial.setIndex(idx); } } handle = handle.getNext(); } } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
return true; } /** * Creates a nice signature for the ctor, something like "(int,Integer,String)" */ private String createReadableCtorSig(ResolvedType newParent, ConstantPool cpg, InvokeInstruction invokeSpecial) { StringBuffer sb = new StringBuffer(); Type[] ctorArgs = invokeSpecial.getArgumentTypes(cpg); sb.append(newParent.getClassName()); sb.append("("); for (int i = 0; i < ctorArgs.length; i++) { String argtype = ctorArgs[i].toString(); if (argtype.lastIndexOf(".") != -1) sb.append(argtype.substring(argtype.lastIndexOf(".") + 1)); else sb.append(argtype); if (i + 1 < ctorArgs.length) sb.append(","); } sb.append(")"); return sb.toString(); } private ResolvedMember getConstructorWithSignature(ResolvedType tx, String signature) { ResolvedMember[] mems = tx.getDeclaredJavaMethods(); for (int i = 0; i < mems.length; i++) { ResolvedMember rm = mems[i]; if (rm.getName().equals("<init>")) { if (rm.getSignature().equals(signature)) return rm; }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
} return null; } private boolean mungePrivilegedAccess(BcelClassWeaver weaver, PrivilegedAccessMunger munger) { LazyClassGen gen = weaver.getLazyClassGen(); ResolvedMember member = munger.getMember(); ResolvedType onType = weaver.getWorld().resolve(member.getDeclaringType(), munger.getSourceLocation()); if (onType.isRawType()) onType = onType.getGenericType(); if (onType.equals(gen.getType())) { if (member.getKind() == Member.FIELD) { addFieldGetter(gen, member, AjcMemberMaker.privilegedAccessMethodForFieldGet(aspectType, member)); addFieldSetter(gen, member, AjcMemberMaker.privilegedAccessMethodForFieldSet(aspectType, member)); return true; } else if (member.getKind() == Member.METHOD) { addMethodDispatch(gen, member, AjcMemberMaker.privilegedAccessMethodForMethod(aspectType, member)); return true; } else if (member.getKind() == Member.CONSTRUCTOR) { for (Iterator i = gen.getMethodGens().iterator(); i.hasNext();) { LazyMethodGen m = (LazyMethodGen) i.next(); if (m.getMemberView() != null && m.getMemberView().getKind() == Member.CONSTRUCTOR) { m.forcePublic(); } } return true;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
} else if (member.getKind() == Member.STATIC_INITIALIZATION) { gen.forcePublic(); return true; } else { throw new RuntimeException("unimplemented"); } } return false; } private void addFieldGetter(LazyClassGen gen, ResolvedMember field, ResolvedMember accessMethod) { LazyMethodGen mg = makeMethodGen(gen, accessMethod); InstructionList il = new InstructionList(); InstructionFactory fact = gen.getFactory(); if (field.isStatic()) { il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), BcelWorld.makeBcelType(field.getType()), Constants.GETSTATIC)); } else { il.append(InstructionConstants.ALOAD_0); il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), BcelWorld.makeBcelType(field.getType()), Constants.GETFIELD)); } il.append(InstructionFactory.createReturn(BcelWorld.makeBcelType(field.getType()))); mg.getBody().insert(il); gen.addMethodGen(mg, getSignature().getSourceLocation()); } private void addFieldSetter(LazyClassGen gen, ResolvedMember field, ResolvedMember accessMethod) { LazyMethodGen mg = makeMethodGen(gen, accessMethod); InstructionList il = new InstructionList(); InstructionFactory fact = gen.getFactory();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
Type fieldType = BcelWorld.makeBcelType(field.getType()); if (field.isStatic()) { il.append(InstructionFactory.createLoad(fieldType, 0)); il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), fieldType, Constants.PUTSTATIC)); } else { il.append(InstructionConstants.ALOAD_0); il.append(InstructionFactory.createLoad(fieldType, 1)); il.append(fact.createFieldAccess(gen.getClassName(), field.getName(), fieldType, Constants.PUTFIELD)); } il.append(InstructionFactory.createReturn(Type.VOID)); mg.getBody().insert(il); gen.addMethodGen(mg, getSignature().getSourceLocation()); } private void addMethodDispatch(LazyClassGen gen, ResolvedMember method, ResolvedMember accessMethod) { LazyMethodGen mg = makeMethodGen(gen, accessMethod); InstructionList il = new InstructionList(); InstructionFactory fact = gen.getFactory(); Type[] paramTypes = BcelWorld.makeBcelTypes(method.getParameterTypes()); int pos = 0; if (!method.isStatic()) { il.append(InstructionConstants.ALOAD_0); pos++; } for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; il.append(InstructionFactory.createLoad(paramType, pos)); pos += paramType.getSize(); } il.append(Utility.createInvoke(fact, (BcelWorld) aspectType.getWorld(), method));
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
il.append(InstructionFactory.createReturn(BcelWorld.makeBcelType(method.getReturnType()))); mg.getBody().insert(il); gen.addMethodGen(mg); } protected LazyMethodGen makeMethodGen(LazyClassGen gen, ResolvedMember member) { LazyMethodGen ret = new LazyMethodGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()), member .getName(), BcelWorld.makeBcelTypes(member.getParameterTypes()), UnresolvedType.getNames(member.getExceptions()), gen); return ret; } protected FieldGen makeFieldGen(LazyClassGen gen, ResolvedMember member) { return new FieldGen(member.getModifiers(), BcelWorld.makeBcelType(member.getReturnType()), member.getName(), gen .getConstantPool()); } private boolean mungePerObjectInterface(BcelClassWeaver weaver, PerObjectInterfaceTypeMunger munger) { LazyClassGen gen = weaver.getLazyClassGen(); if (couldMatch(gen.getBcelObjectType(), munger.getTestPointcut())) { FieldGen fg = makeFieldGen(gen, AjcMemberMaker.perObjectField(gen.getType(), aspectType)); gen.addField(fg, getSourceLocation()); Type fieldType = BcelWorld.makeBcelType(aspectType); LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC, fieldType, NameMangler.perObjectInterfaceGet(aspectType), new Type[0], new String[0], gen); InstructionList il = new InstructionList(); InstructionFactory fact = gen.getFactory(); il.append(InstructionConstants.ALOAD_0); il.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.GETFIELD));
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
il.append(InstructionFactory.createReturn(fieldType)); mg.getBody().insert(il); gen.addMethodGen(mg); LazyMethodGen mg1 = new LazyMethodGen(Modifier.PUBLIC, Type.VOID, NameMangler.perObjectInterfaceSet(aspectType), new Type[] { fieldType, }, new String[0], gen); InstructionList il1 = new InstructionList(); il1.append(InstructionConstants.ALOAD_0); il1.append(InstructionFactory.createLoad(fieldType, 1)); il1.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.PUTFIELD)); il1.append(InstructionFactory.createReturn(Type.VOID)); mg1.getBody().insert(il1); gen.addMethodGen(mg1); gen.addInterface(munger.getInterfaceType().resolve(weaver.getWorld()), getSourceLocation()); return true; } else { return false; } } private boolean mungePerTypeWithinTransformer(BcelClassWeaver weaver) { LazyClassGen gen = weaver.getLazyClassGen(); FieldGen fg = makeFieldGen(gen, AjcMemberMaker.perTypeWithinField(gen.getType(), aspectType)); gen.addField(fg, getSourceLocation());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
Type fieldType = BcelWorld.makeBcelType(aspectType); LazyMethodGen mg = new LazyMethodGen(Modifier.PUBLIC | Modifier.STATIC, fieldType, NameMangler .perTypeWithinLocalAspectOf(aspectType), new Type[0], new String[0], gen); InstructionList il = new InstructionList(); InstructionFactory fact = gen.getFactory(); il.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.GETSTATIC)); il.append(InstructionFactory.createReturn(fieldType)); mg.getBody().insert(il); gen.addMethodGen(mg); return true; } private boolean couldMatch(BcelObjectType bcelObjectType, Pointcut pointcut) { return !bcelObjectType.isInterface(); } private boolean mungeNewMethod(BcelClassWeaver weaver, NewMethodTypeMunger munger) { World w = weaver.getWorld(); ResolvedMember unMangledInterMethod = munger.getSignature().resolve(w); ResolvedMember interMethodBody = munger.getDeclaredInterMethodBody(aspectType, w); ResolvedMember interMethodDispatcher = munger.getDeclaredInterMethodDispatcher(aspectType, w); ResolvedMember memberHoldingAnyAnnotations = interMethodDispatcher;
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
ResolvedType onType = weaver.getWorld().resolve(unMangledInterMethod.getDeclaringType(), munger.getSourceLocation()); LazyClassGen gen = weaver.getLazyClassGen(); boolean mungingInterface = gen.isInterface(); if (onType.isRawType()) onType = onType.getGenericType(); boolean onInterface = onType.isInterface(); if (onType.isAnnotation()) { signalError(WeaverMessages.ITDM_ON_ANNOTATION_NOT_ALLOWED, weaver, onType); return false; } if (onType.isEnum()) { signalError(WeaverMessages.ITDM_ON_ENUM_NOT_ALLOWED, weaver, onType); return false; } if (onInterface && gen.getLazyMethodGen(unMangledInterMethod.getName(), unMangledInterMethod.getSignature(), true) != null) { return false; } if (onType.equals(gen.getType())) { ResolvedMember mangledInterMethod = AjcMemberMaker.interMethod(unMangledInterMethod, aspectType, onInterface); LazyMethodGen newMethod = makeMethodGen(gen, mangledInterMethod); if (mungingInterface) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
newMethod.setAccessFlags(Modifier.PUBLIC | Modifier.ABSTRACT); } if (weaver.getWorld().isInJava5Mode()) { AnnotationAJ annotationsOnRealMember[] = null; ResolvedType toLookOn = aspectType; if (aspectType.isRawType()) toLookOn = aspectType.getGenericType(); ResolvedMember realMember = getRealMemberForITDFromAspect(toLookOn, memberHoldingAnyAnnotations, false); if (realMember == null) throw new BCException("Couldn't find ITD holder member '" + memberHoldingAnyAnnotations + "' on aspect " + aspectType); annotationsOnRealMember = realMember.getAnnotations(); if (annotationsOnRealMember != null) { for (int i = 0; i < annotationsOnRealMember.length; i++) { AnnotationAJ annotationX = annotationsOnRealMember[i]; AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation(); AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true); newMethod.addAnnotation(new BcelAnnotation(ag, weaver.getWorld())); } } AnnotationAJ[][] pAnnos = realMember.getParameterAnnotations(); int offset = newMethod.isStatic() ? 0 : 1; if (pAnnos != null && pAnnos.length != 0) { int param = 0; for (int i = offset; i < pAnnos.length; i++) { AnnotationAJ[] annosOnParam = pAnnos[i];
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (annosOnParam != null && annosOnParam.length > 0) { for (int j = 0; j < annosOnParam.length; j++) { newMethod.addParameterAnnotation(param, annosOnParam[j]); } } param++; } } List allDecams = weaver.getWorld().getDeclareAnnotationOnMethods(); for (Iterator i = allDecams.iterator(); i.hasNext();) { DeclareAnnotation decaMC = (DeclareAnnotation) i.next(); if (decaMC.matches(unMangledInterMethod, weaver.getWorld()) && newMethod.getEnclosingClass().getType() == aspectType) { newMethod.addAnnotation(decaMC.getAnnotationX()); } } } if (!onInterface && !Modifier.isAbstract(mangledInterMethod.getModifiers())) { InstructionList body = newMethod.getBody(); InstructionFactory fact = gen.getFactory(); int pos = 0; if (!unMangledInterMethod.isStatic()) { body.append(InstructionFactory.createThis()); pos++; }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
Type[] paramTypes = BcelWorld.makeBcelTypes(mangledInterMethod.getParameterTypes()); for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos)); pos += paramType.getSize(); } body.append(Utility.createInvoke(fact, weaver.getWorld(), interMethodBody)); body.append(InstructionFactory.createReturn(BcelWorld.makeBcelType(mangledInterMethod.getReturnType()))); if (weaver.getWorld().isInJava5Mode()) { createAnyBridgeMethodsForCovariance(weaver, munger, unMangledInterMethod, onType, gen, paramTypes); } } else { } if (weaver.getWorld().isInJava5Mode()) { String basicSignature = mangledInterMethod.getSignature(); String genericSignature = ((ResolvedMemberImpl) mangledInterMethod).getSignatureForAttribute(); if (!basicSignature.equals(genericSignature)) { newMethod.addAttribute(createSignatureAttribute(gen.getConstantPool(), genericSignature)); } } weaver.addLazyMethodGen(newMethod); weaver.getLazyClassGen().warnOnAddedMethod(newMethod.getMethod(), getSignature().getSourceLocation());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
addNeededSuperCallMethods(weaver, onType, munger.getSuperMethodsCalled()); return true; } else if (onInterface && !Modifier.isAbstract(unMangledInterMethod.getModifiers())) { if (!gen.getType().isTopmostImplementor(onType)) { ResolvedType rtx = gen.getType().getTopmostImplementor(onType); if (!rtx.isExposedToWeaver()) { ISourceLocation sLoc = munger.getSourceLocation(); weaver.getWorld().getMessageHandler().handleMessage( MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_NON_EXPOSED_IMPLEMENTOR, rtx, getAspectType().getName()), (sLoc == null ? getAspectType().getSourceLocation() : sLoc))); } else { } return false; } else { ResolvedMember mangledInterMethod = AjcMemberMaker.interMethod(unMangledInterMethod, aspectType, false); LazyMethodGen mg = makeMethodGen(gen, mangledInterMethod); if (weaver.getWorld().isInJava5Mode()) { AnnotationAJ annotationsOnRealMember[] = null; ResolvedType toLookOn = aspectType; if (aspectType.isRawType()) toLookOn = aspectType.getGenericType(); ResolvedMember realMember = getRealMemberForITDFromAspect(toLookOn, memberHoldingAnyAnnotations, false);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (realMember == null) throw new BCException("Couldn't find ITD holder member '" + memberHoldingAnyAnnotations + "' on aspect " + aspectType); annotationsOnRealMember = realMember.getAnnotations(); if (annotationsOnRealMember != null) { for (int i = 0; i < annotationsOnRealMember.length; i++) { AnnotationAJ annotationX = annotationsOnRealMember[i]; AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation(); AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true); mg.addAnnotation(new BcelAnnotation(ag, weaver.getWorld())); } } AnnotationAJ[][] pAnnos = realMember.getParameterAnnotations(); int offset = mg.isStatic() ? 0 : 1; if (pAnnos != null && pAnnos.length != 0) { int param = 0; for (int i = offset; i < pAnnos.length; i++) { AnnotationAJ[] annosOnParam = pAnnos[i]; if (annosOnParam != null && annosOnParam.length > 0) { for (int j = 0; j < annosOnParam.length; j++) { mg.addParameterAnnotation(param, annosOnParam[j]); } } param++; } } } if (mungingInterface) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
mg.setAccessFlags(Modifier.PUBLIC | Modifier.ABSTRACT); } Type[] paramTypes = BcelWorld.makeBcelTypes(mangledInterMethod.getParameterTypes()); Type returnType = BcelWorld.makeBcelType(mangledInterMethod.getReturnType()); InstructionList body = mg.getBody(); InstructionFactory fact = gen.getFactory(); int pos = 0; if (!mangledInterMethod.isStatic()) { body.append(InstructionFactory.createThis()); pos++; } for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos)); pos += paramType.getSize(); } body.append(Utility.createInvoke(fact, weaver.getWorld(), interMethodBody)); Type t = BcelWorld.makeBcelType(interMethodBody.getReturnType()); if (!t.equals(returnType)) { body.append(fact.createCast(t, returnType)); } body.append(InstructionFactory.createReturn(returnType)); mg.definingType = onType; if (weaver.getWorld().isInJava5Mode()) { String basicSignature = mangledInterMethod.getSignature(); String genericSignature = ((ResolvedMemberImpl) mangledInterMethod).getSignatureForAttribute(); if (!basicSignature.equals(genericSignature)) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
mg.addAttribute(createSignatureAttribute(gen.getConstantPool(), genericSignature)); } } weaver.addOrReplaceLazyMethodGen(mg); addNeededSuperCallMethods(weaver, onType, munger.getSuperMethodsCalled()); if (munger.getDeclaredSignature() != null) { boolean needsbridging = false; ResolvedMember toBridgeTo = munger.getDeclaredSignature().parameterizedWith(null, munger.getSignature().getDeclaringType().resolve(getWorld()), false, munger.getTypeVariableAliases()); if (!toBridgeTo.getReturnType().getErasureSignature().equals( munger.getSignature().getReturnType().getErasureSignature())) needsbridging = true; UnresolvedType[] originalParams = toBridgeTo.getParameterTypes(); UnresolvedType[] newParams = munger.getSignature().getParameterTypes(); for (int ii = 0; ii < originalParams.length; ii++) { if (!originalParams[ii].getErasureSignature().equals(newParams[ii].getErasureSignature())) needsbridging = true; } if (needsbridging) { ResolvedMember bridgerMethod = AjcMemberMaker.bridgerToInterMethod(unMangledInterMethod, gen.getType()); ResolvedMember bridgingSetter = AjcMemberMaker.interMethodBridger(toBridgeTo, aspectType, false);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
LazyMethodGen bridgeMethod = makeMethodGen(gen, bridgingSetter); paramTypes = BcelWorld.makeBcelTypes(bridgingSetter.getParameterTypes()); Type[] bridgingToParms = BcelWorld.makeBcelTypes(unMangledInterMethod.getParameterTypes()); returnType = BcelWorld.makeBcelType(bridgingSetter.getReturnType()); body = bridgeMethod.getBody(); fact = gen.getFactory(); pos = 0; if (!bridgingSetter.isStatic()) { body.append(InstructionFactory.createThis()); pos++; } for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos)); if (!bridgingSetter.getParameterTypes()[i].getErasureSignature().equals( unMangledInterMethod.getParameterTypes()[i].getErasureSignature())) { body.append(fact.createCast(paramType, bridgingToParms[i])); } pos += paramType.getSize(); } body.append(Utility.createInvoke(fact, weaver.getWorld(), bridgerMethod)); body.append(InstructionFactory.createReturn(returnType)); gen.addMethodGen(bridgeMethod);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
} } return true; } } else { return false; } } /** * Helper method to create a signature attribute based on a string signature: e.g. "Ljava/lang/Object;LI<Ljava/lang/Double;>;" */ private Signature createSignatureAttribute(ConstantPool cp, String signature) { int nameIndex = cp.addUtf8("Signature"); int sigIndex = cp.addUtf8(signature); return new Signature(nameIndex, 2, sigIndex, cp); } /** * Create any bridge method required because of covariant returns being used. This method is used in the case where an ITD is * applied to some type and it may be in an override relationship with a method from the supertype - but due to covariance there * is a mismatch in return values. Example of when required: Super defines: Object m(String s) Sub defines: String m(String s) * then we need a bridge method in Sub called 'Object m(String s)' that forwards to 'String m(String s)' */ private void createAnyBridgeMethodsForCovariance(BcelClassWeaver weaver, NewMethodTypeMunger munger, ResolvedMember unMangledInterMethod, ResolvedType onType, LazyClassGen gen, Type[] paramTypes) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
boolean quitRightNow = false; String localMethodName = unMangledInterMethod.getName(); String localParameterSig = unMangledInterMethod.getParameterSignature(); String localReturnTypeESig = unMangledInterMethod.getReturnType().getErasureSignature(); boolean alreadyDone = false; ResolvedMember[] localMethods = onType.getDeclaredMethods(); for (int i = 0; i < localMethods.length; i++) { ResolvedMember member = localMethods[i]; if (member.getName().equals(localMethodName)) { if (member.getParameterSignature().equals(localParameterSig)) alreadyDone = true; } } if (!alreadyDone) { for (Iterator iter = onType.getSuperclass().getMethods(); iter.hasNext() && !quitRightNow;) { ResolvedMember aMethod = (ResolvedMember) iter.next(); if (aMethod.getName().equals(localMethodName) && aMethod.getParameterSignature().equals(localParameterSig)) { if (!aMethod.getReturnType().getErasureSignature().equals(localReturnTypeESig) && !Modifier.isPrivate(aMethod.getModifiers())) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
createBridgeMethod(weaver.getWorld(), munger, unMangledInterMethod, gen, paramTypes, aMethod); quitRightNow = true; } } } } } /** * Create a bridge method for a particular munger. * * @param world * @param munger * @param unMangledInterMethod the method to bridge 'to' that we have already created in the 'subtype' * @param clazz the class in which to put the bridge method * @param paramTypes Parameter types for the bridge method, passed in as an optimization since the caller is likely to have * already created them. * @param theBridgeMethod */ private void createBridgeMethod(BcelWorld world, NewMethodTypeMunger munger, ResolvedMember unMangledInterMethod, LazyClassGen clazz, Type[] paramTypes, ResolvedMember theBridgeMethod) { InstructionList body; InstructionFactory fact; int pos = 0; LazyMethodGen bridgeMethod = makeMethodGen(clazz, theBridgeMethod);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
bridgeMethod.setAccessFlags(bridgeMethod.getAccessFlags() | 0x00000040 /* * BRIDGE = 0x00000040 */); Type returnType = BcelWorld.makeBcelType(theBridgeMethod.getReturnType()); body = bridgeMethod.getBody(); fact = clazz.getFactory(); if (!unMangledInterMethod.isStatic()) { body.append(InstructionFactory.createThis()); pos++; } for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos));
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
pos += paramType.getSize(); } body.append(Utility.createInvoke(fact, world, unMangledInterMethod)); body.append(InstructionFactory.createReturn(returnType)); clazz.addMethodGen(bridgeMethod); } private String stringifyMember(ResolvedMember member) { StringBuffer buf = new StringBuffer(); buf.append(member.getReturnType().getName()); buf.append(' '); buf.append(member.getName()); if (member.getKind() != Member.FIELD) { buf.append("("); UnresolvedType[] params = member.getParameterTypes(); if (params.length != 0) { buf.append(params[0]); for (int i = 1, len = params.length; i < len; i++) { buf.append(", "); buf.append(params[i].getName()); } } buf.append(")"); } return buf.toString(); } private boolean mungeMethodDelegate(BcelClassWeaver weaver, MethodDelegateTypeMunger munger) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
ResolvedMember introduced = munger.getSignature(); LazyClassGen gen = weaver.getLazyClassGen(); ResolvedType fromType = weaver.getWorld().resolve(introduced.getDeclaringType(), munger.getSourceLocation()); if (fromType.isRawType()) fromType = fromType.getGenericType(); if (gen.getType().isAnnotation() || gen.getType().isEnum()) { return false; } boolean shouldApply = munger.matches(weaver.getLazyClassGen().getType(), aspectType); if (shouldApply) { if (munger.getImplClassName() == null) { boolean isOK = false; ListexistingMethods = gen.getMethodGens(); for (Iterator i = existingMethods.iterator(); i.hasNext() && !isOK;) { LazyMethodGen m = (LazyMethodGen) i.next(); if (m.getName().equals(introduced.getName()) && m.getParameterSignature().equals(introduced.getParameterSignature()) && m.getReturnType().equals(introduced.getReturnType())) { isOK = true; } } if (!isOK) { IMessage msg = new Message("@DeclareParents: No defaultImpl was specified but the type '" + gen.getName()
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+ "' does not implement the method '" + stringifyMember(introduced) + "' defined on the interface '" + introduced.getDeclaringType() + "'", weaver.getLazyClassGen().getType().getSourceLocation(), true, new ISourceLocation[] { munger.getSourceLocation() }); weaver.getWorld().getMessageHandler().handleMessage(msg); return false; } return true; } LazyMethodGen mg = new LazyMethodGen(introduced.getModifiers() - Modifier.ABSTRACT, BcelWorld.makeBcelType(introduced .getReturnType()), introduced.getName(), BcelWorld.makeBcelTypes(introduced.getParameterTypes()), BcelWorld .makeBcelTypesAsClassNames(introduced.getExceptions()), gen); if (weaver.getWorld().isInJava5Mode()) { AnnotationAJ annotationsOnRealMember[] = null; ResolvedType toLookOn = weaver.getWorld().lookupOrCreateName(introduced.getDeclaringType()); if (fromType.isRawType()) toLookOn = fromType.getGenericType(); ResolvedMember[] ms = toLookOn.getDeclaredJavaMethods(); for (int i = 0; i < ms.length; i++) { ResolvedMember m = ms[i]; if (introduced.getName().equals(m.getName()) && introduced.getSignature().equals(m.getSignature())) { annotationsOnRealMember = m.getAnnotations(); } } if (annotationsOnRealMember != null) { for (int i = 0; i < annotationsOnRealMember.length; i++) { AnnotationAJ annotationX = annotationsOnRealMember[i]; AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation(); AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
mg.addAnnotation(new BcelAnnotation(ag, weaver.getWorld())); } } } InstructionList body = new InstructionList(); InstructionFactory fact = gen.getFactory(); body.append(InstructionConstants.ALOAD_0); body.append(Utility.createGet(fact, munger.getDelegate(weaver.getLazyClassGen().getType()))); InstructionBranch ifNonNull = InstructionFactory.createBranchInstruction(Constants.IFNONNULL, null); body.append(ifNonNull); body.append(InstructionConstants.ALOAD_0); body.append(fact.createNew(munger.getImplClassName())); body.append(InstructionConstants.DUP); body.append(fact.createInvoke(munger.getImplClassName(), "<init>", Type.VOID, Type.NO_ARGS, Constants.INVOKESPECIAL)); body.append(Utility.createSet(fact, munger.getDelegate(weaver.getLazyClassGen().getType()))); InstructionHandle ifNonNullElse = body.append(InstructionConstants.ALOAD_0); ifNonNull.setTarget(ifNonNullElse); body.append(Utility.createGet(fact, munger.getDelegate(weaver.getLazyClassGen().getType()))); int pos = 0; if (!introduced.isStatic()) { pos++; } Type[] paramTypes = BcelWorld.makeBcelTypes(introduced.getParameterTypes()); for (int i = 0, len = paramTypes.length; i < len; i++) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos)); pos += paramType.getSize(); } body.append(Utility.createInvoke(fact, Constants.INVOKEINTERFACE, introduced)); body.append(InstructionFactory.createReturn(BcelWorld.makeBcelType(introduced.getReturnType()))); mg.getBody().append(body); weaver.addLazyMethodGen(mg); weaver.getLazyClassGen().warnOnAddedMethod(mg.getMethod(), getSignature().getSourceLocation()); return true; } return false; } private boolean mungeFieldHost(BcelClassWeaver weaver, MethodDelegateTypeMunger.FieldHostTypeMunger munger) { LazyClassGen gen = weaver.getLazyClassGen(); if (gen.getType().isAnnotation() || gen.getType().isEnum()) { return false; } munger.matches(weaver.getLazyClassGen().getType(), aspectType); ResolvedMember host = AjcMemberMaker.itdAtDeclareParentsField(weaver.getLazyClassGen().getType(), munger.getSignature() .getType(), aspectType); weaver.getLazyClassGen().addField(makeFieldGen(weaver.getLazyClassGen(), host), null); return true; } private ResolvedMember getRealMemberForITDFromAspect(ResolvedType aspectType, ResolvedMember lookingFor, boolean isCtorRelated) {
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
World world = aspectType.getWorld(); boolean debug = false; if (debug) { System.err.println("Searching for a member on type: " + aspectType); System.err.println("Member we are looking for: " + lookingFor); } ResolvedMember aspectMethods[] = aspectType.getDeclaredMethods(); UnresolvedType[] lookingForParams = lookingFor.getParameterTypes(); ResolvedMember realMember = null; for (int i = 0; realMember == null && i < aspectMethods.length; i++) { ResolvedMember member = aspectMethods[i]; if (member.getName().equals(lookingFor.getName())) { UnresolvedType[] memberParams = member.getGenericParameterTypes(); if (memberParams.length == lookingForParams.length) { if (debug) System.err.println("Reviewing potential candidates: " + member); boolean matchOK = true; if (isCtorRelated) { for (int j = 0; j < memberParams.length && matchOK; j++) { ResolvedType pMember = memberParams[j].resolve(world); ResolvedType pLookingFor = lookingForParams[j].resolve(world); if (pMember.isTypeVariableReference()) pMember = ((TypeVariableReference) pMember).getTypeVariable().getFirstBound().resolve(world); if (pMember.isParameterizedType() || pMember.isGenericType()) pMember = pMember.getRawType().resolve(aspectType.getWorld());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (pLookingFor.isTypeVariableReference()) pLookingFor = ((TypeVariableReference) pLookingFor).getTypeVariable().getFirstBound() .resolve(world); if (pLookingFor.isParameterizedType() || pLookingFor.isGenericType()) pLookingFor = pLookingFor.getRawType().resolve(world); if (debug) System.err.println("Comparing parameter " + j + " member=" + pMember + " lookingFor=" + pLookingFor); if (!pMember.equals(pLookingFor)) { matchOK = false; } } } if (matchOK) realMember = member; } } } if (debug && realMember == null) System.err.println("Didn't find a match"); return realMember; } private void addNeededSuperCallMethods(BcelClassWeaver weaver, ResolvedType onType, Set neededSuperCalls) { LazyClassGen gen = weaver.getLazyClassGen(); for (Iterator iter = neededSuperCalls.iterator(); iter.hasNext();) { ResolvedMember superMethod = (ResolvedMember) iter.next(); if (weaver.addDispatchTarget(superMethod)) { boolean isSuper = !superMethod.getDeclaringType().equals(gen.getType());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
String dispatchName; if (isSuper) dispatchName = NameMangler.superDispatchMethod(onType, superMethod.getName()); else dispatchName = NameMangler.protectedDispatchMethod(onType, superMethod.getName()); superMethod = superMethod.resolve(weaver.getWorld()); LazyMethodGen dispatcher = makeDispatcher(gen, dispatchName, superMethod, weaver.getWorld(), isSuper); weaver.addLazyMethodGen(dispatcher); } } } private void signalError(String msgid, BcelClassWeaver weaver, UnresolvedType onType) { IMessage msg = MessageUtil.error(WeaverMessages.format(msgid, onType.getName()), getSourceLocation()); weaver.getWorld().getMessageHandler().handleMessage(msg); } private boolean mungeNewConstructor(BcelClassWeaver weaver, NewConstructorTypeMunger newConstructorTypeMunger) { final LazyClassGen currentClass = weaver.getLazyClassGen(); final InstructionFactory fact = currentClass.getFactory(); ResolvedMember newConstructorMember = newConstructorTypeMunger.getSyntheticConstructor(); ResolvedType onType = newConstructorMember.getDeclaringType().resolve(weaver.getWorld()); if (onType.isRawType()) onType = onType.getGenericType(); if (onType.isAnnotation()) { signalError(WeaverMessages.ITDC_ON_ANNOTATION_NOT_ALLOWED, weaver, onType); return false; } if (onType.isEnum()) { signalError(WeaverMessages.ITDC_ON_ENUM_NOT_ALLOWED, weaver, onType); return false; }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
if (!onType.equals(currentClass.getType())) return false; ResolvedMember explicitConstructor = newConstructorTypeMunger.getExplicitConstructor(); LazyMethodGen mg = makeMethodGen(currentClass, newConstructorMember); mg.setEffectiveSignature(newConstructorTypeMunger.getSignature(), Shadow.ConstructorExecution, true); if (weaver.getWorld().isInJava5Mode()) { ResolvedMember interMethodDispatcher = AjcMemberMaker.postIntroducedConstructor(aspectType, onType, newConstructorTypeMunger.getSignature().getParameterTypes()); AnnotationAJ annotationsOnRealMember[] = null; ResolvedMember realMember = getRealMemberForITDFromAspect(aspectType, interMethodDispatcher, true); if (realMember == null) throw new BCException("Couldn't find ITD holder member '" + interMethodDispatcher + "' on aspect " + aspectType); annotationsOnRealMember = realMember.getAnnotations(); if (annotationsOnRealMember != null) { for (int i = 0; i < annotationsOnRealMember.length; i++) { AnnotationAJ annotationX = annotationsOnRealMember[i]; AnnotationGen a = ((BcelAnnotation) annotationX).getBcelAnnotation(); AnnotationGen ag = new AnnotationGen(a, weaver.getLazyClassGen().getConstantPool(), true); mg.addAnnotation(new BcelAnnotation(ag, weaver.getWorld())); } }
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
List allDecams = weaver.getWorld().getDeclareAnnotationOnMethods(); for (Iterator i = allDecams.iterator(); i.hasNext();) { DeclareAnnotation decaMC = (DeclareAnnotation) i.next(); if (decaMC.matches(explicitConstructor, weaver.getWorld()) && mg.getEnclosingClass().getType() == aspectType) { mg.addAnnotation(decaMC.getAnnotationX()); } } } currentClass.addMethodGen(mg); InstructionList body = mg.getBody(); UnresolvedType[] declaredParams = newConstructorTypeMunger.getSignature().getParameterTypes(); Type[] paramTypes = mg.getArgumentTypes(); int frameIndex = 1; for (int i = 0, len = declaredParams.length; i < len; i++) { body.append(InstructionFactory.createLoad(paramTypes[i], frameIndex)); frameIndex += paramTypes[i].getSize(); } Member preMethod = AjcMemberMaker.preIntroducedConstructor(aspectType, onType, declaredParams); body.append(Utility.createInvoke(fact, null, preMethod)); int arraySlot = mg.allocateLocal(1); body.append(InstructionFactory.createStore(Type.OBJECT, arraySlot)); body.append(InstructionConstants.ALOAD_0);
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
UnresolvedType[] superParamTypes = explicitConstructor.getParameterTypes(); for (int i = 0, len = superParamTypes.length; i < len; i++) { body.append(InstructionFactory.createLoad(Type.OBJECT, arraySlot)); body.append(Utility.createConstant(fact, i)); body.append(InstructionFactory.createArrayLoad(Type.OBJECT)); body.append(Utility.createConversion(fact, Type.OBJECT, BcelWorld.makeBcelType(superParamTypes[i]))); } body.append(Utility.createInvoke(fact, null, explicitConstructor)); body.append(InstructionConstants.ALOAD_0); Member postMethod = AjcMemberMaker.postIntroducedConstructor(aspectType, onType, declaredParams); UnresolvedType[] postParamTypes = postMethod.getParameterTypes(); for (int i = 1, len = postParamTypes.length; i < len; i++) { body.append(InstructionFactory.createLoad(Type.OBJECT, arraySlot)); body.append(Utility.createConstant(fact, superParamTypes.length + i - 1)); body.append(InstructionFactory.createArrayLoad(Type.OBJECT)); body.append(Utility.createConversion(fact, Type.OBJECT, BcelWorld.makeBcelType(postParamTypes[i]))); } body.append(Utility.createInvoke(fact, null, postMethod)); body.append(InstructionConstants.RETURN); return true; } private static LazyMethodGen makeDispatcher(LazyClassGen onGen, String dispatchName, ResolvedMember superMethod, BcelWorld world, boolean isSuper) { Type[] paramTypes = BcelWorld.makeBcelTypes(superMethod.getParameterTypes()); Type returnType = BcelWorld.makeBcelType(superMethod.getReturnType());
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
int modifiers = Modifier.PUBLIC; if (onGen.isInterface()) modifiers |= Modifier.ABSTRACT; LazyMethodGen mg = new LazyMethodGen(modifiers, returnType, dispatchName, paramTypes, UnresolvedType.getNames(superMethod .getExceptions()), onGen); InstructionList body = mg.getBody(); if (onGen.isInterface()) return mg; InstructionFactory fact = onGen.getFactory(); int pos = 0; body.append(InstructionFactory.createThis()); pos++; for (int i = 0, len = paramTypes.length; i < len; i++) { Type paramType = paramTypes[i]; body.append(InstructionFactory.createLoad(paramType, pos)); pos += paramType.getSize(); } if (isSuper) { body.append(Utility.createSuperInvoke(fact, world, superMethod)); } else { body.append(Utility.createInvoke(fact, world, superMethod)); } body.append(InstructionFactory.createReturn(returnType)); return mg; } private boolean mungeNewField(BcelClassWeaver weaver, NewFieldTypeMunger munger) { munger.getInitMethod(aspectType); LazyClassGen gen = weaver.getLazyClassGen(); ResolvedMember field = munger.getSignature();
263,837
Bug 263837 Error during Delete AJ Markers
Error sent through the AJDT mailing list. I believe this is an LTW weaving error, so not raising it against AJDT.
resolved fixed
1b54b4b
AspectJ
https://github.com/eclipse/org.aspectj
eclipse/org.aspectj
java
null
null
null
2009-02-06T00:15:57Z
2009-02-05T18:53:20Z
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
ResolvedType onType = weaver.getWorld().resolve(field.getDeclaringType(), munger.getSourceLocation()); if (onType.isRawType()) onType = onType.getGenericType(); boolean onInterface = onType.isInterface(); if (onType.isAnnotation()) { signalError(WeaverMessages.ITDF_ON_ANNOTATION_NOT_ALLOWED, weaver, onType); return false; } if (onType.isEnum()) { signalError(WeaverMessages.ITDF_ON_ENUM_NOT_ALLOWED, weaver, onType); return false; } ResolvedMember interMethodBody = munger.getInitMethod(aspectType); AnnotationAJ annotationsOnRealMember[] = null; if (weaver.getWorld().isInJava5Mode()) { ResolvedType toLookOn = aspectType; if (aspectType.isRawType()) toLookOn = aspectType.getGenericType(); ResolvedMember realMember = getRealMemberForITDFromAspect(toLookOn, interMethodBody, false); if (realMember == null) throw new BCException("Couldn't find ITD init member '" + interMethodBody + "' on aspect " + aspectType); annotationsOnRealMember = realMember.getAnnotations(); } if (onType.equals(gen.getType())) {