From 6d8306968e4a7f6a46e505e999cf0ba7a3451a4e Mon Sep 17 00:00:00 2001 From: Urs Wolfer Date: Sun, 13 Jun 2021 22:02:04 +0200 Subject: [PATCH] Port away from deprecated GitHttpAuthDataProvider API --- .../extension/GerritHttpAuthDataProvider.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/urswolfer/intellij/plugin/gerrit/extension/GerritHttpAuthDataProvider.java b/src/main/java/com/urswolfer/intellij/plugin/gerrit/extension/GerritHttpAuthDataProvider.java index 2e21f074..c05c92a9 100644 --- a/src/main/java/com/urswolfer/intellij/plugin/gerrit/extension/GerritHttpAuthDataProvider.java +++ b/src/main/java/com/urswolfer/intellij/plugin/gerrit/extension/GerritHttpAuthDataProvider.java @@ -18,6 +18,7 @@ package com.urswolfer.intellij.plugin.gerrit.extension; import com.google.inject.Inject; +import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.AuthData; import com.urswolfer.intellij.plugin.gerrit.GerritModule; @@ -37,9 +38,8 @@ public class GerritHttpAuthDataProvider implements GitHttpAuthDataProvider { @Inject private GerritSettings gerritSettings; - @Nullable @Override - public AuthData getAuthData(@NotNull String url) { + public @Nullable AuthData getAuthData(@NotNull Project project, @NotNull String url) { if (!gerritSettings.getHost().equalsIgnoreCase(url)) { return null; } @@ -51,7 +51,7 @@ public AuthData getAuthData(@NotNull String url) { } @Override - public void forgetPassword(@NotNull String url) { + public void forgetPassword(@NotNull Project project, @NotNull String url, @NotNull AuthData authData) { if (gerritSettings.getHost().equalsIgnoreCase(url)) { gerritSettings.forgetPassword(); } @@ -66,13 +66,18 @@ public Proxy() { @Nullable @Override - public AuthData getAuthData(@NotNull String url) { - return delegate.getAuthData(url); + public AuthData getAuthData(@NotNull Project project, @NotNull String url) { + return delegate.getAuthData(project, url); } @Override - public void forgetPassword(@NotNull String url) { - delegate.forgetPassword(url); + public @Nullable AuthData getAuthData(@NotNull Project project, @NotNull String url, @NotNull String login) { + return delegate.getAuthData(project, url, login); + } + + @Override + public void forgetPassword(@NotNull Project project, @NotNull String url, @NotNull AuthData authData) { + delegate.forgetPassword(project, url, authData); } } }