The Java Language Specification (JLS) defines exactly how the compiler should analyze code like this.
In your case, the local variable someObject is not definitely assigned before it is used in the if block. Definite assignment, covered in chapter 16 of the JLS, defines the exact rules by which a variable can be considered assigned to ("initialized").
It analyzes the try and if statements separately. After the try, someObject is not definitely assigned, because it isn't assigned in the catch block. In the if, the condition could be true or false. If it were true, you get an error because someObject is not definitely assigned at this point.
The Java compiler is not permitted to analyze this code and "figure out" that success can only be true iff someObject is assigned, because the language rules prescribe the precise analysis that must be performed. This isn't a case of the compiler being insufficiently smart - this is a case of the Java Language Standard being strict.
Note that if you use if(false) instead of if(success) you won't get an error, because the JLS specifies that false is a constant expression, and thus that the body of the loop will never execute.
The flag variable, in any case, is unnecessary. Moving the dependent code into the try, or setting the variable to null in the declaration and explicitly checking for someObject != null are all approaches that are simpler to understand and much less error-prone.