You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by lg...@apache.org on 2015/06/30 13:34:44 UTC
mina-sshd git commit: [SSHD-511] Remove deprecated methods
Repository: mina-sshd
Updated Branches:
refs/heads/master 84d41b582 -> 6a4d5ffed
[SSHD-511] Remove deprecated methods
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/6a4d5ffe
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/6a4d5ffe
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/6a4d5ffe
Branch: refs/heads/master
Commit: 6a4d5ffedcf296703b0c25190ae4570f841062e8
Parents: 84d41b5
Author: Lyor Goldstein <lg...@vmware.com>
Authored: Tue Jun 30 14:34:35 2015 +0300
Committer: Lyor Goldstein <lg...@vmware.com>
Committed: Tue Jun 30 14:34:35 2015 +0300
----------------------------------------------------------------------
.../client/session/ClientUserAuthService.java | 4 +-
.../org/apache/sshd/common/FactoryManager.java | 28 +++++-----
.../org/apache/sshd/common/NamedFactory.java | 54 +-------------------
.../org/apache/sshd/common/NamedResource.java | 17 ++++--
.../org/apache/sshd/common/ServiceFactory.java | 2 +-
.../sshd/common/cipher/BaseRC4Cipher.java | 4 +-
.../common/keyprovider/KeyPairProvider.java | 6 +--
.../sshd/common/session/AbstractSession.java | 10 ++--
.../org/apache/sshd/common/session/Session.java | 4 +-
.../sshd/common/util/DirectoryScanner.java | 26 +++++-----
.../apache/sshd/common/util/SelectorUtils.java | 26 +++++-----
.../sshd/server/ServerFactoryManager.java | 20 ++++----
.../org/apache/sshd/server/auth/UserAuth.java | 4 +-
.../sshd/server/auth/gss/CredentialHelper.java | 2 +-
.../sshd/server/auth/gss/GSSAuthenticator.java | 2 +-
.../server/config/keys/AuthorizedKeyEntry.java | 4 +-
.../server/session/ServerUserAuthService.java | 16 +++---
.../org/apache/sshd/AuthenticationTest.java | 4 ++
.../java/org/apache/sshd/KeepAliveTest.java | 2 +-
.../test/java/org/apache/sshd/WindowTest.java | 2 +-
.../java/org/apache/sshd/agent/AgentTest.java | 3 +-
.../org/apache/sshd/common/SshBuilderTest.java | 3 --
.../sshd/deprecated/UserAuthPublicKey.java | 1 -
.../java/org/apache/sshd/server/ServerMain.java | 3 --
.../java/org/apache/sshd/server/ServerTest.java | 5 +-
.../org/apache/sshd/server/SshServerMain.java | 2 -
.../org/apache/sshd/server/SshServerTest.java | 1 -
.../test/java/org/apache/sshd/util/Utils.java | 22 ++++----
28 files changed, 115 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/client/session/ClientUserAuthService.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientUserAuthService.java b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientUserAuthService.java
index 42a728a..fbd6afa 100644
--- a/sshd-core/src/main/java/org/apache/sshd/client/session/ClientUserAuthService.java
+++ b/sshd-core/src/main/java/org/apache/sshd/client/session/ClientUserAuthService.java
@@ -30,6 +30,7 @@ import org.apache.sshd.client.future.AuthFuture;
import org.apache.sshd.client.future.DefaultAuthFuture;
import org.apache.sshd.common.FactoryManagerUtils;
import org.apache.sshd.common.NamedFactory;
+import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.Service;
import org.apache.sshd.common.ServiceFactory;
import org.apache.sshd.common.SshConstants;
@@ -93,7 +94,8 @@ public class ClientUserAuthService extends CloseableUtils.AbstractCloseable impl
String prefs = FactoryManagerUtils.getString(manager, ClientFactoryManager.PREFERRED_AUTHS);
if (!GenericUtils.isEmpty(prefs)) {
for (String pref : prefs.split(",")) {
- if (NamedFactory.Utils.get(authFactories, pref) != null) {
+ NamedFactory<UserAuth> factory = NamedResource.Utils.findByName(pref, String.CASE_INSENSITIVE_ORDER, authFactories);
+ if (factory != null) {
clientMethods.add(pref);
} else {
log.debug("Skip unknown prefered authentication method: {}", pref);
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/FactoryManager.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/FactoryManager.java b/sshd-core/src/main/java/org/apache/sshd/common/FactoryManager.java
index 8367e5b..b637597 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/FactoryManager.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/FactoryManager.java
@@ -167,7 +167,7 @@ public interface FactoryManager {
* value is a {@code long} then it will be parsed into one. Also, if
* the mapped value is an {@code Integer} but a {@code long} is expected,
* then it will be converted into one.
- * @return a valid <code>Map</code> containing configuration values, never <code>null</code>
+ * @return a valid <code>Map</code> containing configuration values, never {@code null}
*/
Map<String,Object> getProperties();
@@ -186,35 +186,35 @@ public interface FactoryManager {
/**
* Retrieve the list of named factories for <code>KeyExchange</code>.
*
- * @return a list of named <code>KeyExchange</code> factories, never <code>null</code>
+ * @return a list of named <code>KeyExchange</code> factories, never {@code null}
*/
List<NamedFactory<KeyExchange>> getKeyExchangeFactories();
/**
* Retrieve the list of named factories for <code>Cipher</code>.
*
- * @return a list of named <code>Cipher</code> factories, never <code>null</code>
+ * @return a list of named <code>Cipher</code> factories, never {@code null}
*/
List<NamedFactory<Cipher>> getCipherFactories();
/**
* Retrieve the list of named factories for <code>Compression</code>.
*
- * @return a list of named <code>Compression</code> factories, never <code>null</code>
+ * @return a list of named <code>Compression</code> factories, never {@code null}
*/
List<NamedFactory<Compression>> getCompressionFactories();
/**
* Retrieve the list of named factories for <code>Mac</code>.
*
- * @return a list of named <code>Mac</code> factories, never <code>null</code>
+ * @return a list of named <code>Mac</code> factories, never {@code null}
*/
List<NamedFactory<Mac>> getMacFactories();
/**
* Retrieve the list of named factories for <code>Signature</code>.
*
- * @return a list of named <code>Signature</code> factories, never <code>null</code>
+ * @return a list of named <code>Signature</code> factories, never {@code null}
*/
List<NamedFactory<Signature>> getSignatureFactories();
@@ -222,21 +222,21 @@ public interface FactoryManager {
* Retrieve the <code>KeyPairProvider</code> that will be used to find
* the host key to use on the server side or the user key on the client side.
*
- * @return the <code>KeyPairProvider</code>, never <code>null</code>
+ * @return the <code>KeyPairProvider</code>, never {@code null}
*/
KeyPairProvider getKeyPairProvider();
/**
* Retrieve the <code>Random</code> factory to be used.
*
- * @return the <code>Random</code> factory, never <code>null</code>
+ * @return the <code>Random</code> factory, never {@code null}
*/
Factory<Random> getRandomFactory();
/**
* Retrieve the list of named factories for <code>Channel</code> objects.
*
- * @return a list of named <code>Channel</code> factories, never <code>null</code>
+ * @return a list of named <code>Channel</code> factories, never {@code null}
*/
List<NamedFactory<Channel>> getChannelFactories();
@@ -250,16 +250,16 @@ public interface FactoryManager {
/**
* Retrieve the <code>ScheduledExecutorService</code> to be used.
*
- * @return the <code>ScheduledExecutorService</code>, never <code>null</code>
+ * @return the <code>ScheduledExecutorService</code>, never {@code null}
*/
ScheduledExecutorService getScheduledExecutorService();
/**
* Retrieve the <code>ForwardingFilter</code> to be used by the SSH server.
* If no filter has been configured (i.e. this method returns
- * <code>null</code>), then all forwarding requests will be rejected.
+ * {@code null}), then all forwarding requests will be rejected.
*
- * @return the <code>ForwardingFilter</code> or <code>null</code>
+ * @return the <code>ForwardingFilter</code> or {@code null}
*/
ForwardingFilter getTcpipForwardingFilter();
@@ -273,7 +273,7 @@ public interface FactoryManager {
/**
* Retrieve the <code>FileSystemFactory</code> to be used to traverse the file system.
*
- * @return a valid <code>FileSystemFactory</code> object or <code>null</code> if file based
+ * @return a valid <code>FileSystemFactory</code> object or {@code null} if file based
* interactions are not supported on this server
*/
FileSystemFactory getFileSystemFactory();
@@ -281,7 +281,7 @@ public interface FactoryManager {
/**
* Retrieve the list of SSH <code>Service</code> factories.
*
- * @return a list of named <code>Service</code> factories, never <code>null</code>
+ * @return a list of named <code>Service</code> factories, never {@code null}
*/
List<ServiceFactory> getServiceFactories();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java b/sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java
index 16e797b..321f1eb 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java
@@ -35,27 +35,16 @@ public interface NamedFactory<T> extends Factory<T>, NamedResource {
* Utility class to help using NamedFactories
*/
public static final class Utils {
- /**
- * @param factories The named factories
- * @return A {@link List} of all the factories names - in same order
- * as they appear in the input collection
- * @deprecated Use {@link NamedResource.Utils#getNameList(Collection)}
- */
- @Deprecated
- public static List<String> getNameList(Collection<? extends NamedFactory<?>> factories) {
- return NamedResource.Utils.getNameList(factories);
- }
-
/**
* Create an instance of the specified name by looking up the needed factory
* in the list.
* @param factories list of available factories
* @param name the factory name to use
* @param <T> type of object to create
- * @return a newly created object or <code>null</code> if the factory is not in the list
+ * @return a newly created object or {@code null} if the factory is not in the list
*/
public static <T> T create(Collection<? extends NamedFactory<T>> factories, String name) {
- NamedFactory<? extends T> f=get(factories, name);
+ NamedFactory<? extends T> f=NamedResource.Utils.findByName(name, String.CASE_INSENSITIVE_ORDER, factories);
if (f != null) {
return f.create();
} else {
@@ -63,45 +52,6 @@ public interface NamedFactory<T> extends Factory<T>, NamedResource {
}
}
- /**
- * Get a comma separated list of the factory names from the given list.
- * @param factories list of available factories
- * @return a comma separated list of factory names
- * @deprecated Use {@link NamedResource.Utils#getNames(Collection)}
- */
- @Deprecated
- public static String getNames(Collection<? extends NamedFactory<?>> factories) {
- return NamedResource.Utils.getNames(factories);
- }
-
- /**
- * Remove the factory identified by the name from the list.
- * @param factories list of factories
- * @param name the name of the factory to remove
- * @param <T> type of object to create
- * @return the factory removed from the list or <code>null</code> if not in the list
- */
- public static <T> NamedFactory<T> remove(Collection<? extends NamedFactory<T>> factories, String name) {
- NamedFactory<T> f=get(factories, name);
- if (f != null) {
- factories.remove(f);
- }
- return f;
- }
-
- /**
- * Retrieve the factory identified by its name from the list.
- * @param factories list of available factories
- * @param name the name of the factory to retrieve - ignored if {@code null}/empty
- * @param <T> type of object create by the factories - ignored if {@code null}/empty
- * @return A (case <U>insensitive</U>) matching factory or {@code null} if not found in the list
- * @deprecated Use {@link NamedResource.Utils#findByName(String, java.util.Comparator, Collection)
- */
- @Deprecated
- public static <T> NamedFactory<T> get(Collection<? extends NamedFactory<T>> factories, String name) {
- return NamedResource.Utils.findByName(name, String.CASE_INSENSITIVE_ORDER, factories);
- }
-
public static final <S extends OptionalFeature,T,E extends NamedFactory<T>> List<NamedFactory<T>> setUpTransformedFactories(
boolean ignoreUnsupported, Collection<? extends S> preferred, Transformer<? super S,? extends E> xform) {
List<NamedFactory<T>> avail=new ArrayList<>(preferred.size());
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/NamedResource.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/NamedResource.java b/sshd-core/src/main/java/org/apache/sshd/common/NamedResource.java
index c5032d8..08da1c5 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/NamedResource.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/NamedResource.java
@@ -92,15 +92,22 @@ public interface NamedResource {
public static String getNames(Collection<? extends NamedResource> resources) {
return GenericUtils.join(getNameList(resources), ',');
}
-
+
/**
+ * Remove the resource identified by the name from the list.
* @param name Name of the resource - ignored if {@code null}/empty
+ * @param c The {@link Comparator} to decide whether the {@link NamedResource#getName()}
+ * matches the <tt>name</tt> parameter
* @param resources The {@link NamedResource} to check - ignored if {@code null}/empty
- * @return The <U>first</U> resource whose name matches case <U>sensitive</U>
- * the given name - {@code null} if no match found
+ * @return the removed resource from the list or {@code null} if not in the list
*/
- public static <R extends NamedResource> R findByName(String name, Collection<? extends R> resources) {
- return findByName(name, GenericUtils.CASE_SENSITIVE_ORDER, resources);
+ public static <R extends NamedResource> R removeByName(String name, Comparator<? super String> c, Collection<? extends R> resources) {
+ R r = findByName(name, c, resources);
+ if (r != null) {
+ resources.remove(r);
+ }
+
+ return r;
}
/**
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/ServiceFactory.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/ServiceFactory.java b/sshd-core/src/main/java/org/apache/sshd/common/ServiceFactory.java
index b6fd3df..60dc1e3 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/ServiceFactory.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/ServiceFactory.java
@@ -35,7 +35,7 @@ public interface ServiceFactory extends NamedResource {
* in the list (case <U>insensitive</U>.
* @param factories list of available factories
* @param name the factory name to use
- * @return a newly created object or <code>null</code> if the factory is not in the list
+ * @return a newly created object or {@code null} if the factory is not in the list
* @throws IOException if session creation failed
* @see ServiceFactory#create(Session)
*/
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/cipher/BaseRC4Cipher.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/cipher/BaseRC4Cipher.java b/sshd-core/src/main/java/org/apache/sshd/common/cipher/BaseRC4Cipher.java
index 7183ae0..a6cdc68 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/cipher/BaseRC4Cipher.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/cipher/BaseRC4Cipher.java
@@ -18,10 +18,10 @@
*/
package org.apache.sshd.common.cipher;
-import org.apache.sshd.common.util.SecurityUtils;
-
import javax.crypto.spec.SecretKeySpec;
+import org.apache.sshd.common.util.SecurityUtils;
+
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/keyprovider/KeyPairProvider.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/keyprovider/KeyPairProvider.java b/sshd-core/src/main/java/org/apache/sshd/common/keyprovider/KeyPairProvider.java
index 699ee8c..2f22413 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/keyprovider/KeyPairProvider.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/keyprovider/KeyPairProvider.java
@@ -58,17 +58,17 @@ public interface KeyPairProvider {
/**
* Load available keys.
- * @return an {@link Iterable} instance of available keys, never <code>null</code>
+ * @return an {@link Iterable} instance of available keys, never {@code null}
*/
Iterable<KeyPair> loadKeys();
/**
* Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or
* "ecdsa-sha2-nistp{256,384,521}". If there is no key of this type, return
- * <code>null</code>
+ * {@code null}
*
* @param type the type of key to load
- * @return a valid key pair or <code>null</code>
+ * @return a valid key pair or {@code null}
*/
KeyPair loadKey(String type);
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java b/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
index a9e817b..e798f67 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
@@ -203,13 +203,13 @@ public abstract class AbstractSession extends CloseableUtils.AbstractInnerClosea
/**
* Retrieve the session from the MINA session.
* If the session has not been attached and allowNull is <code>false</code>,
- * an IllegalStateException will be thrown, else a <code>null</code> will
+ * an IllegalStateException will be thrown, else a {@code null} will
* be returned
*
* @param ioSession the MINA session
- * @param allowNull if <code>true</code>, a <code>null</code> value may be
+ * @param allowNull if <code>true</code>, a {@code null} value may be
* returned if no session is attached
- * @return the session attached to the MINA session or <code>null</code>
+ * @return the session attached to the MINA session or {@code null}
*/
public static AbstractSession getSession(IoSession ioSession, boolean allowNull) {
AbstractSession session = (AbstractSession) ioSession.getAttribute(SESSION);
@@ -842,11 +842,11 @@ public abstract class AbstractSession extends CloseableUtils.AbstractInnerClosea
/**
* Read the remote identification from this buffer.
* If more data is needed, the buffer will be reset to its original state
- * and a <code>null</code> value will be returned. Else the identification
+ * and a {@code null} value will be returned. Else the identification
* string will be returned and the data read will be consumed from the buffer.
*
* @param buffer the buffer containing the identification string
- * @return the remote identification or <code>null</code> if more data is needed
+ * @return the remote identification or {@code null} if more data is needed
*/
protected String doReadIdentification(Buffer buffer, boolean server) {
byte[] data = new byte[256];
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/session/Session.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/session/Session.java b/sshd-core/src/main/java/org/apache/sshd/common/session/Session.java
index ededad2..4548ecc 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/session/Session.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/session/Session.java
@@ -160,7 +160,7 @@ public interface Session extends Closeable {
* else it will wait forever.
*
* @param buffer the buffer containing the global request
- * @return the return buffer if the request was successful, <code>null</code> otherwise.
+ * @return the return buffer if the request was successful, {@code null} otherwise.
* @throws java.io.IOException if an error occurred when encoding sending the packet
*/
Buffer request(Buffer buffer) throws IOException;
@@ -241,7 +241,7 @@ public interface Session extends Closeable {
/**
* Check if timeout has occurred.
- * @return the timeout status, never <code>null</code>
+ * @return the timeout status, never {@code null}
*/
TimeoutStatus getTimeoutStatus();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/util/DirectoryScanner.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/util/DirectoryScanner.java b/sshd-core/src/main/java/org/apache/sshd/common/util/DirectoryScanner.java
index 4375caa..8c48e33 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/util/DirectoryScanner.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/util/DirectoryScanner.java
@@ -150,7 +150,7 @@ public class DirectoryScanner {
* <code>File.separatorChar</code>.
*
* @param basedir The base directory to scan.
- * Must not be <code>null</code>.
+ * Must not be {@code null}.
*/
public void setBasedir(String basedir) {
setBasedir(new File(basedir.replace('/', File.separatorChar).replace(
@@ -162,7 +162,7 @@ public class DirectoryScanner {
* scanned recursively.
*
* @param basedir The base directory for scanning.
- * Should not be <code>null</code>.
+ * Should not be {@code null}.
*/
public void setBasedir(File basedir) {
this.basedir = basedir;
@@ -186,10 +186,10 @@ public class DirectoryScanner {
* <p>When a pattern ends with a '/' or '\', "**" is appended.</p>
*
* @param includes A list of include patterns.
- * May be <code>null</code>, indicating that all files
- * should be included. If a non-<code>null</code>
+ * May be {@code null}, indicating that all files
+ * should be included. If a non-{@code null}
* list is given, all elements must be
- * non-<code>null</code>.
+ * non-{@code null}.
*/
public void setIncludes(String[] includes) {
if (includes == null) {
@@ -209,7 +209,7 @@ public class DirectoryScanner {
* then the files must pass muster there, as well.
*
* @throws IllegalStateException if the base directory was set
- * incorrectly (i.e. if it is <code>null</code>, doesn't exist,
+ * incorrectly (i.e. if it is {@code null}, doesn't exist,
* or isn't a directory).
*/
public String[] scan() throws IllegalStateException {
@@ -241,10 +241,10 @@ public class DirectoryScanner {
* matching of includes, excludes, and the selectors. When a directory
* is found, it is scanned recursively.
*
- * @param dir The directory to scan. Must not be <code>null</code>.
+ * @param dir The directory to scan. Must not be {@code null}.
* @param vpath The path relative to the base directory (needed to
* prevent problems with an absolute path when using
- * dir). Must not be <code>null</code>.
+ * dir). Must not be {@code null}.
*/
protected void scandir(File dir, String vpath) {
String[] newfiles = dir.list();
@@ -288,7 +288,7 @@ public class DirectoryScanner {
* Tests whether or not a name matches against at least one include
* pattern.
*
- * @param name The name to match. Must not be <code>null</code>.
+ * @param name The name to match. Must not be {@code null}.
* @return <code>true</code> when the name matches against at least one
* include pattern, or <code>false</code> otherwise.
*/
@@ -305,7 +305,7 @@ public class DirectoryScanner {
* Tests whether or not a name matches the start of at least one include
* pattern.
*
- * @param name The name to match. Must not be <code>null</code>.
+ * @param name The name to match. Must not be {@code null}.
* @return <code>true</code> when the name matches against the start of at
* least one include pattern, or <code>false</code> otherwise.
*/
@@ -321,8 +321,8 @@ public class DirectoryScanner {
/**
* Normalizes the pattern, e.g. converts forward and backward slashes to the platform-specific file separator.
*
- * @param pattern The pattern to normalize, must not be <code>null</code>.
- * @return The normalized pattern, never <code>null</code>.
+ * @param pattern The pattern to normalize, must not be {@code null}.
+ * @return The normalized pattern, never {@code null}.
*/
private String normalizePattern(String pattern) {
pattern = pattern.trim();
@@ -348,7 +348,7 @@ public class DirectoryScanner {
* <p>Replace a String with another String inside a larger String,
* for the first <code>max</code> values of the search String.</p>
*
- * <p>A <code>null</code> reference passed to this method is a no-op.</p>
+ * <p>A {@code null} reference passed to this method is a no-op.</p>
*
* @param text text to search and replace in
* @param repl String to search for
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java b/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
index a075759..0b0c19e 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/util/SelectorUtils.java
@@ -65,9 +65,9 @@ public final class SelectorUtils {
* and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param str The path to match, as a String. Must not be
- * <code>null</code>.
+ * {@code null}.
* @return whether or not a given path matches the start of a given
* pattern up to the first "**".
*/
@@ -84,9 +84,9 @@ public final class SelectorUtils {
* and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param str The path to match, as a String. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param isCaseSensitive Whether or not matching should be performed
* case sensitively.
* @return whether or not a given path matches the start of a given
@@ -162,9 +162,9 @@ public final class SelectorUtils {
* Tests whether or not a given path matches a given pattern.
*
* @param pattern The pattern to match against. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param str The path to match, as a String. Must not be
- * <code>null</code>.
+ * {@code null}.
* @return <code>true</code> if the pattern matches against the string,
* or <code>false</code> otherwise.
*/
@@ -176,9 +176,9 @@ public final class SelectorUtils {
* Tests whether or not a given path matches a given pattern.
*
* @param pattern The pattern to match against. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param str The path to match, as a String. Must not be
- * <code>null</code>.
+ * {@code null}.
* @param isCaseSensitive Whether or not matching should be performed
* case sensitively.
* @return <code>true</code> if the pattern matches against the string,
@@ -342,9 +342,9 @@ public final class SelectorUtils {
* '?' means one and only one character
*
* @param pattern The pattern to match against.
- * Must not be <code>null</code>.
+ * Must not be {@code null}.
* @param str The string which must be matched against the pattern.
- * Must not be <code>null</code>.
+ * Must not be {@code null}.
* @return <code>true</code> if the string matches against the pattern,
* or <code>false</code> otherwise.
*/
@@ -359,9 +359,9 @@ public final class SelectorUtils {
* '?' means one and only one character
*
* @param pattern The pattern to match against.
- * Must not be <code>null</code>.
+ * Must not be {@code null}.
* @param str The string which must be matched against the pattern.
- * Must not be <code>null</code>.
+ * Must not be {@code null}.
* @param isCaseSensitive Whether or not matching should be performed
* case sensitively.
* @return <code>true</code> if the string matches against the pattern,
@@ -513,7 +513,7 @@ public final class SelectorUtils {
* Breaks a path up into a Vector of path elements, tokenizing on
* <code>File.separator</code>.
*
- * @param path Path to tokenize. Must not be <code>null</code>.
+ * @param path Path to tokenize. Must not be {@code null}.
* @return a List of path elements from the tokenized path
*/
public static List<String> tokenizePath(String path) {
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/ServerFactoryManager.java b/sshd-core/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
index eef39e2..bf9b634 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
@@ -98,44 +98,44 @@ public interface ServerFactoryManager extends FactoryManager {
/**
* Retrieve the list of named factories for <code>UserAuth</code> objects.
*
- * @return a list of named <code>UserAuth</code> factories, never <code>null</code>
+ * @return a list of named <code>UserAuth</code> factories, never {@code null}
*/
List<NamedFactory<UserAuth>> getUserAuthFactories();
/**
* Retrieve the <code>PublickeyAuthenticator</code> to be used by SSH server.
* If no authenticator has been configured (i.e. this method returns
- * <code>null</code>), then client authentication requests based on keys will be
+ * {@code null}), then client authentication requests based on keys will be
* rejected.
*
- * @return the <code>PublickeyAuthenticato</code> or <code>null</code>
+ * @return the <code>PublickeyAuthenticato</code> or {@code null}
*/
PublickeyAuthenticator getPublickeyAuthenticator();
/**
* Retrieve the <code>PasswordAuthenticator</code> to be used by the SSH server.
* If no authenticator has been configured (i.e. this method returns
- * <code>null</code>), then client authentication requests based on passwords
+ * {@code null}), then client authentication requests based on passwords
* will be rejected.
*
- * @return the <code>PasswordAuthenticator</code> or <code>null</code>
+ * @return the <code>PasswordAuthenticator</code> or {@code null}
*/
PasswordAuthenticator getPasswordAuthenticator();
/**
* Retrieve the <code>GSSAuthenticator</code> to be used by the SSH server.
* If no authenticator has been configured (i.e. this method returns
- * <code>null</code>), then client authentication requests based on gssapi
+ * {@code null}), then client authentication requests based on gssapi
* will be rejected.
*
- * @return the <code>GSSAuthenticator</code> or <code>null</code>
+ * @return the <code>GSSAuthenticator</code> or {@code null}
*/
GSSAuthenticator getGSSAuthenticator();
/**
* Retrieve the <code>ShellFactory</code> object to be used to create shells.
*
- * @return a valid <code>ShellFactory</code> object or <code>null</code> if shells
+ * @return a valid <code>ShellFactory</code> object or {@code null} if shells
* are not supported on this server
*/
Factory<Command> getShellFactory();
@@ -143,7 +143,7 @@ public interface ServerFactoryManager extends FactoryManager {
/**
* Retrieve the <code>CommandFactory</code> to be used to process commands requests.
*
- * @return a valid <code>CommandFactory</code> object or <code>null</code> if commands
+ * @return a valid <code>CommandFactory</code> object or {@code null} if commands
* are not supported on this server
*/
CommandFactory getCommandFactory();
@@ -153,7 +153,7 @@ public interface ServerFactoryManager extends FactoryManager {
* be used to create subsystems.
*
* @return a list of named <code>CommandFactory.Command</code> factories
- * or <code>null</code> if subsystems are not supported on this server
+ * or {@code null} if subsystems are not supported on this server
*/
List<NamedFactory<Command>> getSubsystemFactories();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/auth/UserAuth.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/auth/UserAuth.java b/sshd-core/src/main/java/org/apache/sshd/server/auth/UserAuth.java
index 1eeec16..73176cf 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/auth/UserAuth.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/auth/UserAuth.java
@@ -39,7 +39,7 @@ public interface UserAuth {
* @param username the user trying to log in
* @param buffer the request buffer containing parameters specific to this request
* @return <code>true</code> if the authentication succeeded, <code>false</code> if the authentication
- * failed and <code>null</code> if not finished yet
+ * failed and {@code null} if not finished yet
* @throws Exception if the authentication fails
*/
Boolean auth(ServerSession session, String username, String service, Buffer buffer) throws Exception;
@@ -49,7 +49,7 @@ public interface UserAuth {
*
* @param buffer the request buffer containing parameters specific to this request
* @return <code>true</code> if the authentication succeeded, <code>false</code> if the authentication
- * failed and <code>null</code> if not finished yet
+ * failed and {@code null} if not finished yet
* @throws Exception if the authentication fails
*/
Boolean next(Buffer buffer) throws Exception;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java b/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java
index 3a0d4d7..da1f6f6 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java
@@ -85,7 +85,7 @@ public class CredentialHelper {
* Get the configuration entries for a name.
*
* @param name The name
- * @return The entries, or <code>null</code> if the name is not known
+ * @return The entries, or {@code null} if the name is not known
*/
@Override
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/GSSAuthenticator.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/GSSAuthenticator.java b/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/GSSAuthenticator.java
index 96ef66b..015483e 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/GSSAuthenticator.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/auth/gss/GSSAuthenticator.java
@@ -62,7 +62,7 @@ public class GSSAuthenticator {
* implementation uses a Kerberos key table.
*
* @param mgr The GSS manager
- * @return The credential; if the result is <code>null</code> gssapi authentication fails immediately
+ * @return The credential; if the result is {@code null} gssapi authentication fails immediately
* @throws UnknownHostException If the local host name could not be determined
* @throws LoginException If the subject could not be found
* @throws GSSException If the credential could not be obtained
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/config/keys/AuthorizedKeyEntry.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/config/keys/AuthorizedKeyEntry.java b/sshd-core/src/main/java/org/apache/sshd/server/config/keys/AuthorizedKeyEntry.java
index b5e37e0..54b5a45 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/config/keys/AuthorizedKeyEntry.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/config/keys/AuthorizedKeyEntry.java
@@ -296,8 +296,8 @@ public class AuthorizedKeyEntry extends PublicKeyEntry {
/**
* @param line Original line from an <code>authorized_keys</code> file
- * @return {@link AuthorizedKeyEntry} or <code>null</code> if the line is
- * <code>null</code>/empty or a comment line
+ * @return {@link AuthorizedKeyEntry} or {@code null} if the line is
+ * {@code null}/empty or a comment line
* @throws IllegalArgumentException If failed to parse/decode the line
* @see #COMMENT_CHAR
*/
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java b/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
index 521caaa..6866e0b 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/session/ServerUserAuthService.java
@@ -97,7 +97,8 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
// Verify all required methods are supported
for (List<String> l : authMethods) {
for (String m : l) {
- if (NamedFactory.Utils.get(userAuthFactories, m) == null) {
+ NamedFactory<UserAuth> factory = NamedResource.Utils.findByName(m, String.CASE_INSENSITIVE_ORDER, userAuthFactories);
+ if (factory == null) {
throw new SshException("Configured method is not supported: " + m);
}
}
@@ -151,7 +152,8 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
if (log.isDebugEnabled()) {
log.debug("Authenticating user '{}' with service '{}' and method '{}'", username, service, method);
}
- NamedFactory<UserAuth> factory = NamedFactory.Utils.get(userAuthFactories, method);
+
+ NamedFactory<UserAuth> factory = NamedResource.Utils.findByName(method, String.CASE_INSENSITIVE_ORDER, userAuthFactories);
if (factory != null) {
currentAuth = factory.create();
try {
@@ -164,7 +166,7 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
} else {
if (this.currentAuth == null) {
// This should not happen
- throw new IllegalStateException();
+ throw new IllegalStateException("No current authentication mechanism for cmd=" + (cmd & 0xFF));
}
if (log.isDebugEnabled()) {
log.debug("Received authentication message {}", Integer.valueOf(cmd & 0xFF));
@@ -174,7 +176,7 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
authed = currentAuth.next(buffer);
} catch (Exception e) {
// Continue
- log.debug("Authentication failed: {}", e.getMessage());
+ log.debug("Failed ({}) to authenticate: {}", e.getClass().getSimpleName(), e.getMessage());
}
}
@@ -187,7 +189,7 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
boolean success = false;
for (List<String> l : authMethods) {
- if (!l.isEmpty() && l.get(0).equals(authMethod)) {
+ if ((GenericUtils.size(l) > 0) && l.get(0).equals(authMethod)) {
l.remove(0);
success |= l.isEmpty();
}
@@ -225,7 +227,7 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_FAILURE);
StringBuilder sb = new StringBuilder();
for (List<String> l : authMethods) {
- if (!l.isEmpty()) {
+ if (GenericUtils.size(l) > 0) {
if (sb.length() > 0) {
sb.append(",");
}
@@ -245,7 +247,7 @@ public class ServerUserAuthService extends CloseableUtils.AbstractCloseable impl
buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_FAILURE);
StringBuilder sb = new StringBuilder();
for (List<String> l : authMethods) {
- if (!l.isEmpty()) {
+ if (GenericUtils.size(l) > 0) {
String m = l.get(0);
if (!"none".equals(m)) {
if (sb.length() > 0) {
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java b/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
index dc733e8..b861b7c 100644
--- a/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/AuthenticationTest.java
@@ -58,6 +58,10 @@ public class AuthenticationTest extends BaseTestSupport {
private SshServer sshd;
private int port;
+ public AuthenticationTest() {
+ super();
+ }
+
@Before
public void setUp() throws Exception {
sshd = SshServer.setUpDefaultServer();
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java b/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
index 2940f37..0e5abc9 100644
--- a/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
@@ -29,8 +29,8 @@ import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.FactoryManagerUtils;
import org.apache.sshd.server.Command;
-import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.PublickeyAuthenticator.AcceptAllPublickeyAuthenticator;
+import org.apache.sshd.server.SshServer;
import org.apache.sshd.util.BaseTestSupport;
import org.apache.sshd.util.BogusPasswordAuthenticator;
import org.apache.sshd.util.EchoShellFactory;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/WindowTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/WindowTest.java b/sshd-core/src/test/java/org/apache/sshd/WindowTest.java
index c46e1cc..a4233d9 100644
--- a/sshd-core/src/test/java/org/apache/sshd/WindowTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/WindowTest.java
@@ -47,8 +47,8 @@ import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.CommandFactory;
-import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.PublickeyAuthenticator.AcceptAllPublickeyAuthenticator;
+import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.channel.ChannelSession;
import org.apache.sshd.server.command.UnknownCommand;
import org.apache.sshd.server.forward.TcpipServerChannel;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/agent/AgentTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/agent/AgentTest.java b/sshd-core/src/test/java/org/apache/sshd/agent/AgentTest.java
index 78b3911..74610a7 100644
--- a/sshd-core/src/test/java/org/apache/sshd/agent/AgentTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/agent/AgentTest.java
@@ -28,7 +28,6 @@ import java.security.PublicKey;
import java.util.List;
import java.util.concurrent.TimeUnit;
-import org.apache.sshd.agent.SshAgent;
import org.apache.sshd.agent.local.LocalAgentFactory;
import org.apache.sshd.agent.local.ProxyAgentFactory;
import org.apache.sshd.agent.unix.AgentClient;
@@ -41,8 +40,8 @@ import org.apache.sshd.common.util.Pair;
import org.apache.sshd.common.util.SecurityUtils;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.Environment;
-import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.PublickeyAuthenticator.AcceptAllPublickeyAuthenticator;
+import org.apache.sshd.server.SshServer;
import org.apache.sshd.server.forward.ForwardingFilter;
import org.apache.sshd.util.BaseTestSupport;
import org.apache.sshd.util.BogusPasswordAuthenticator;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/common/SshBuilderTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/SshBuilderTest.java b/sshd-core/src/test/java/org/apache/sshd/common/SshBuilderTest.java
index f801f44..ba73f02 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/SshBuilderTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/SshBuilderTest.java
@@ -24,9 +24,6 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Set;
-import org.apache.sshd.common.BaseBuilder;
-import org.apache.sshd.common.NamedFactory;
-import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.cipher.BuiltinCiphers;
import org.apache.sshd.common.cipher.Cipher;
import org.apache.sshd.common.kex.BuiltinDHFactories;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/deprecated/UserAuthPublicKey.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/deprecated/UserAuthPublicKey.java b/sshd-core/src/test/java/org/apache/sshd/deprecated/UserAuthPublicKey.java
index 1a3fb72..7a8408c 100644
--- a/sshd-core/src/test/java/org/apache/sshd/deprecated/UserAuthPublicKey.java
+++ b/sshd-core/src/test/java/org/apache/sshd/deprecated/UserAuthPublicKey.java
@@ -106,5 +106,4 @@ public class UserAuthPublicKey extends AbstractUserAuth {
}
}
}
-
}
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/server/ServerMain.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/server/ServerMain.java b/sshd-core/src/test/java/org/apache/sshd/server/ServerMain.java
index 6c9fb10..78dcc94 100644
--- a/sshd-core/src/test/java/org/apache/sshd/server/ServerMain.java
+++ b/sshd-core/src/test/java/org/apache/sshd/server/ServerMain.java
@@ -19,9 +19,6 @@
package org.apache.sshd.server;
-import org.apache.sshd.server.SshServer;
-
-
/**
* An activator for the {@link SshServer#main(String[])} - the reason it is
* here is because the logging configuration is available only for test scope
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/server/ServerTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/server/ServerTest.java b/sshd-core/src/test/java/org/apache/sshd/server/ServerTest.java
index 115f700..4f63439 100644
--- a/sshd-core/src/test/java/org/apache/sshd/server/ServerTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/server/ServerTest.java
@@ -53,7 +53,6 @@ import org.apache.sshd.common.session.AbstractSession;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.common.session.SessionListener;
import org.apache.sshd.deprecated.ClientUserAuthServiceOld;
-import org.apache.sshd.deprecated.UserAuthPassword;
import org.apache.sshd.server.command.ScpCommandFactory;
import org.apache.sshd.server.sftp.SftpSubsystemFactory;
import org.apache.sshd.util.BaseTestSupport;
@@ -123,7 +122,7 @@ public class ServerTest extends BaseTestSupport {
while ((res & ClientSession.CLOSED) == 0) {
nbTrials ++;
s.getService(ClientUserAuthServiceOld.class)
- .auth(new UserAuthPassword(s, "ssh-connection", "buggy"))
+ .auth(new org.apache.sshd.deprecated.UserAuthPassword(s, "ssh-connection", "buggy"))
;
res = s.waitFor(ClientSession.CLOSED | ClientSession.WAIT_AUTH, 5000);
if (res == ClientSession.TIMEOUT) {
@@ -154,7 +153,7 @@ public class ServerTest extends BaseTestSupport {
nbTrials++;
assertTrue(nbTrials < 100);
authFuture = s.getService(ClientUserAuthServiceOld.class)
- .auth(new UserAuthPassword(s, "ssh-connection", "buggy"))
+ .auth(new org.apache.sshd.deprecated.UserAuthPassword(s, "ssh-connection", "buggy"))
;
assertTrue("Authentication wait failed", authFuture.await(5000));
assertTrue("Authentication not done", authFuture.isDone());
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/server/SshServerMain.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/server/SshServerMain.java b/sshd-core/src/test/java/org/apache/sshd/server/SshServerMain.java
index 5422c51..c5d9f0e 100644
--- a/sshd-core/src/test/java/org/apache/sshd/server/SshServerMain.java
+++ b/sshd-core/src/test/java/org/apache/sshd/server/SshServerMain.java
@@ -19,8 +19,6 @@
package org.apache.sshd.server;
-import org.apache.sshd.server.SshServer;
-
/**
* Just a test class used to invoke {@link SshServer#main(String[])} in
* order to have logging - which is in {@code test} scope
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/server/SshServerTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/server/SshServerTest.java b/sshd-core/src/test/java/org/apache/sshd/server/SshServerTest.java
index 5c8e08e..8b56414 100644
--- a/sshd-core/src/test/java/org/apache/sshd/server/SshServerTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/server/SshServerTest.java
@@ -21,7 +21,6 @@ package org.apache.sshd.server;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
-import org.apache.sshd.server.SshServer;
import org.apache.sshd.util.BaseTestSupport;
import org.apache.sshd.util.BogusPasswordAuthenticator;
import org.apache.sshd.util.EchoShellFactory;
http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/6a4d5ffe/sshd-core/src/test/java/org/apache/sshd/util/Utils.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/util/Utils.java b/sshd-core/src/test/java/org/apache/sshd/util/Utils.java
index 99cd121..c37b147 100644
--- a/sshd-core/src/test/java/org/apache/sshd/util/Utils.java
+++ b/sshd-core/src/test/java/org/apache/sshd/util/Utils.java
@@ -229,7 +229,7 @@ public class Utils {
* @param anchor An anchor {@link Class} whose container we want to use
* as the starting point for the "target" folder lookup up the
* hierarchy
- * @return The "target" <U>folder</U> - <code>null</code> if not found
+ * @return The "target" <U>folder</U> - {@code null} if not found
* @see #detectTargetFolder(File)
*/
public static final File detectTargetFolder(Class<?> anchor) {
@@ -240,7 +240,7 @@ public class Utils {
* @param clazz A {@link Class} object
* @return A {@link File} of the location of the class bytes container
* - e.g., the root folder, the containing JAR, etc.. Returns
- * <code>null</code> if location could not be resolved
+ * {@code null} if location could not be resolved
* @throws IllegalArgumentException If location is not a valid
* {@link File} location
* @see #getClassContainerLocationURI(Class)
@@ -260,7 +260,7 @@ public class Utils {
* @param clazz A {@link Class} object
* @return A {@link URI} to the location of the class bytes container
* - e.g., the root folder, the containing JAR, etc.. Returns
- * <code>null</code> if location could not be resolved
+ * {@code null} if location could not be resolved
* @throws URISyntaxException if location is not a valid URI
* @see #getClassContainerLocationURL(Class)
*/
@@ -273,7 +273,7 @@ public class Utils {
* @param clazz A {@link Class} object
* @return A {@link URL} to the location of the class bytes container
* - e.g., the root folder, the containing JAR, etc.. Returns
- * <code>null</code> if location could not be resolved
+ * {@code null} if location could not be resolved
*/
public static final URL getClassContainerLocationURL(Class<?> clazz) {
ProtectionDomain pd=clazz.getProtectionDomain();
@@ -305,7 +305,7 @@ public class Utils {
* Converts a {@link URL} that may refer to an internal resource to
* a {@link File} representing is "source" container (e.g.,
* if it is a resource in a JAR, then the result is the JAR's path)
- * @param url The {@link URL} - ignored if <code>null</code>
+ * @param url The {@link URL} - ignored if {@code null}
* @return The matching {@link File}
* @throws MalformedURLException If source URL does not refer to a
* file location
@@ -338,7 +338,7 @@ public class Utils {
* Converts a {@link URI} that may refer to an internal resource to
* a {@link File} representing is "source" container (e.g.,
* if it is a resource in a JAR, then the result is the JAR's path)
- * @param uri The {@link URI} - ignored if <code>null</code>
+ * @param uri The {@link URI} - ignored if {@code null}
* @return The matching {@link File}
* @throws MalformedURLException If source URI does not refer to a
* file location
@@ -364,7 +364,7 @@ public class Utils {
}
/**
- * @param uri The {@link URI} value - ignored if <code>null</code>
+ * @param uri The {@link URI} value - ignored if {@code null}
* @return The URI(s) source path where {@link #JAR_URL_PREFIX} and
* any sub-resource are stripped
* @see #getURLSource(String)
@@ -374,7 +374,7 @@ public class Utils {
}
/**
- * @param url The {@link URL} value - ignored if <code>null</code>
+ * @param url The {@link URL} value - ignored if {@code null}
* @return The URL(s) source path where {@link #JAR_URL_PREFIX} and
* any sub-resource are stripped
* @see #getURLSource(String)
@@ -391,7 +391,7 @@ public class Utils {
/**
* @param externalForm The {@link URL#toExternalForm()} string - ignored if
- * <code>null</code>/empty
+ * {@code null}/empty
* @return The URL(s) source path where {@link #JAR_URL_PREFIX} and
* any sub-resource are stripped
*/
@@ -472,7 +472,7 @@ public class Utils {
/**
* @param clazz The request {@link Class}
* @return A {@link URL} to the location of the <code>.class</code> file
- * - <code>null</code> if location could not be resolved
+ * - {@code null} if location could not be resolved
*/
public static final URL getClassBytesURL(Class<?> clazz) {
String className=clazz.getName();
@@ -517,7 +517,7 @@ public class Utils {
* @param anchorFile An anchor {@link File} we want to use
* as the starting point for the "target" or "build" folder
* lookup up the hierarchy
- * @return The "target" <U>folder</U> - <code>null</code> if not found
+ * @return The "target" <U>folder</U> - {@code null} if not found
*/
public static final File detectTargetFolder (File anchorFile) {
for (File file=anchorFile; file != null; file=file.getParentFile()) {