From: markt Date: Sun, 24 Oct 2010 13:08:26 +0000 (+0000) Subject: Allow Checkstyle's unused imports test to be used with the o.a.catalina.realm package X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=03c1522944ec21a49118f8647862dcfeb31fbe67;p=tomcat7.0 Allow Checkstyle's unused imports test to be used with the o.a.catalina.realm package Fix some Eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1026786 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/realm/CombinedRealm.java b/java/org/apache/catalina/realm/CombinedRealm.java index 95dec0015..c3858bcf4 100644 --- a/java/org/apache/catalina/realm/CombinedRealm.java +++ b/java/org/apache/catalina/realm/CombinedRealm.java @@ -29,7 +29,6 @@ import org.apache.catalina.Container; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleException; import org.apache.catalina.Realm; -import org.apache.catalina.util.LifecycleBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -182,7 +181,7 @@ public class CombinedRealm extends RealmBase { /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -212,7 +211,7 @@ public class CombinedRealm extends RealmBase { /** * Gracefully terminate the active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/realm/DataSourceRealm.java b/java/org/apache/catalina/realm/DataSourceRealm.java index 2e2c35942..e013bcedc 100644 --- a/java/org/apache/catalina/realm/DataSourceRealm.java +++ b/java/org/apache/catalina/realm/DataSourceRealm.java @@ -31,7 +31,6 @@ import javax.sql.DataSource; import org.apache.catalina.LifecycleException; import org.apache.catalina.core.StandardServer; -import org.apache.catalina.util.LifecycleBase; import org.apache.naming.ContextBindings; /** @@ -612,7 +611,7 @@ public class DataSourceRealm /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used diff --git a/java/org/apache/catalina/realm/GenericPrincipal.java b/java/org/apache/catalina/realm/GenericPrincipal.java index 82824ccb4..22f753624 100644 --- a/java/org/apache/catalina/realm/GenericPrincipal.java +++ b/java/org/apache/catalina/realm/GenericPrincipal.java @@ -120,6 +120,7 @@ public class GenericPrincipal implements Principal { */ protected String name = null; + @Override public String getName() { return (this.name); } diff --git a/java/org/apache/catalina/realm/JAASCallbackHandler.java b/java/org/apache/catalina/realm/JAASCallbackHandler.java index f7c74e453..1b8786acc 100644 --- a/java/org/apache/catalina/realm/JAASCallbackHandler.java +++ b/java/org/apache/catalina/realm/JAASCallbackHandler.java @@ -182,6 +182,7 @@ public class JAASCallbackHandler implements CallbackHandler { * @exception UnsupportedCallbackException if the login method requests * an unsupported callback type */ + @Override public void handle(Callback callbacks[]) throws IOException, UnsupportedCallbackException { diff --git a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java index 3fb1d8f13..868214ca8 100644 --- a/java/org/apache/catalina/realm/JAASMemoryLoginModule.java +++ b/java/org/apache/catalina/realm/JAASMemoryLoginModule.java @@ -140,6 +140,7 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { * * @exception LoginException if the abort fails */ + @Override public boolean abort() throws LoginException { // If our authentication was not successful, just return false @@ -170,6 +171,7 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { * * @exception LoginException if the commit fails */ + @Override public boolean commit() throws LoginException { log.debug("commit " + principal); @@ -210,6 +212,7 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { * @param options Configuration information for this specific * LoginModule instance */ + @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { log.debug("Init"); @@ -239,6 +242,7 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { * * @exception LoginException if the authentication fails */ + @Override public boolean login() throws LoginException { // Set up our CallbackHandler requests @@ -318,6 +322,7 @@ public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule { * * @exception LoginException if logging out failed */ + @Override public boolean logout() throws LoginException { subject.getPrincipals().remove(principal); diff --git a/java/org/apache/catalina/realm/JAASRealm.java b/java/org/apache/catalina/realm/JAASRealm.java index 19c4000cc..c676f943d 100644 --- a/java/org/apache/catalina/realm/JAASRealm.java +++ b/java/org/apache/catalina/realm/JAASRealm.java @@ -35,7 +35,6 @@ import javax.security.auth.login.LoginException; import org.apache.catalina.Container; import org.apache.catalina.LifecycleException; import org.apache.catalina.authenticator.Constants; -import org.apache.catalina.util.LifecycleBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.ExceptionUtils; @@ -590,7 +589,7 @@ public class JAASRealm /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used diff --git a/java/org/apache/catalina/realm/JDBCRealm.java b/java/org/apache/catalina/realm/JDBCRealm.java index d88a93fdd..639596dfb 100644 --- a/java/org/apache/catalina/realm/JDBCRealm.java +++ b/java/org/apache/catalina/realm/JDBCRealm.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.Properties; import org.apache.catalina.LifecycleException; -import org.apache.catalina.util.LifecycleBase; import org.apache.tomcat.util.ExceptionUtils; @@ -769,7 +768,7 @@ public class JDBCRealm /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -792,7 +791,7 @@ public class JDBCRealm /** * Gracefully terminate the active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/realm/JNDIRealm.java b/java/org/apache/catalina/realm/JNDIRealm.java index 43018029d..ab9e73b8d 100644 --- a/java/org/apache/catalina/realm/JNDIRealm.java +++ b/java/org/apache/catalina/realm/JNDIRealm.java @@ -54,7 +54,6 @@ import javax.naming.directory.SearchResult; import org.apache.catalina.LifecycleException; import org.apache.catalina.util.Base64; -import org.apache.catalina.util.LifecycleBase; import org.apache.tomcat.util.buf.ByteChunk; import org.apache.tomcat.util.buf.CharChunk; @@ -2034,7 +2033,7 @@ public class JNDIRealm extends RealmBase { /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -2056,7 +2055,7 @@ public class JNDIRealm extends RealmBase { /** * Gracefully terminate the active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/realm/LockOutRealm.java b/java/org/apache/catalina/realm/LockOutRealm.java index 5edb34da7..957c06b49 100644 --- a/java/org/apache/catalina/realm/LockOutRealm.java +++ b/java/org/apache/catalina/realm/LockOutRealm.java @@ -24,7 +24,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.apache.catalina.LifecycleException; -import org.apache.catalina.util.LifecycleBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -85,7 +84,7 @@ public class LockOutRealm extends CombinedRealm { /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used diff --git a/java/org/apache/catalina/realm/MemoryRealm.java b/java/org/apache/catalina/realm/MemoryRealm.java index 5d692249e..e5bb8f635 100644 --- a/java/org/apache/catalina/realm/MemoryRealm.java +++ b/java/org/apache/catalina/realm/MemoryRealm.java @@ -27,7 +27,6 @@ import java.util.Map; import org.apache.catalina.Globals; import org.apache.catalina.LifecycleException; -import org.apache.catalina.util.LifecycleBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.digester.Digester; @@ -279,7 +278,7 @@ public class MemoryRealm extends RealmBase { /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used diff --git a/java/org/apache/catalina/realm/RealmBase.java b/java/org/apache/catalina/realm/RealmBase.java index 797cb7f46..d9bd807c1 100644 --- a/java/org/apache/catalina/realm/RealmBase.java +++ b/java/org/apache/catalina/realm/RealmBase.java @@ -49,7 +49,6 @@ import org.apache.catalina.deploy.SecurityCollection; import org.apache.catalina.deploy.SecurityConstraint; import org.apache.catalina.mbeans.MBeanUtils; import org.apache.catalina.util.HexUtils; -import org.apache.catalina.util.LifecycleBase; import org.apache.catalina.util.LifecycleMBeanBase; import org.apache.catalina.util.MD5Encoder; import org.apache.juli.logging.Log; @@ -154,6 +153,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { /** * Return the Container with which this Realm has been associated. */ + @Override public Container getContainer() { return (container); @@ -166,6 +166,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * * @param container The associated Container */ + @Override public void setContainer(Container container) { Container oldContainer = this.container; @@ -237,6 +238,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * the corresponding version number, in the format * <description>/<version>. */ + @Override public String getInfo() { return info; @@ -274,6 +276,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * * @param listener The listener to add */ + @Override public void addPropertyChangeListener(PropertyChangeListener listener) { support.addPropertyChangeListener(listener); @@ -289,6 +292,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * @param credentials Password or other credentials to use in * authenticating this username */ + @Override public Principal authenticate(String username, String credentials) { String serverCredentials = getPassword(username); @@ -330,6 +334,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * @param md5a2 Second MD5 digest used to calculate the digest : * MD5(Method + ":" + uri) */ + @Override public Principal authenticate(String username, String clientDigest, String nOnce, String nc, String cnonce, String qop, String realm, @@ -382,6 +387,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * @param certs Array of client certificates, with the first one in * the array being the certificate of the client itself. */ + @Override public Principal authenticate(X509Certificate certs[]) { if ((certs == null) || (certs.length < 1)) @@ -416,6 +422,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ + @Override public void backgroundProcess() { // NOOP in base class } @@ -428,6 +435,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * @param request Request we are processing * @param context Context the Request is mapped to */ + @Override public SecurityConstraint [] findSecurityConstraints(Request request, Context context) { @@ -692,6 +700,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * * @exception IOException if an input/output error occurs */ + @Override public boolean hasResourcePermission(Request request, Response response, SecurityConstraint []constraints, @@ -869,6 +878,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * * @exception IOException if an input/output error occurs */ + @Override public boolean hasUserDataPermission(Request request, Response response, SecurityConstraint []constraints) @@ -953,6 +963,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { * * @param listener The listener to remove */ + @Override public void removePropertyChangeListener(PropertyChangeListener listener) { support.removePropertyChangeListener(listener); @@ -974,7 +985,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -999,7 +1010,7 @@ public abstract class RealmBase extends LifecycleMBeanBase implements Realm { /** * Gracefully terminate the active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported diff --git a/java/org/apache/catalina/realm/UserDatabaseRealm.java b/java/org/apache/catalina/realm/UserDatabaseRealm.java index a0e829642..2f8af4374 100644 --- a/java/org/apache/catalina/realm/UserDatabaseRealm.java +++ b/java/org/apache/catalina/realm/UserDatabaseRealm.java @@ -33,7 +33,6 @@ import org.apache.catalina.User; import org.apache.catalina.UserDatabase; import org.apache.catalina.Wrapper; import org.apache.catalina.core.StandardServer; -import org.apache.catalina.util.LifecycleBase; import org.apache.tomcat.util.ExceptionUtils; @@ -244,7 +243,7 @@ public class UserDatabaseRealm /** * Prepare for the beginning of active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#startInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used @@ -275,7 +274,7 @@ public class UserDatabaseRealm /** * Gracefully terminate the active use of the public methods of this * component and implement the requirements of - * {@link LifecycleBase#stopInternal()}. + * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported