Checks if there is any missing value in the given
instance.
@param ins The instance to check missing values in.
@throws Exception If there is a missing value in the
instance.
18092
protected void checkMissing(Instance ins) throws Exception {
    for (int j = 0; j < ins.numValues(); j++) {
      if (ins.index(j) != ins.classIndex())
        if (ins.isMissingSparse(j)) {
          throw new Exception("ERROR: KDTree can not deal with missing "
              + "values. Please run ReplaceMissingValues filter "
              + "on the dataset before passing it on to the KDTree.");
        }
    }
  }
1132929
private static boolean missingFormatArgs(String value) {
    try {
      Formatter.check(value);
    } catch (MissingFormatArgumentException e) {
      return true;
    } catch (Exception ignored) {
      // we don't care about other errors (it isn't supposed to be a format string)
    }
    return false;
  }
1300648
public void hasValue(long expected) {
    if (actual() == null) {
      failWithActual("expected an optional with value", expected);
    } else if (!actual().isPresent()) {
      failWithoutActual(fact("expected to have value", expected), simpleFact("but was absent"));
    } else {
      checkNoNeedToDisplayBothValues("getAsLong()").that(actual().getAsLong()).isEqualTo(expected);
    }
  }
444538
private void validate() throws Exception {
		final String text = parent.getText().trim();
		if (text.isEmpty() || text.length() == 1) {
			String msg = String.format("Empty query");
			invalid = true;
			throw new Exception(msg);
		}

		TargetQueryParser textParser = new TurtleOBDASQLParser(
		        apic.getMutablePrefixManager().getPrefixMap(),
                apic.getTermFactory(),
				apic.getTargetAtomFactory(),
				apic.getRdfFactory());
		ImmutableList<TargetAtom> query = textParser.parse(text);

		if (query == null) {
			invalid = true;
			throw parsingException;
		}
		List<IRI> invalidPredicates = TargetQueryValidator.validate(query, apic.getCurrentVocabulary());
		if (!invalidPredicates.isEmpty()) {
			String invalidList = "";
			for (IRI predicateIri : invalidPredicates) {
				invalidList += "- " + predicateIri + "\n";
			}
			String msg = String.format("ERROR: The below list of predicates is unknown by the ontology: \n %s Note: null indicates an unknown prefix.", invalidList);
			invalid = true;
			throw new Exception(msg);
		}
		invalid = false;
	}
1194654
private void _handleEmptyValue(TypedValueDecoder dec)
        throws XMLStreamException
    {
        try { // default action is to throw an exception
            dec.handleEmptyValue();
        } catch (IllegalArgumentException iae) {
            throw _constructTypeException(iae, "");
        }
    }
517832
private void checkAtLeast(int i) throws ContradictionException {
		ISet pot = target.getPotSet(g, i);
		ISet ker = target.getMandSet(g, i);
		int potSize = pot.size();
		if (potSize < degrees[i]) {
			g.removeNode(i, this);
		} else if (potSize == degrees[i] && g.getMandatoryNodes().contains(i) && ker.size() < potSize) {
			for (int s : pot) {
				target.enforce(g, i, s, this);
			}
		}
	}
872655
public void isEmpty() {
    if (actual() == null) {
      failWithActual(simpleFact("expected empty optional"));
    } else if (actual().isPresent()) {
      failWithoutActual(
          simpleFact("expected to be empty"),
          fact("but was present with value", actual().getAsLong()));
    }
  }
57106
public boolean assertCondition(Exception e){
		if((this.error != null || e != null) && !getESJDBC().isContinueOnError()) {
			return false;
		}
		return true;
	}
55601
@Then("^table '(.+?)' exists$")
    public void checkTable(String tableName) throws Exception {
        Statement myStatement = null;
        Connection myConnection = this.commonspec.getConnection();

        //query checks table existence, existence table name in system table  pg_tables
        String query = "SELECT * FROM pg_tables WHERE tablename = " + "\'" + tableName + "\'" + ";";
        try {
            myStatement = myConnection.createStatement();
            java.sql.ResultSet rs = myStatement.executeQuery(query);
            //if there are no data row
            if (rs.next() == false) {
                Assertions.assertThat(rs.next()).as("there are no table " + tableName).isTrue();
            } else {
                //data exist
                String resultTableName = rs.getString(2);
                assertThat(resultTableName).as("there are incorrect table name " + tableName).contains(tableName);
            }
            rs.close();
            myStatement.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
958617
private int setExceptionalCompletion(Throwable ex) {
        int s = recordExceptionalCompletion(ex);
        if ((s & DONE_MASK) == EXCEPTIONAL)
            internalPropagateException(ex);
        return s;
    }
96167
private void checkException(DataInputStream inputStream) throws IOException {
        short retCode = inputStream.readShort();
        if(retCode != 0) {
            String error = inputStream.readUTF();
            throw mapper.getError(retCode, error);
        }
    }
1365848
private static boolean falseForNotFound(IOException exception) {
    ComputeException serviceException = translate(exception);
    if (serviceException.getCode() == HTTP_NOT_FOUND) {
      return false;
    }
    throw serviceException;
  }
9273
public void verifyContained(V value) throws ValueOutOfRangeException {

    if (!isContained(value)) {
      throw new ValueOutOfRangeException(null, value, this.min, this.max);
    }
  }
396751
public void checkAndThrowException() throws Exception {
		Throwable t = exception.get();
		if (t != null) {
			if (t instanceof Exception) {
				throw (Exception) t;
			}
			else if (t instanceof Error) {
				throw (Error) t;
			}
			else {
				throw new Exception(t);
			}
		}
	}
805259
public static IsNullValue noKaboomNonNullValue(@Nonnull Location ins) {
        if (ins == null) {
            throw new NullPointerException("ins cannot be null");
        }
        return new IsNullValue(NO_KABOOM_NN, ins);
    }
215209
public void setExceptions(Class<?>[] exceptions) {
		for (Class<?> exception : exceptions) {
			// uses simple name because exception may be declared into .client package
			this.exceptions.add(exception.getSimpleName());
		}
	}
400444
private boolean isImplementationOf(JavaClass cls, JavaClass inf) {
        try {
            if (cls == null) {
                return false;
            }
            if (cls.implementationOf(inf)) {
                return true;
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
        return false;
    }