diff options
author | Carsten Hammer <carsten.hammer@t-online.de> | 2019-04-06 20:42:38 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-04-14 00:19:51 +0200 |
commit | 0b320b2c357a02d1f7306cb572e09917a4ec59d9 (patch) | |
tree | e70d0265c538e9f284023d7fe177d0ddca5c67b8 /org.eclipse.jgit.ssh.apache | |
parent | 39b0b51b1253f569888db3578b01708a14360b69 (diff) | |
download | jgit-0b320b2c357a02d1f7306cb572e09917a4ec59d9.tar.gz jgit-0b320b2c357a02d1f7306cb572e09917a4ec59d9.zip |
Use Arrays.asList instead of copying array in a for loop
Change-Id: Ie44950f7d2f2f94a0412efb6c274f6e1e31efcd6
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.ssh.apache')
-rw-r--r-- | org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyVerifier.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyVerifier.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyVerifier.java index 7d8f3fd39c..4246fbe3bc 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyVerifier.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyVerifier.java @@ -60,6 +60,7 @@ import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.security.PublicKey; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.LinkedList; @@ -586,9 +587,7 @@ public class OpenSshServerKeyVerifier KeyUtils.getFingerPrint(BuiltinDigests.sha256, expected), KeyUtils.getFingerPrint(BuiltinDigests.md5, actual), KeyUtils.getFingerPrint(BuiltinDigests.sha256, actual)); - for (String line : warning.split("\n")) { //$NON-NLS-1$ - messages.add(line); - } + messages.addAll(Arrays.asList(warning.split("\n"))); //$NON-NLS-1$ CredentialsProvider provider = getCredentialsProvider( clientSession); |