Wild guessing here, I haven't even tried it (too lazy ). I'm putting my java intuition to the test.
Could it be an assignment matter ? On line 1, the compiler can see that the value, although an int literal, holds in a byte (less than 127). So no casting needeed When you pass a parameter to a function, it's a type problem. All the compiler cares about is that types are compatible and in that case, you must downcast an int to a byte.