]> source.dussan.org Git - jgit.git/commitdiff
Add toString() methods to OpenSshConfig to help debugging 26/103726/2
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 25 Aug 2017 22:48:59 +0000 (00:48 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 25 Aug 2017 23:44:37 +0000 (01:44 +0200)
Change-Id: I81b60a13a97e78d5ccd593ba8e4aa614df19f925
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java

index 2c547afea68fa048fc53ce0e6702acfbeab4fab9..b5b532dffdfe3cd4cda8843834865861c989e967 100644 (file)
@@ -173,6 +173,12 @@ public class OpenSshConfig implements ConfigRepository {
        private static class State {
                Map<String, HostEntry> entries = new LinkedHashMap<>();
                Map<String, Host> hosts = new HashMap<>();
+
+               @Override
+               @SuppressWarnings("nls")
+               public String toString() {
+                       return "State [entries=" + entries + ", hosts=" + hosts + "]";
+               }
        }
 
        /** State read from the config file, plus {@link Host}s created from it. */
@@ -750,6 +756,13 @@ public class OpenSshConfig implements ConfigRepository {
                        // anyway. ControlPath, LocalCommand, ProxyCommand, and
                        // RemoteCommand are not used by Jsch.
                }
+
+               @Override
+               @SuppressWarnings("nls")
+               public String toString() {
+                       return "HostEntry [options=" + options + ", multiOptions="
+                                       + multiOptions + ", listOptions=" + listOptions + "]";
+               }
        }
 
        /**
@@ -910,6 +923,17 @@ public class OpenSshConfig implements ConfigRepository {
                Config getConfig() {
                        return config;
                }
+
+               @Override
+               @SuppressWarnings("nls")
+               public String toString() {
+                       return "Host [hostName=" + hostName + ", port=" + port
+                                       + ", identityFile=" + identityFile + ", user=" + user
+                                       + ", preferredAuthentications=" + preferredAuthentications
+                                       + ", batchMode=" + batchMode + ", strictHostKeyChecking="
+                                       + strictHostKeyChecking + ", connectionAttempts="
+                                       + connectionAttempts + ", config=" + config + "]";
+               }
        }
 
        /**
@@ -926,4 +950,11 @@ public class OpenSshConfig implements ConfigRepository {
                Host host = lookup(hostName);
                return host.getConfig();
        }
+
+       @Override
+       @SuppressWarnings("nls")
+       public String toString() {
+               return "OpenSshConfig [home=" + home + ", configFile=" + configFile
+                               + ", lastModified=" + lastModified + ", state=" + state + "]";
+       }
 }