-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#752: Add getKeys to JSch which makes access to all the config values… #753
Conversation
…values possible for troubleshooting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a new method like this would be more valuable, since it would provide users the entire config and not just the config keys:
public static Map<String, String> getConfig() {
Map<String, String> ret = new HashMap<>();
synchronized (config) {
for (Map.Entry<String, String> entry : config.entrySet()) {
String key = entry.getKey();
if (key.equals("PubkeyAcceptedKeyTypes")) {
key = "PubkeyAcceptedAlgorithms";
}
ret.put(key, entry.getValue());
}
}
return Collections.unmodifiableMap(ret);
}
…fig values possible for troubleshooting.
Thanks I have updated the PR |
@@ -64,6 +68,26 @@ void checkLoggerBehavior() throws Exception { | |||
assertSame(JSch.DEVNULL, jsch.getInstanceLogger(), "instance logger should be DEVNULL"); | |||
} | |||
|
|||
@Test | |||
void getConfigKeys() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this test method, since it is now testing a method named getConfig()
and not getConfigKeys()
?
…fig values possible for troubleshooting.
import java.util.Hashtable; | ||
import java.util.Map; | ||
import java.util.Set; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this unused java.util.Set
import that SonarQube is pointing out?
@@ -64,6 +67,26 @@ void checkLoggerBehavior() throws Exception { | |||
assertSame(JSch.DEVNULL, jsch.getInstanceLogger(), "instance logger should be DEVNULL"); | |||
} | |||
|
|||
@Test | |||
void getConfig() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube points out that no method in this test case throws a checked Exception, so can we drop the throws Exception
clause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the other tests does the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll put on my TODO list to clean that up.
…fig values possible for troubleshooting.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you squash all the changesets together on this branch into one atomic changeset?
@norrisjeremy I will squash it when merging |
I think you can make GH have a button "squash and merge" that is what we do at Apache Camel |
created a new PR this can be closed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Ok, that works too. Your choice whether to squash and merge this one or use the new #754. |
i suggest you try the "squash and merge" button |
… possible for troubleshooting.