From afd167a1f26d140b7023972ddf85d12f3c9f9d8d Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 8 Dec 2015 14:11:43 +0100 Subject: NetRCCredentialsProvider should return false if any item is missing Change-Id: I894d1621aaccd71dfe100fe83a1bd9d50a1e0808 --- .../org/eclipse/jgit/transport/CredentialsProvider.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java index 464d0f9ee5..4800f6826f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java @@ -80,6 +80,20 @@ public abstract class CredentialsProvider { defaultProvider = p; } + /** + * @param items + * credential items to check + * @return {@code true} if any of the passed items is null, {@code false} + * otherwise + * @since 4.2 + */ + protected static boolean isAnyNull(CredentialItem... items) { + for (CredentialItem i : items) + if (i == null) + return true; + return false; + } + /** * Check if the provider is interactive with the end-user. * -- cgit v1.2.3