< prev index next >

src/jdk.jconsole/share/classes/sun/tools/jconsole/ConnectDialog.java

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

@@ -311,13 +311,13 @@
                 statusBar.setText("");
 
                 if (remoteRadioButton.isSelected()) {
                     String txt = remoteTF.getText().trim();
                     String userName = userNameTF.getText().trim();
-                    userName = userName.equals("") ? null : userName;
+                    userName = userName.isEmpty() ? null : userName;
                     String password = passwordTF.getText();
-                    password = password.equals("") ? null : password;
+                    password = password.isEmpty() ? null : password;
                     try {
                         if (txt.startsWith(JConsole.ROOT_URL)) {
                             String url = txt;
                             jConsole.addUrl(url, userName, password, false);
                             remoteTF.setText(JConsole.ROOT_URL);
< prev index next >