Downcasting should only be done where it can be trusted - generally only at system boundaries where objects are being generated and introduced to the system.

But casting a long to an int is not...