< prev index next >

src/java.base/share/classes/sun/security/util/ConsoleCallbackHandler.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

*** 101,111 **** " [" + nc.getDefaultName() + "] "); } System.err.flush(); String result = readLine(); ! if (result.equals("")) { result = nc.getDefaultName(); } nc.setName(result); --- 101,111 ---- " [" + nc.getDefaultName() + "] "); } System.err.flush(); String result = readLine(); ! if (result.isEmpty()) { result = nc.getDefaultName(); } nc.setName(result);
*** 210,220 **** String prompt = confirmation.getPrompt(); if (prompt == null) { prompt = ""; } prompt = prefix + prompt; ! if (!prompt.equals("")) { System.err.println(prompt); } for (int i = 0; i < options.length; i++) { if (optionType == ConfirmationCallback.UNSPECIFIED_OPTION) { --- 210,220 ---- String prompt = confirmation.getPrompt(); if (prompt == null) { prompt = ""; } prompt = prefix + prompt; ! if (!prompt.isEmpty()) { System.err.println(prompt); } for (int i = 0; i < options.length; i++) { if (optionType == ConfirmationCallback.UNSPECIFIED_OPTION) {
< prev index next >