According to the Java Language Specification:
If an integer multiplication overflows, then the result is the low-order bits of the mathematical product as represented in some sufficiently large two's-complement format. As a result, if overflow occurs, then the sign of the result may not be the same as the sign of the mathematical product of the two operand values.
You are multiplying two integers that overflow, then store the result in a long, which won't help.
You either have to explicitly use long literals:
long l = 50000L * 50000L;
long l = 50000L * 50000; // this also works
or cast to long before multiplying:
long l = ((long) 50000) * ((long)50000);
long l = ((long) 50000) * 50000; // this also works
See the spec to see why it is enough to only explicitly use one long literal or one casting to long.