private static String getScriptName(AstMethod m) { // we want the original including file, since that will be the "script" Position p = m.getSourcePosition(); while (p instanceof IncludedPosition) { p = ((IncludedPosition)p).getIncludePosition(); } String fileName = p.getURL().getFile(); return fileName.substring(fileName.lastIndexOf('/') + 1); }
@Override public String getSourceFileName() { return sourcePosition.getURL().getFile(); }
@Override public String getSourceFileName() { return sourcePosition.getURL().getFile(); }
@Override public boolean equals(Object o){ if (o instanceof Position) { Position p = (Position)o; return getFirstLine() == p.getFirstLine() && getLastLine() == p.getLastLine() && getFirstCol() == p.getFirstCol() && getLastCol() == p.getLastCol() && getFirstOffset() == p.getFirstOffset() && getLastOffset() == p.getLastOffset() && ( (getURL() != null)? getURL().equals(p.getURL()): p.getURL() == null); } else { return false; } }
@Override public URL getURL() { return hack.getURL(); } @Override
public URL getSourceURL() { return sourcePosition.getURL(); }
public URL getSourceURL() { return sourcePosition.getURL(); }
public URL getSourceURL() { return sourcePosition.getURL(); }
public URL getSourceURL() { return sourcePosition.getURL(); }
@Override public String getSourceFileName() { return sourcePosition.getURL().getFile(); }
@Override public String getSourceFileName(IClass klass) { return ((AstClass)klass).getSourcePosition().getURL().getFile(); }
@Override public URL getURL() { return pos.getURL(); }
@Override public String getSourceFileName() { return sourcePosition.getURL().getFile(); }
@Override public String getSourceFileName(IClass klass) { return ((AstClass)klass).getSourcePosition().getURL().getFile(); }
@Override public URL getURL() { return pos.getURL(); }
@Override public String getSourceFileName(IMethod method, int bcOffset) { if (!(method instanceof AstMethod)){ return null; } Position pos = ((AstMethod)method).getSourcePosition(bcOffset); if (null == pos){ return null; } return pos.getURL().getFile(); }
@Override public URL getURL() { return hack.getURL(); } @Override
private static String ppPos(Position pos) { String file = pos.getURL().getFile(); file = file.substring(file.lastIndexOf('/')+1); int line = pos.getFirstLine(), start_offset = pos.getFirstOffset(), end_offset = pos.getLastOffset(); return file + '@' + line + ':' + start_offset + '-' + end_offset; }
private static String ppPos(Position pos) { String file = pos.getURL().getFile(); file = file.substring(file.lastIndexOf('/')+1); int line = pos.getFirstLine(), start_offset = pos.getFirstOffset(), end_offset = pos.getLastOffset(); return file + '@' + line + ':' + start_offset + '-' + end_offset; }
@Override public String getSourceFileName(IMethod method, int bcOffset) { if (!(method instanceof AstMethod)){ return null; } Position pos = ((AstMethod)method).getSourcePosition(bcOffset); if (null == pos){ return null; } return pos.getURL().getFile(); }