code: @SuppressWarnings("PMD.ExceptionAsFlowControl")
      public static void main(String... args) {
          OptionsAndArgs options;
          try {
              options = new OptionsAndArgs(CommandDispatcher.getAvailableCommands(),args);
              VirtualMachineHandler vmHandler = new VirtualMachineHandler(options);
              CommandDispatcher dispatcher = new CommandDispatcher(options);
  
              // Attach a VirtualMachine to a given PID (if PID is given)
              Object vm = options.needsVm() ? vmHandler.attachVirtualMachine() : null;
  
              // Dispatch command
              int exitCode = 0;
              try {
                  exitCode = dispatcher.dispatchCommand(vm,vmHandler);
              } catch (InvocationTargetException e) {
                  throw new ProcessingException("InvocationTargetException",e,options);
              } catch (NoSuchMethodException e) {
                  throw new ProcessingException("Internal: NoSuchMethod",e,options);
              } catch (IllegalAccessException e) {
                  throw new ProcessingException("IllegalAccess",e,options);
              } finally {
                  if (vm != null) {
                      vmHandler.detachAgent(vm);
                  }
              }
              System.exit(exitCode);
  
          } catch (IllegalArgumentException exp) {
              System.err.println("Error: " + exp.getMessage() + "\n");
              CommandDispatcher.printHelp();
              System.exit(1);
          } catch (ProcessingException exp) {
              exp.printErrorMessage();
              System.exit(1);
          }
      }
docs: We use processing exception thrown here for better error reporting, not flow control.