< prev index next >
src/share/classes/sun/security/util/Password.java
Print this page
rev 1387 : 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
Reviewed-by: xuelei, mullan
Contributed-by: alexandre.boulgakov@oracle.com
*** 1,7 ****
/*
! * Copyright (c) 2003, 2006, 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
--- 1,7 ----
/*
! * Copyright (c) 2003, 2011, 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
*** 34,43 ****
--- 34,44 ----
* A utility class for reading passwords
*
*/
public class Password {
/** Reads user password from given input stream. */
+ @SuppressWarnings("fallthrough")
public static char[] readPassword(InputStream in) throws IOException {
char[] consoleEntered = null;
byte[] consoleBytes = null;
*** 85,95 ****
((PushbackInputStream)in).unread(c2);
} else {
done = true;
break;
}
!
default:
if (--room < 0) {
buf = new char[offset + 128];
room = buf.length - offset - 1;
System.arraycopy(lineBuffer, 0, buf, 0, offset);
--- 86,96 ----
((PushbackInputStream)in).unread(c2);
} else {
done = true;
break;
}
! /* fall through */
default:
if (--room < 0) {
buf = new char[offset + 128];
room = buf.length - offset - 1;
System.arraycopy(lineBuffer, 0, buf, 0, offset);
< prev index next >