I wrote simple function that returns a string depending on which condition is TRUE. Here is my code:private String getMyString() {    if(!mStrigMember.isEmpty()) {        return mStrigMember;    }    return Function_that_throws_Exception_return_String();}Because of the Function_that_throws_Exception_return_String I was obliged to add a try catch block to end up with: private String getMyString() {    String TempString = ;    if(!mStrigMember.isEmpty()) {        return mStrigMember;    }    try {        TempString = Function_that_throws_Exception_return_String();    } catch (Exception e) { }    return TempString ;}But it's not elegant (TempString is created but not used when the first branch was TRUE). This is my opinion even though it's compiling and working properly.Any suggestions?
Return values and exceptions
java;coding style;source code;exceptions