You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2013/12/03 14:27:58 UTC

[1/2] git commit: [SSHD-265] Fix tests on Windows

Updated Branches:
  refs/heads/master d78cbf0fa -> 9a27e7284


[SSHD-265] Fix tests on Windows

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/cfc90d8a
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/cfc90d8a
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/cfc90d8a

Branch: refs/heads/master
Commit: cfc90d8a93845f250389718ddf86f6a1c59e8a25
Parents: d78cbf0
Author: Guillaume Nodet <gn...@apache.org>
Authored: Mon Dec 2 22:30:36 2013 +0100
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Mon Dec 2 22:30:36 2013 +0100

----------------------------------------------------------------------
 .../sshd/common/file/virtualfs/VirtualFileSystemTest.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/cfc90d8a/sshd-core/src/test/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemTest.java b/sshd-core/src/test/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemTest.java
index 90fb952..222fce0 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemTest.java
@@ -44,11 +44,11 @@ public class VirtualFileSystemTest {
 
         SshFile file = view.getFile("foo");
         String physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
-        assertEquals(homeDir + "/foo", physicalName);
+        assertEquals(homeDir + File.separator + "foo", physicalName);
 
         file = view.getFile(view.getFile("foo"), "../bar");
         physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
-        assertEquals(homeDir + "/bar", physicalName);
+        assertEquals(homeDir + File.separator + "bar", physicalName);
 
         file = view.getFile("../bar");
         physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
@@ -64,15 +64,15 @@ public class VirtualFileSystemTest {
 
         SshFile file = view.getFile("foo");
         String physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
-        assertEquals(homeDir + "/foo", physicalName);
+        assertEquals(homeDir + File.separator + "foo", physicalName);
 
         file = view.getFile(view.getFile("foo"), "../bar");
         physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
-        assertEquals(homeDir + "/bar", physicalName);
+        assertEquals(homeDir + File.separator + "bar", physicalName);
 
         file = view.getFile("../bar");
         physicalName = ((NativeSshFile) file).getNativeFile().getAbsolutePath();
-        assertEquals(homeDir + "/bar", physicalName);
+        assertEquals(homeDir + File.separator + "bar", physicalName);
     }
 
     static class TestSession extends AbstractSession {


[2/2] git commit: [SSHD-249] Data race in AbstractSession.close() may lead to NPE and blocks during shutdown

Posted by gn...@apache.org.
[SSHD-249] Data race in AbstractSession.close() may lead to NPE and blocks during shutdown

Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/9a27e728
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/9a27e728
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/9a27e728

Branch: refs/heads/master
Commit: 9a27e728436965c388be95211297853d2dd07f37
Parents: cfc90d8
Author: Guillaume Nodet <gn...@apache.org>
Authored: Tue Dec 3 14:27:35 2013 +0100
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Tue Dec 3 14:27:35 2013 +0100

----------------------------------------------------------------------
 .../java/org/apache/sshd/common/session/AbstractSession.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/9a27e728/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 e855689..f5e9cdf 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
@@ -328,9 +328,9 @@ public abstract class AbstractSession implements Session {
                 try {
                     closing = true;
                     log.debug("Closing session");
-                    Channel[] channelToClose = channels.values().toArray(new Channel[channels.values().size()]);
-                    if (channelToClose.length > 0) {
-                        final AtomicInteger latch = new AtomicInteger(channelToClose.length);
+                    List<Channel> channelToClose = new ArrayList<Channel>(channels.values());
+                    if (channelToClose.size() > 0) {
+                        final AtomicInteger latch = new AtomicInteger(channelToClose.size());
                         for (Channel channel : channelToClose) {
                             log.debug("Closing channel {}", channel.getId());
                             channel.close(immediately).addListener(new SshFutureListener() {