Strange, the "else" part is after the whole thing, though I see the general pattern that leads to this it is still quite tricky to read.

if (filename == null)
    return other.filename == null;
else
    return filename.equals(other.filename)