org.checkerframework.javacutil.UserError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
The Checker Framework enhances Java's type system to
make it more powerful and useful. This lets software developers
detect and prevent errors in their Java programs.
The Checker Framework includes compiler plug-ins ("checkers")
that find bugs or verify their absence. It also permits you to
write your own compiler plug-ins.
package org.checkerframework.javacutil;
/**
* Exception type indicating a mistake by an end user in using the Checker Framework, such as
* incorrect command-line arguments.
*/
@SuppressWarnings("serial")
public class UserError extends RuntimeException {
/**
* Constructs a new CheckerError with the specified detail message.
*
* @param message the detail message
*/
public UserError(String message) {
super(message);
if (message == null) {
throw new Error("Must have a detail message.");
}
}
/**
* Constructs a new CheckerError with a detail message composed from the given arguments.
*
* @param fmt the format string
* @param args the arguments for the format string
*/
public UserError(String fmt, Object... args) {
this(String.format(fmt, args));
}
}