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