[ 
https://issues.apache.org/jira/browse/SSHD-1164?focusedWorklogId=603853&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-603853
 ]

ASF GitHub Bot logged work on SSHD-1164:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/21 19:20
            Start Date: 29/May/21 19:20
    Worklog Time Spent: 10m 
      Work Description: tomaswolf commented on a change in pull request #196:
URL: https://github.com/apache/mina-sshd/pull/196#discussion_r641974333



##########
File path: 
sshd-common/src/main/java/org/apache/sshd/common/util/GenericUtils.java
##########
@@ -196,6 +196,49 @@ public static boolean isNotEmpty(CharSequence cs) {
         return !isEmpty(cs);
     }
 
+    /**
+     * <p>
+     * Checks if a CharSequence is empty (""), null or whitespace only.
+     * </p>
+     *
+     * <p>
+     * Whitespace is defined by {@link Character#isWhitespace(char)}.
+     * </p>
+     *
+     * <pre>
+     * StringUtils.isBlank(null)      = true
+     * StringUtils.isBlank("")        = true
+     * StringUtils.isBlank(" ")       = true
+     * StringUtils.isBlank("bob")     = false
+     * StringUtils.isBlank("  bob  ") = false
+     * </pre>
+     *
+     * @param  cs the CharSequence to check, may be null
+     * @return    {@code true} if the CharSequence is null, empty or 
whitespace only
+     * @since     2.0
+     * @since     3.0 Changed signature from isBlank(String) to 
isBlank(CharSequence)

Review comment:
       So this was copied from somewhere. Looks like StringUtils from 
org.apache.commons.lang, so license-wise OK.
   
   I'll remove the misleading "since" tags and fix the comment.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 603853)
    Time Spent: 1h 40m  (was: 1.5h)

> Parsing of ~/.ssh/config Host patterns fails with extra whitespace
> ------------------------------------------------------------------
>
>                 Key: SSHD-1164
>                 URL: https://issues.apache.org/jira/browse/SSHD-1164
>             Project: MINA SSHD
>          Issue Type: New Feature
>            Reporter: Alex Sherwin
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Parsing of ~/.ssh/config Host patterns fails with extra whitespace between 
> entries
>  
> For example (note two spaces between {{host2}} and {{host3}})
> {code}
> Host host1 host2  host3
> {code}
> Will result in an exception
> {code}
> java.io.IOException: java.lang.IllegalArgumentException: No pattern for 
> java.io.IOException: java.lang.IllegalArgumentException: No pattern for 
>  at 
> org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver.resolveEffectiveHost(ConfigFileHostEntryResolver.java:72)
>  at org.apache.sshd.client.SshClient.resolveHost(SshClient.java:661) at 
> org.apache.sshd.client.SshClient.connect(SshClient.java:539) at 
> org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:74)
>  at 
> org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:57)
>  at 
> org.apache.sshd.client.opensshcerts.ClientOpenSSHCertificatesTest.clientCertAuth(ClientOpenSSHCertificatesTest.java:168)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498) at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
>  at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>  at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
>  at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>  at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at 
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
>  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
>  at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
>  at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at 
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at 
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at 
> org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at 
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at 
> org.junit.runners.ParentRunner.run(ParentRunner.java:413) at 
> org.junit.runners.Suite.runChild(Suite.java:128) at 
> org.junit.runners.Suite.runChild(Suite.java:27) at 
> org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at 
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at 
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at 
> org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at 
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) 
> at 
> org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:30)
>  at org.junit.rules.RunRules.evaluate(RunRules.java:20) at 
> org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at 
> org.junit.runners.ParentRunner.run(ParentRunner.java:413) at 
> org.junit.runner.JUnitCore.run(JUnitCore.java:137) at 
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
>  at 
> com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
>  at 
> com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
>  at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)Caused by: 
> java.lang.IllegalArgumentException: No pattern for  at 
> org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213)
>  at 
> org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179)
>  at 
> org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:168) 
> at 
> org.apache.sshd.common.util.ValidateUtils.checkNotNull(ValidateUtils.java:40) 
> at 
> org.apache.sshd.client.config.hosts.HostPatternsHolder.parsePatterns(HostPatternsHolder.java:246)
>  at 
> org.apache.sshd.client.config.hosts.HostConfigEntry.setHost(HostConfigEntry.java:156)
>  at 
> org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:920)
>  at 
> org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:850)
>  at 
> org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:844)
>  at 
> org.apache.sshd.client.config.hosts.HostConfigEntry.readHostConfigEntries(HostConfigEntry.java:831)
>  at 
> org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver.reloadHostConfigEntries(ConfigFileHostEntryResolver.java:100)
>  at 
> org.apache.sshd.client.config.hosts.DefaultConfigFileHostEntryResolver.reloadHostConfigEntries(DefaultConfigFileHostEntryResolver.java:84)
>  at 
> org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver.resolveEffectiveResolver(ConfigFileHostEntryResolver.java:84)
>  at 
> org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver.resolveEffectiveHost(ConfigFileHostEntryResolver.java:59)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to