diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-12-08 14:11:43 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2015-12-08 14:12:26 +0100 |
commit | afd167a1f26d140b7023972ddf85d12f3c9f9d8d (patch) | |
tree | 37f07a5ed51cc655fb7706af6aee7fd9e3bce9eb /org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java | |
parent | 5786cc3c0fb1afdd9942e9a353c6fc755a6b41d7 (diff) | |
download | jgit-afd167a1f26d140b7023972ddf85d12f3c9f9d8d.tar.gz jgit-afd167a1f26d140b7023972ddf85d12f3c9f9d8d.zip |
NetRCCredentialsProvider should return false if any item is missing
Change-Id: I894d1621aaccd71dfe100fe83a1bd9d50a1e0808
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ -81,6 +81,20 @@ public abstract class CredentialsProvider { } /** + * @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. * * An interactive provider may try to open a dialog box, or prompt for input |