Internal: resolve a few compiler warnings

@NotThreadSafe is not a valid standard java annotation. Removed unused method and empty @param javadoc annotation

Original commit: elastic/x-pack-elasticsearch@3583bcfa66
This commit is contained in:
javanna 2014-11-25 12:17:28 +01:00 committed by Luca Cavanna
parent 68e4876915
commit 2eaa1cb969
2 changed files with 1 additions and 13 deletions

View File

@ -13,7 +13,7 @@ import java.util.Arrays;
/**
* This is not a string but a CharSequence that can be cleared of its memory. Important for handling passwords.
*
* @NotThreadSafe There is a chance that the chars could be cleared while doing operations on the chars.
* Not thread safe There is a chance that the chars could be cleared while doing operations on the chars.
* <p/>
* TODO: dot net's SecureString implementation does some obfuscation of the password to prevent gleaming passwords
* from memory dumps. (this is hard as dot net uses windows system crypto. Thats probably the reason java still doesn't have it)
@ -25,8 +25,6 @@ public class SecuredString implements CharSequence {
/**
* Note: the passed in chars are not duplicated, but used directly for performance/optimization. DO NOT
* modify or clear the chars after it has been passed into this constructor.
*
* @param chars
*/
public SecuredString(char[] chars) {
this.chars = new char[chars.length];
@ -127,15 +125,6 @@ public class SecuredString implements CharSequence {
super.finalize();
}
public int indexOf(char toFind) {
for (int i = 0; i < chars.length; i++) {
if (chars[i] == toFind) {
return i;
}
}
return -1;
}
/**
* @param toAppend String to combine with this SecureString
* @return a new SecureString with toAppend concatenated

View File

@ -66,7 +66,6 @@ public class UsernamePasswordToken implements AuthenticationToken {
return Objects.hash(username, password.hashCode());
}
public static UsernamePasswordToken extractToken(TransportMessage<?> message, UsernamePasswordToken defaultToken) {
String authStr = message.getHeader(BASIC_AUTH_HEADER);
if (authStr == null) {