Examples of errors detected by the V6051 diagnostic


V6051. Use of jump statements in 'finally' block can lead to the loss of unhandled exceptions.


Apache Hive

V6051 The use of the 'return' statement in the 'finally' block can lead to the loss of unhandled exceptions. ObjectStore.java(9080)


private List<MPartitionColumnStatistics>
getMPartitionColumnStatistics(....)
throws NoSuchObjectException, MetaException
{
  boolean committed = false;

  try {
    .... /*some actions*/

    committed = commitTransaction();

    return result;
  }
  catch (Exception ex)
  {
    LOG.error("Error retrieving statistics via jdo", ex);
    if (ex instanceof MetaException) {
      throw (MetaException) ex;
    }
    throw new MetaException(ex.getMessage());
  }
  finally
  {
    if (!committed) {
      rollbackTransaction();
      return Lists.newArrayList();
    }
  }
}

Similar errors can be found in some other places:

  • V6051 The use of the 'return' statement in the 'finally' block can lead to the loss of unhandled exceptions. ObjectStore.java(808


Bugs Found

Checked Projects
363
Collected Errors
13 495