public ISourceLocation getSourceLocation() { // System.out.println("get context: " + this + " is " + sourceContext); if (sourceContext == null) { // System.err.println("no context: " + this); return null; } return sourceContext.makeSourceLocation(this); }
public ISourceLocation makeSourceLocation(IHasPosition location) { return sourceContext.makeSourceLocation(location); }
public ISourceLocation getSourceLocation() { return getSourceContext().makeSourceLocation(0, 0); }
/** * @param userPointcut */ private void raiseAmbiguityInDisjunctionError(Pointcut userPointcut, List<String> names) { StringBuffer formalNames = new StringBuffer(names.get(0).toString()); for (int i = 1; i < names.size(); i++) { formalNames.append(", "); formalNames.append(names.get(i)); } world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.AMBIGUOUS_BINDING_IN_OR, formalNames), userPointcut .getSourceContext().makeSourceLocation(userPointcut), null); }
public ISourceLocation getSourceLocation() { // System.out.println("get context: " + this + " is " + sourceContext); if (getSourceContext() == null) { // System.err.println("no context: " + this); return null; } return getSourceContext().makeSourceLocation(this); }
public ISourceLocation getSourceLocation() { if (sourceLocation == null) { if (sourceContext != null) { sourceLocation = sourceContext.makeSourceLocation(this); } } if (isBinary()) { if (binarySourceLocation == null) { binarySourceLocation = getBinarySourceLocation(sourceLocation); } return binarySourceLocation; } return sourceLocation; }
/** * @param userPointcut */ private void raiseNegationBindingError(Pointcut userPointcut) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.NEGATION_DOESNT_ALLOW_BINDING), userPointcut .getSourceContext().makeSourceLocation(userPointcut), null); }
@Override public ISourceLocation getSourceLocation() { ISourceContext isc = getDelegate().getSourceContext(); return isc.makeSourceLocation(new Position(startPos, endPos)); }
private void raiseAmbiguousBindingError(String name, Pointcut pointcut) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.AMBIGUOUS_BINDING, name), pointcut .getSourceContext().makeSourceLocation(pointcut), null); }
+ (context == null ? "unknown" : context.makeSourceLocation(0, 0).toString()));
@Override public ISourceLocation getSourceLocation() { ISourceLocation ret = super.getSourceLocation(); if ((ret == null || ret.getLine() == 0) && hasDeclarationLineNumberInfo()) { // lets see if we can do better ISourceContext isc = getSourceContext(); if (isc != null) { ret = isc.makeSourceLocation(getDeclarationLineNumber(), getDeclarationOffset()); } else { ret = new SourceLocation(null, getDeclarationLineNumber()); } } return ret; }
ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Around, pc, extraArgument, sl.getOffset(), sl
ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.After, pc, extraArgument, sl.getOffset(), sl
ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Before, pc, extraArgument, sl.getOffset(), sl
ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterThrowing, pc, extraArgument, sl.getOffset(), sl
ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset()); struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterReturning, pc, extraArgument, sl.getOffset(),
@Override public ISourceLocation getSourceLocation() { int sourceLine = getSourceLine(); if (sourceLine == 0 || sourceLine == -1) { // Thread.currentThread().dumpStack(); // System.err.println(this + ": " + range); return getEnclosingClass().getType().getSourceLocation(); } else { // For staticinitialization, if we have a nice offset, don't build a new source loc if (getKind() == Shadow.StaticInitialization && getEnclosingClass().getType().getSourceLocation().getOffset() != 0) { return getEnclosingClass().getType().getSourceLocation(); } else { int offset = 0; Kind kind = getKind(); if ((kind == MethodExecution) || (kind == ConstructorExecution) || (kind == AdviceExecution) || (kind == StaticInitialization) || (kind == PreInitialization) || (kind == Initialization)) { if (getEnclosingMethod().hasDeclaredLineNumberInfo()) { offset = getEnclosingMethod().getDeclarationOffset(); } } return getEnclosingClass().getType().getSourceContext().makeSourceLocation(sourceLine, offset); } } }