Examples of ISourceLocation


Examples of org.aspectj.bridge.ISourceLocation

    for (int i = 0; i < pointcuts.length; i++) {
      ResolvedMember pointcut = pointcuts[i];
      if (pointcut instanceof ResolvedPointcutDefinition) {
        ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pointcut;
        Pointcut p = rpcd.getPointcut();
        ISourceLocation sLoc = (p == null ? null : p.getSourceLocation());
        if (sLoc == null) {
          sLoc = rpcd.getSourceLocation();
        }
        ISourceLocation pointcutLocation = (sLoc == null ? null : createSourceLocation(sourcefilename, aspect, sLoc));
        ProgramElement pointcutElement = new ProgramElement(model, pointcut.getName(), IProgramElement.Kind.POINTCUT,
            pointcutLocation, pointcut.getModifiers(), NO_COMMENT, Collections.EMPTY_LIST);
        containingAspect.addChild(pointcutElement);
      }
    }
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

    for (int i = 0; i < children.length; i++) {
      ResolvedMember pcd = children[i];
      if (pcd instanceof ResolvedPointcutDefinition) {
        ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pcd;
        Pointcut p = rpcd.getPointcut();
        ISourceLocation sLoc = (p == null ? null : p.getSourceLocation());
        if (sLoc == null) {
          sLoc = rpcd.getSourceLocation();
        }
        parent.addChild(new ProgramElement(asm, pcd.getName(), IProgramElement.Kind.POINTCUT, getBinarySourceLocation(
            aspect, sLoc), pcd.getModifiers(), null, Collections.EMPTY_LIST));
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

    return decpElement;
  }

  public static String getHandle(AsmManager asm, Advice advice) {
    if (null == advice.handle) {
      ISourceLocation sl = advice.getSourceLocation();
      if (sl != null) {
        IProgramElement ipe = asm.getHierarchy().findElementForSourceLine(sl);
        advice.handle = ipe.getHandleIdentifier();
      }
    }
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

          && sourceLinesMatch(node.getSourceLocation(), shadow.getSourceLocation())) {
        return node;
      }
    }

    ISourceLocation sl = shadow.getSourceLocation();

    // XXX why not use shadow file? new SourceLocation(sl.getSourceFile(),
    // sl.getLine()),
    SourceLocation peLoc = new SourceLocation(enclosingNode.getSourceLocation().getSourceFile(), sl.getLine());
    peLoc.setOffset(sl.getOffset());
    IProgramElement peNode = new ProgramElement(asm, shadow.toString(), IProgramElement.Kind.CODE, peLoc, 0, null, null);

    // check to see if the enclosing shadow already has children with the
    // same name. If so we want to add a counter to the byteCodeName
    // otherwise
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

    // Process the NON-STANDARD COMPILER OPTIONS
    configureNonStandardOptions(config);

    compilerConfig.configurationRead();

    ISourceLocation location = null;
    if (config.getConfigFile() != null) {
      location = new SourceLocation(config.getConfigFile(), 0);
    }

    String message = parser.getOtherMessages(true);
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

      }
      boolean toString = (LangUtil.isEmpty(text));
      if (toString) {
        text = message.toString();
      }
      ISourceLocation loc = message.getSourceLocation();
      String context = null;
      if (null != loc) {
        File file = loc.getSourceFile();
        if (null != file) {
          String name = file.getName();
          if (!toString || (-1 == text.indexOf(name))) {
            sb.append(FileUtil.getBestPath(file));
            if (loc.getLine() > 0) {
              sb.append(":" + loc.getLine());
            }
            int col = loc.getColumn();
            if (0 < col) {
              sb.append(":" + col);
            }
            sb.append(" ");
          }
        }
        context = loc.getContext();
      }

      // per Wes' suggestion on dev...
      if (message.getKind() == IMessage.ERROR) {
        sb.append("[error] ");
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

        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

Examples of org.aspectj.bridge.ISourceLocation

   */
  public IProgramElement findNodeForSourceFile(IProgramElement node, String sourcefilePath) {
    // 1. why is <root> a sourcefile node?
    // 2. should isSourceFile() return true for a FILE that is a .class file...?
    if ((node.getKind().isSourceFile() && !node.getName().equals("<root>")) || node.getKind().isFile()) {
      ISourceLocation nodeLoc = node.getSourceLocation();
      if (nodeLoc != null && asm.getCanonicalFilePath(nodeLoc.getSourceFile()).equals(sourcefilePath)) {
        return node;
      }
      return null; // no need to search children of a source file node
    } else {
      // check the children
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

  public IProgramElement findCloserMatchForLineNumber(IProgramElement node, int lineno) {
    if (node == null || node.getChildren() == null) {
      return null;
    }
    for (IProgramElement child : node.getChildren()) {
      ISourceLocation childLoc = child.getSourceLocation();
      if (childLoc != null) {
        if (childLoc.getLine() <= lineno && childLoc.getEndLine() >= lineno) {
          // This child is a better match for that line number
          IProgramElement evenCloserMatch = findCloserMatchForLineNumber(child, lineno);
          if (evenCloserMatch == null) {
            return child;
          } else {
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

    // if (node != null && node.getSourceLocation() != null)
    // System.err.println("====\n1: " +
    // sourceFilePath + "\n2: " +
    // node.getSourceLocation().getSourceFile().getCanonicalPath().equals(sourceFilePath)
    // );
    ISourceLocation nodeSourceLocation = (node != null ? node.getSourceLocation() : null);
    return node != null
        && nodeSourceLocation != null
        && nodeSourceLocation.getSourceFile().getAbsolutePath().equals(sourceFilePath)
        && ((offSet != -1 && nodeSourceLocation.getOffset() == offSet) || offSet == -1)
        && ((nodeSourceLocation.getLine() <= lineNumber && nodeSourceLocation.getEndLine() >= lineNumber) || (lineNumber <= 1 && node
            .getKind().isSourceFile()));
    // } catch (IOException ioe) {
    // return false;
    // }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.