if a variable is explicitly asigned a value at compile-time and is marked as final, this variable can be asigned to a variable which holds less bits, i.e char(16bits) to byte(8bits) (downcast), if and only if the final variables value will fit into the destination container (the byte var in this case).
Having the above, the compiler sees that this value will NOT change and that the value DOES fit into a smaller container without any loss of precision. So no problem there.
But the compiler has no way of knowing what value an agrument will receive at runtime, and this is why the compiler will complain about a possible loss of precision.
I hope i explained myself properly, it's quit eraly where i am.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA
Live life to an interface, not an implementation!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com