Package org.aspectj.bridge

Examples of org.aspectj.bridge.SourceLocation


      // 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;
  }
View Full Code Here


    }
    return bindings;
  }

  public ISourceLocation makeSourceLocation(IHasPosition location) {
    return new SourceLocation(ISourceLocation.NO_FILE, 0);
  }
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

          inJar.close();
        }
        inJar.close();
      }
    } catch (FileNotFoundException ex) {
      IMessage message = new Message("Could not find input jar file " + inFile.getPath() + ", ignoring", new SourceLocation(
          inFile, 0), false);
      world.getMessageHandler().handleMessage(message);
    } catch (IOException ex) {
      IMessage message = new Message("Could not read input jar file " + inFile.getPath() + "(" + ex.getMessage() + ")",
          new SourceLocation(inFile, 0), true);
      world.getMessageHandler().handleMessage(message);
    } finally {
      if (inJar != null) {
        try {
          inJar.close();
        } catch (IOException ex) {
          IMessage message = new Message("Could not close input jar file " + inFile.getPath() + "(" + ex.getMessage()
              + ")", new SourceLocation(inFile, 0), true);
          world.getMessageHandler().handleMessage(message);
        }
      }
    }
View Full Code Here

                alreadyWarnedLocations.add(loc);
              }

              if (!(ba.getSignature() instanceof BcelMethod)
                  || !Utility.isSuppressing(ba.getSignature(), "adviceDidNotMatch")) {
                world.getLint().adviceDidNotMatch.signal(ba.getDeclaringAspect().toString(), new SourceLocation(
                    element.getSourceLocation().getSourceFile(), element.getSourceLocation().getLine()));
              }
            }
          }
        }
View Full Code Here

  protected static ISourceLocation readSourceLocation(VersionedDataInputStream s) throws IOException {
    // Location persistence for type mungers was added after 1.2.1 was shipped...
    if (s.getMajorVersion() < AjAttribute.WeaverVersionInfo.WEAVER_VERSION_MAJOR_AJ150) {
      return null;
    }
    SourceLocation ret = null;
    ObjectInputStream ois = null;
    try {
      // This logic copes with the location missing from the attribute - an EOFException will
      // occur on the next line and we ignore it.
      byte b = 0;
      // if we aren't on 1.6.9 or we are on 1.6.9 but not compressed, then read as object stream
      if (!s.isAtLeast169() || (b = s.readByte()) == 0) {
        ois = new ObjectInputStream(s);
        boolean validLocation = (Boolean) ois.readObject();
        if (validLocation) {
          File f = (File) ois.readObject();
          Integer ii = (Integer) ois.readObject();
          Integer offset = (Integer) ois.readObject();
          ret = new SourceLocation(f, ii.intValue());
          ret.setOffset(offset.intValue());
        }
      } else {
        boolean validLocation = b == 2;
        if (validLocation) {
          String path = s.readUtf8(s.readShort());
          File f = new File(path);
          ret = new SourceLocation(f, s.readInt());
          int offset = s.readInt();
          ret.setOffset(offset);
        }
      }

    } catch (EOFException eof) {
      return null; // This exception occurs if processing an 'old style' file where the
View Full Code Here

      return ss;
    } else {
      ResolvedType inType = getWorld().resolve(inScope.getName());
      ISourceContext sourceContext = new ISourceContext() {
        public ISourceLocation makeSourceLocation(IHasPosition position) {
          return new SourceLocation(new File(""), 0);
        }

        public ISourceLocation makeSourceLocation(int line, int offset) {
          return new SourceLocation(new File(""), line);
        }

        public int getOffset() {
          return 0;
        }
View Full Code Here

      return new SimpleScope(getWorld(), formalBindings);
    } else {
      ResolvedType inType = getWorld().resolve(inScope.getName());
      ISourceContext sourceContext = new ISourceContext() {
        public ISourceLocation makeSourceLocation(IHasPosition position) {
          return new SourceLocation(new File(""), 0);
        }

        public ISourceLocation makeSourceLocation(int line, int offset) {
          return new SourceLocation(new File(""), line);
        }

        public int getOffset() {
          return 0;
        }
View Full Code Here

    if (lineBreaks != null) {
      int line = Arrays.binarySearch(lineBreaks, position.getStart());
      if (line < 0) {
        line = -line;
      }
      return new SourceLocation(getSourceFile(), line); // ??? have more info
    } else {
      return new SourceLocation(getSourceFile(), 0);
    }
  }
View Full Code Here

  public ISourceLocation makeSourceLocation(int line, int offset) {
    if (line < 0) {
      line = 0;
    }
    SourceLocation sl = new SourceLocation(getSourceFile(), line);
    if (offset > 0) {
      sl.setOffset(offset);
    } else {
      if (lineBreaks != null) {
        int likelyOffset = 0;
        if (line > 0 && line < lineBreaks.length) {
          // 1st char of given line is next char after previous end of line
          likelyOffset = lineBreaks[line - 1] + 1;
        }
        sl.setOffset(likelyOffset);
      }
    }
    return sl;
  }
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.SourceLocation

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.