< prev index next >

src/java.desktop/share/classes/javax/swing/JPasswordField.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -469,11 +469,11 @@
             if (part == AccessibleText.CHARACTER) {
                 str = super.getAtIndex(part, index);
             } else {
                 // Treat the text displayed in the JPasswordField
                 // as one word and sentence.
-                char password[] = getPassword();
+                char[] password = getPassword();
                 if (password == null ||
                     index < 0 || index >= password.length) {
                     return null;
                 }
                 str = new String(password);

@@ -580,11 +580,11 @@
                 return new AccessibleTextSequence(seq.startIndex, seq.endIndex,
                                                   getEchoString(seq.text));
             } else {
                 // Treat the text displayed in the JPasswordField
                 // as one word, sentence, line and attribute run
-                char password[] = getPassword();
+                char[] password = getPassword();
                 if (password == null ||
                     index < 0 || index >= password.length) {
                     return null;
                 }
                 String text = new String(password);
< prev index next >