I'm just wondering if there is a way to exit the Java block. It can be any block - if block, for a block, or even a simple {}. This is due to the fact that I often encounter such situations.
{ retCode = performSomeThing(); if(retCode == SUCCESS) { retCode = performSomethingElse(); if(retCode == SUCCESS) { . . . . . . } } }
These are several levels of indentation cluttering up the code I'm writing.
Instead, I need to do some way
if((retCode = performSomething()) != SUCCESS) GET_OUT_OF_BLOCK if((retCode = performSomethingElse()) != SUCCESS) GET_OUT_OF_BLOCK
Based on the value of retCode, I will perform any necessary processing outside the block. It would be nice if it were not related to writing this block in a try-catch block, creating a new type of exception, throwing it, and then catching it.
java
Jagat
source share