Java: “Local variable may not have been initialized” not intelligent enough?

Consider the following method: void a () { int x; boolean b = false; if (Math.random() < 0.5) { x = 0; b = true; } if (b) x++; } On x++ I get the "…