Project

General

Profile

Actions

Task #5877

closed

InvariantChecks: checkTrue and checkFalse methods

Added by Alexander Kamkin over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
Utilities
Target version:
Start date:
04/22/2015
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Published in build:
150520

Description

  1. checkTrue(condition) throws IllegalArgumentException if the condition is false.
  2. checkFalse(condition) throws IllegalArgumentException if the condition is true.
Actions #1

Updated by Alexander Kamkin over 9 years ago

  /**
   * Checks the invariant "Condition is true" and
   * throws an exception if it is violated.
   *  
   * @param condition Condition to be checked.
   * 
   * @throws IllegalArgumentException if the invariant is violated
   * ({@code condition} is {@code false}).
   */
  public static void checkTrue(final boolean condition) {
    if (!condition) {
      throw new IllegalArgumentException();
    }
  }
Actions #2

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Done in r970.

Actions #3

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from Resolved to Closed
  • Published in build set to 150520
Actions

Also available in: Atom PDF