Remove redundant throws clauses / Suppress inspections for some false positives

This commit is contained in:
Trustin Lee 2012-11-10 06:47:59 +09:00
parent 211b4059b1
commit 958d04a42b
5 changed files with 11 additions and 16 deletions

View File

@ -27,6 +27,7 @@ import java.util.regex.Pattern;
*/
public final class SystemPropertyUtil {
@SuppressWarnings("all")
private static boolean initializedLogger;
private static final InternalLogger logger;
private static boolean loggedException;

View File

@ -15,16 +15,14 @@
*/
package io.netty.example.securechat;
import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.ManagerFactoryParameters;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactorySpi;
import javax.net.ssl.X509TrustManager;
import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.cert.X509Certificate;
/**
* Bogus {@link TrustManagerFactorySpi} which accepts any certificate
@ -39,8 +37,7 @@ public class SecureChatTrustManagerFactory extends TrustManagerFactorySpi {
}
@Override
public void checkClientTrusted(
X509Certificate[] chain, String authType) throws CertificateException {
public void checkClientTrusted(X509Certificate[] chain, String authType) {
// Always trust - it is an example.
// You should do something in the real world.
// You will reach here only if you enabled client certificate auth,
@ -50,8 +47,7 @@ public class SecureChatTrustManagerFactory extends TrustManagerFactorySpi {
}
@Override
public void checkServerTrusted(
X509Certificate[] chain, String authType) throws CertificateException {
public void checkServerTrusted(X509Certificate[] chain, String authType) {
// Always trust - it is an example.
// You should do something in the real world.
System.err.println(

View File

@ -43,7 +43,6 @@ import java.security.InvalidAlgorithmParameterException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.Security;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;
@ -275,14 +274,12 @@ public class SocketSslEchoTest extends AbstractSocketTest {
}
@Override
public void checkClientTrusted(
X509Certificate[] chain, String authType) throws CertificateException {
public void checkClientTrusted(X509Certificate[] chain, String authType) {
// NOOP
}
@Override
public void checkServerTrusted(
X509Certificate[] chain, String authType) throws CertificateException {
public void checkServerTrusted(X509Certificate[] chain, String authType) {
// NOOP
}
};

View File

@ -23,6 +23,7 @@ import java.nio.channels.spi.AbstractSelectableChannel;
import java.nio.channels.spi.SelectorProvider;
import java.util.Set;
@SuppressWarnings("all")
public abstract class SctpChannel extends AbstractSelectableChannel {
static {
UnsupportedOperatingSystemException.raise();

View File

@ -27,7 +27,7 @@ public abstract class SctpServerChannel extends AbstractSelectableChannel {
UnsupportedOperatingSystemException.raise();
}
public static SctpServerChannel open() throws IOException {
public static SctpServerChannel open() {
return null;
}