< prev index next >

src/share/classes/sun/awt/im/InputContext.java

Print this page
rev 1571 : 8010297: Missing isLoggable() checks in logging code
Summary: Add isLoggable() checks
Reviewed-by: anthony, mchung, serb
Contributed-by: Laurent Bourges <bourges.laurent@gmail.com>

*** 384,393 **** --- 384,396 ---- // new input method ((InputMethodAdapter) previousInputMethod).stopListening(); } previousInputMethod = null; + if (log.isLoggable(Level.FINE)) { + log.fine("Current client component " + currentClientComponent); + } if (log.isLoggable(Level.FINE)) log.fine("Current client component " + currentClientComponent); if (inputMethod instanceof InputMethodAdapter) { ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent); } inputMethod.activate();
*** 881,899 **** ((InputMethodAdapter) inputMethodInstance).supportsBelowTheSpot()); return inputMethodInstance; } private void logCreationFailed(Throwable throwable) { String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed", "Could not create {0}. Reason: {1}"); Object[] args = {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()), throwable.getLocalizedMessage()}; MessageFormat mf = new MessageFormat(errorTextFormat); - Logger logger = Logger.getLogger("sun.awt.im"); logger.config(mf.format(args)); } InputMethodLocator getInputMethodLocator() { if (inputMethod != null) { return inputMethodLocator.deriveLocator(inputMethod.getLocale()); } --- 884,904 ---- ((InputMethodAdapter) inputMethodInstance).supportsBelowTheSpot()); return inputMethodInstance; } private void logCreationFailed(Throwable throwable) { + Logger logger = Logger.getLogger("sun.awt.im"); + if (logger.isLoggable(Level.CONFIG)) { String errorTextFormat = Toolkit.getProperty("AWT.InputMethodCreationFailed", "Could not create {0}. Reason: {1}"); Object[] args = {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()), throwable.getLocalizedMessage()}; MessageFormat mf = new MessageFormat(errorTextFormat); logger.config(mf.format(args)); } + } InputMethodLocator getInputMethodLocator() { if (inputMethod != null) { return inputMethodLocator.deriveLocator(inputMethod.getLocale()); }
< prev index next >