private void removeCaughtExceptions(TryStatement tryStatement, boolean recordUncheckedCaughtExceptions) {
Argument[] catchArguments = tryStatement.catchArguments;
int length = catchArguments == null ? 0 : catchArguments.length;
for (int i = 0; i < length; i++) {
if (catchArguments[i].type instanceof UnionTypeReference) {
UnionTypeReference unionTypeReference = (UnionTypeReference) catchArguments[i].type;
TypeBinding caughtException;
for (int j = 0; j < unionTypeReference.typeReferences.length; j++) {
caughtException = unionTypeReference.typeReferences[j].resolvedType;
if ((caughtException instanceof ReferenceBinding) && caughtException.isValidBinding()) { // might be null when its the completion node
if (recordUncheckedCaughtExceptions) {