/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (final RuntimeException ignore) { em = null; } catch (final LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
setErrorManager(new ErrorManager());
/** * No argument constructor. */ public DOMConfigurator() { this(new ErrorManager()); }
/** * No argument constructor. */ public DOMConfigurator() { this(new ErrorManager()); }
/** * No argument constructor. */ public DOMConfigurator() { this(new ErrorManager()); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
/** * Constructs a {@code Handler} object with a default error manager instance * {@code ErrorManager}, the default encoding, and the default logging * level {@code Level.ALL}. It has no filter and no formatter. */ protected Handler() { this.errorMan = new ErrorManager(); this.level = DEFAULT_LEVEL; this.encoding = null; this.filter = null; this.formatter = null; this.prefix = this.getClass().getName(); }
private static Properties getVersionPropertiesFromFile(String path) { Properties properties = new Properties(); try { InputStream inputStream = PlatformVersion.class.getClassLoader().getResourceAsStream(path); if (inputStream != null) { properties.load(inputStream); inputStream.close(); } } catch (Throwable t) { ErrorManager errorManager = new ErrorManager(); errorManager.error("Failed to load version properties from " + path, new Exception(t), ErrorManager.OPEN_FAILURE); } return properties; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
/** * Used to get or create the default ErrorManager used before init. * @return the super error manager or a new ErrorManager. * @since JavaMail 1.5.3 */ private ErrorManager defaultErrorManager() { ErrorManager em; try { //Try to share the super error manager. em = super.getErrorManager(); } catch (RuntimeException | LinkageError ignore) { em = null; } //Don't assume that the super call is not null. if (em == null) { em = new ErrorManager(); } return em; }
Options options = new Options("nashorn"); options.set("anon.functions", true); options.set("parse.only", true); options.set("scripting", true); ErrorManager errors = new ErrorManager(); Context context = new Context(options, errors, Thread.currentThread().getContextClassLoader()); Source source = new Source("test", "var a = 10; var b = a + 1;" + "function someFunction() { return b + 1; } "); Parser parser = new Parser(context.getEnv(), source, errors); FunctionNode functionNode = parser.parse(); Block block = functionNode.getBody(); List<Statement> statements = block.getStatements();
public class LogFilter implements Filter { private final ErrorManager error = new ErrorManager(); @Override public boolean isLoggable(LogRecord record) { try { //Insert code. return false; } catch (RuntimeException re) { error.error(new SimpleFormatter().format(record), re, ErrorManager.GENERIC_FAILURE); return true; } }