diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java index ad04d424d..e6d204242 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshSessionFactory.java @@ -63,10 +63,11 @@ public abstract class SshSessionFactory { * default factory will be restored.s */ public static void setInstance(SshSessionFactory newFactory) { - if (newFactory != null) + if (newFactory != null) { INSTANCE = newFactory; - else - INSTANCE = new DefaultSshSessionFactory(); + } else { + INSTANCE = loadSshSessionFactory(); + } } /**