Examples of ISourceLocation


Examples of com.mountainminds.eclemma.core.ISourceLocation

  }

  public ISourceLocation[] getSourceLocations() throws JavaModelException {
    List l = new ArrayList();
    for (int i = 0; i < roots.length; i++) {
      ISourceLocation location = SourceLocation.findLocation(roots[i]);
      if (location != null) {
        l.add(location);
      }
    }
    ISourceLocation[] array = new ISourceLocation[l.size()];
View Full Code Here

Examples of org.apache.flex.compiler.common.ISourceLocation

     * {@link PooledValue} if it was already of the correct type.
     */
    public PooledValue checkInitialValue(IVariableNode iNode, Binding type, PooledValue initial_value)
    {
        assert initial_value != null : "Caller's should generate a compiler problem when a default_value is missing and *not* call this method!";
        ISourceLocation assignedValueExpressionLocation = iNode.getAssignedValueNode();
        IDefinition target_type = type.getDefinition();
       
        return checkInitialValue(assignedValueExpressionLocation, target_type, initial_value);
       
    }
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

        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

Examples of org.aspectj.bridge.ISourceLocation

  public boolean handleMessage(IMessage message) throws AbortException {
    if (!(message.isError() || message.isWarning()))
      return sink.handleMessage(message);
    // we only care about warnings and errors here...
    ISourceLocation sLoc = message.getSourceLocation();

    // See bug 62073. We should assert that the caller pass the correct primary source location.
    // But for AJ1.2 final we will simply do less processing of the locations if that is not the
    // case (By calling sink.handleMessage()) - this ensures we don't put out bogus source context info.
    if (sLoc instanceof EclipseSourceLocation) {
      EclipseSourceLocation esLoc = (EclipseSourceLocation) sLoc;
      if (currentlyWeaving != null && esLoc.getCompilationResult() != null) {
        if (!currentlyWeaving.equals(((EclipseSourceLocation) sLoc).getCompilationResult()))
          return sink.handleMessage(message);
        // throw new RuntimeException("Primary source location must match the file we are currently processing!");
      }
    }
    // bug 128618 - want to do a similar thing as in bug 62073 above, however
    // we're not an EclipseSourceLocation we're a SourceLocation.
    if (sLoc instanceof SourceLocation) {
      SourceLocation sl = (SourceLocation) sLoc;
      if (currentlyWeaving != null && sl.getSourceFile() != null) {
        if (!String.valueOf(currentlyWeaving.getFileName()).equals(sl.getSourceFile().getAbsolutePath())) {
          return sink.handleMessage(message);
          // throw new RuntimeException("Primary source location must match the file we are currently processing!");
        }
      }
    }

    CompilationResult problemSource = currentlyWeaving;
    if (problemSource == null) {
      // must be a problem found during completeTypeBindings phase of begin to compile
      if (sLoc instanceof EclipseSourceLocation) {
        problemSource = ((EclipseSourceLocation) sLoc).getCompilationResult();
      }
      if (problemSource == null) {
        // XXX this is ok for ajc, will have to do better for AJDT in time...
        return sink.handleMessage(message);
      }
    }
    int startPos = getStartPos(sLoc, problemSource);
    int endPos = getEndPos(sLoc, problemSource);
    int severity = message.isError() ? ProblemSeverities.Error : ProblemSeverities.Warning;
    char[] filename = problemSource.fileName;
    boolean usedBinarySourceFileName = false;
    if (problemSource.isFromBinarySource()) {
      if (sLoc != null) {
        filename = sLoc.getSourceFile().getPath().toCharArray();
        usedBinarySourceFileName = true;
      }
    }
    ReferenceContext referenceContext = findReferenceContextFor(problemSource);
    CategorizedProblem problem = compiler.problemReporter.createProblem(filename, IProblem.Unclassified, new String[0],
        new String[] { message.getMessage() }, severity, startPos, endPos, sLoc != null ? sLoc.getLine() : 0,
        sLoc != null ? sLoc.getColumn() : 0);
    IProblem[] seeAlso = buildSeeAlsoProblems(problem, message.getExtraSourceLocations(), problemSource,
        usedBinarySourceFileName);
    problem.setSeeAlsoProblems(seeAlso);

    StringBuffer details = new StringBuffer();
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

  private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List sourceLocations, CompilationResult problemSource,
      boolean usedBinarySourceFileName) {
    List ret = new ArrayList();

    for (int i = 0; i < sourceLocations.size(); i++) {
      ISourceLocation loc = (ISourceLocation) sourceLocations.get(i);
      if (loc != null) {
        DefaultProblem dp = new DefaultProblem(loc.getSourceFile().getPath().toCharArray(), "see also", 0, new String[] {},
            ProblemSeverities.Ignore, getStartPos(loc, null), getEndPos(loc, null), loc.getLine(), loc.getColumn());
        ret.add(dp);
      } else {
        System.err.println("About to abort due to null location, dumping state:");
        System.err.println("> Original Problem=" + problemSource.toString());
        throw new RuntimeException(
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

    }
  }

  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

Examples of org.aspectj.bridge.ISourceLocation

        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

Examples of org.aspectj.bridge.ISourceLocation

        ((sl.getColumn() == 0) ? ISourceLocation.NO_COLUMN : sl.getColumn()), sl.getContext(), sourceFileName);
    return sLoc;
  }

  private static ISourceLocation createSourceLocation(String sourcefilename, ResolvedType aspect, ISourceLocation sl) {
    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

Examples of org.aspectj.bridge.ISourceLocation

    if (!filenode.getKind().equals(IProgramElement.Kind.FILE_JAVA)) {
      return;
    }

    // create the class file node
    ISourceLocation binLocation = getBinarySourceLocation(aspect, aspect.getSourceLocation());
    String f = getBinaryFile(aspect).getName();
    IProgramElement classFileNode = new ProgramElement(model, f, IProgramElement.Kind.FILE, binLocation, 0, null, null);

    // create package ipe if one exists....
    IProgramElement root = model.getHierarchy().getRoot();
View Full Code Here

Examples of org.aspectj.bridge.ISourceLocation

      // 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
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.