Package org.aspectj.bridge

Examples of org.aspectj.bridge.ISourceLocation


        }
        pc.resolve(binding);
      }
      setIgnoreUnboundBindingNames(pc, bindings);

      ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(),
          struct.bMethod.getDeclarationOffset());
      struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.AfterThrowing, pc, extraArgument, sl.getOffset(), sl
          .getOffset() + 1, struct.context));
      return true;
    }
    return false;
  }
View Full Code Here


          }
          pc.resolve(binding);
        }
        setIgnoreUnboundBindingNames(pc, bindings);

        ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(),
            struct.bMethod.getDeclarationOffset());
        struct.ajAttributes.add(new AjAttribute.AdviceAttribute(AdviceKind.Around, pc, extraArgument, sl.getOffset(), sl
            .getOffset() + 1,// FIXME AVASM
            struct.context));
        return true;
      }
    }
View Full Code Here

  private static void setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AjAttributeFieldStruct struct) {
    IHierarchy top = (model == null ? null : model.getHierarchy());
    if (top != null && top.getRoot() != null) {
      IProgramElement ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.FIELD, struct.field.getName());
      if (ipe != null && ipe.getSourceLocation() != null) {
        ISourceLocation sourceLocation = ipe.getSourceLocation();
        int start = sourceLocation.getOffset();
        int end = start + struct.field.getName().length();
        deow.setLocation(struct.context, start, end);
        return;
      }
    }
View Full Code Here

        if (rtx == null) {
          // pr302460
          // null means there is something wrong with what we are looking at
          ResolvedType rt = classGen.getType();
          if (rt.isInterface()) {
            ISourceLocation sloc = munger.getSourceLocation();
            classWeaver
                .getWorld()
                .getMessageHandler()
                .handleMessage(
                    MessageUtil.error(
                        "ITD target "
                            + rt.getName()
                            + " is an interface but has been incorrectly determined to be the topmost implementor of "
                            + onType.getName() + ". ITD is " + this.getSignature(), sloc));
          }
          if (!onType.isAssignableFrom(rt)) {
            ISourceLocation sloc = munger.getSourceLocation();
            classWeaver
                .getWorld()
                .getMessageHandler()
                .handleMessage(
                    MessageUtil.error(
                        "ITD target " + rt.getName() + " doesn't appear to implement " + onType.getName()
                            + " why did we consider it the top most implementor? ITD is "
                            + this.getSignature(), sloc));
          }
        } else if (!rtx.isExposedToWeaver()) {
          ISourceLocation sLoc = munger.getSourceLocation();
          classWeaver
              .getWorld()
              .getMessageHandler()
              .handleMessage(
                  MessageUtil.error(WeaverMessages.format(WeaverMessages.ITD_NON_EXPOSED_IMPLEMENTOR, rtx,
View Full Code Here

    }
  }

  @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 {
View Full Code Here

        sourceFileName = s.substring(i + 1);
      } else {
        sourceFileName = s;
      }
    }
    ISourceLocation sLoc = new SourceLocation(getBinaryFile(), sl.getLine(), sl.getEndLine(),
        ((sl.getColumn() == 0) ? ISourceLocation.NO_COLUMN : sl.getColumn()), sl.getContext(), sourceFileName);
    return sLoc;
  }
View Full Code Here

    writeOutTypeAliases(s);
    s.writeInt(version);
  }

  public static ResolvedTypeMunger readField(VersionedDataInputStream s, ISourceContext context) throws IOException {
    ISourceLocation sloc = null;
    ResolvedMember fieldSignature = ResolvedMemberImpl.readResolvedMember(s, context);
    Set superMethodsCalled = readSuperMethodsCalled(s);
    sloc = readSourceLocation(s);
    List aliases = readInTypeAliases(s);
    NewFieldTypeMunger munger = new NewFieldTypeMunger(fieldSignature, superMethodsCalled, aliases);
View Full Code Here

      // something stopped us making it a lazy tjp
      // can't build tjp lazily, no suitable test...
      int valid = 0;
      for (Iterator<BcelAdvice> iter = badAdvice.iterator(); iter.hasNext();) {
        BcelAdvice element = iter.next();
        ISourceLocation sLoc = element.getSourceLocation();
        if (sLoc != null && sLoc.getLine() > 0) {
          valid++;
        }
      }
      if (valid != 0) {
        ISourceLocation[] badLocs = new ISourceLocation[valid];
        int i = 0;
        for (Iterator<BcelAdvice> iter = badAdvice.iterator(); iter.hasNext();) {
          BcelAdvice element = iter.next();
          ISourceLocation sLoc = element.getSourceLocation();
          if (sLoc != null) {
            badLocs[i++] = sLoc;
          }
        }
        world.getLint().multipleAdviceStoppingLazyTjp
View Full Code Here

    }
  }

  private static String findOrFakeUpNode(AsmManager model, ResolvedType onType) {
    IHierarchy hierarchy = model.getHierarchy();
    ISourceLocation sourceLocation = onType.getSourceLocation();
    String canonicalFilePath = model.getCanonicalFilePath(sourceLocation.getSourceFile());
    int lineNumber = sourceLocation.getLine();
    // Find the relevant source file node first
    IProgramElement node = hierarchy.findNodeForSourceFile(hierarchy.getRoot(), canonicalFilePath);
    if (node == null) {
      // Does not exist in the model - probably an inpath
      String bpath = onType.getBinaryPath();
View Full Code Here

        sourceFileName = s.substring(i + 1);
      } else {
        sourceFileName = s;
      }
    }
    ISourceLocation sLoc = new SourceLocation(getBinaryFile(aspect), sl.getLine(), sl.getEndLine(),
        ((sl.getColumn() == 0) ? ISourceLocation.NO_COLUMN : sl.getColumn()), sl.getContext(), sourceFileName);
    return sLoc;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.ISourceLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.