JERSEY-2471 Fix some javac type cast warnings