HADOOP-10449. Fix the javac warnings in the security package.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1582851 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Tsz-wo Sze 2014-03-28 18:15:41 +00:00
parent 2e799e5984
commit 640a72efbe
5 changed files with 14 additions and 20 deletions

View File

@ -467,6 +467,8 @@ Release 2.4.0 - UNRELEASED
HADOOP-10441. Namenode metric "rpc.RetryCache/NameNodeRetryCache.CacheHit"
can't be correctly processed by Ganglia. (jing9)
HADOOP-10449. Fix the javac warnings in the security package. (szetszwo)
BREAKDOWN OF HADOOP-10184 SUBTASKS AND RELATED JIRAS
HADOOP-10185. FileSystem API for ACLs. (cnauroth)

View File

@ -251,7 +251,6 @@ List<String> doGetGroups(String user) throws NamingException {
return groups;
}
@SuppressWarnings("deprecation")
DirContext getDirContext() throws NamingException {
if (ctx == null) {
// Set up the initial environment for LDAP connectivity

View File

@ -39,9 +39,6 @@
@InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
@InterfaceStability.Unstable
public class NetgroupCache {
private static final Log LOG = LogFactory.getLog(NetgroupCache.class);
private static boolean netgroupToUsersMapUpdated = true;
private static Map<String, Set<String>> netgroupToUsersMap =
new ConcurrentHashMap<String, Set<String>>();

View File

@ -57,7 +57,6 @@
import org.apache.hadoop.security.token.SecretManager;
import org.apache.hadoop.security.token.SecretManager.InvalidToken;
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.hadoop.util.StringUtils;
/**
* A utility class for dealing with SASL on RPC server
@ -70,7 +69,6 @@ public class SaslRpcServer {
public static final Map<String, String> SASL_PROPS =
new TreeMap<String, String>();
private static SaslServerFactory saslFactory;
private static SaslPropertiesResolver resolver;
public static enum QualityOfProtection {
AUTHENTICATION("auth"),

View File

@ -31,9 +31,6 @@
package org.apache.hadoop.security.ssl;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import java.io.IOException;
import java.io.InputStream;
import java.security.cert.Certificate;
@ -44,6 +41,7 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;
@ -52,6 +50,9 @@
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
/**
************************************************************************
* Copied from the not-yet-commons-ssl project at
@ -224,7 +225,6 @@ public final void check(final String[] host, final String[] cns,
public final String toString() { return "ALLOW_ALL"; }
};
@SuppressWarnings("unchecked")
abstract class AbstractVerifier implements SSLHostnameVerifier {
/**
@ -378,7 +378,7 @@ public void check(final String[] hosts, final String[] cns,
// STRICT implementations of the HostnameVerifier only use the
// first CN provided. All other CNs are ignored.
// (Firefox, wget, curl, Sun Java 1.4, 5, 6 all work this way).
TreeSet names = new TreeSet();
final Set<String> names = new TreeSet<String>();
if (cns != null && cns.length > 0 && cns[0] != null) {
names.add(cns[0]);
if (ie6) {
@ -404,10 +404,9 @@ public void check(final String[] hosts, final String[] cns,
boolean match = false;
out:
for (Iterator it = names.iterator(); it.hasNext();) {
for (Iterator<String> it = names.iterator(); it.hasNext();) {
// Don't trim the CN, though!
String cn = (String) it.next();
cn = cn.toLowerCase();
final String cn = it.next().toLowerCase();
// Store CN in StringBuffer in case we need to report an error.
buf.append(" <");
buf.append(cn);
@ -508,10 +507,9 @@ public static int countDots(final String s) {
}
}
@SuppressWarnings("unchecked")
static class Certificates {
public static String[] getCNs(X509Certificate cert) {
LinkedList cnList = new LinkedList();
final List<String> cnList = new LinkedList<String>();
/*
Sebastian Hauer's original StrictSSLProtocolSocketFactory used
getName() and had the following comment:
@ -568,8 +566,8 @@ Looks like toString() even works with non-ascii domain names!
* @return Array of SubjectALT DNS names stored in the certificate.
*/
public static String[] getDNSSubjectAlts(X509Certificate cert) {
LinkedList subjectAltList = new LinkedList();
Collection c = null;
final List<String> subjectAltList = new LinkedList<String>();
Collection<List<?>> c = null;
try {
c = cert.getSubjectAlternativeNames();
}
@ -578,9 +576,9 @@ public static String[] getDNSSubjectAlts(X509Certificate cert) {
cpe.printStackTrace();
}
if (c != null) {
Iterator it = c.iterator();
Iterator<List<?>> it = c.iterator();
while (it.hasNext()) {
List list = (List) it.next();
List<?> list = it.next();
int type = ((Integer) list.get(0)).intValue();
// If type is 2, then we've got a dNSName
if (type == 2) {