mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[tasks] Access fields through their getters in implementations of TaskRepository.isConfigured()
Otherwise, if the corresponding field is loaded lazily, it might not be initialized by the moment of the check. GitOrigin-RevId: b4954609a7fc49344b306cd107469cc7ab6eea66
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f9f3be565f
commit
81f4abc438
@@ -78,6 +78,13 @@ public abstract class TaskRepository {
|
||||
myUrl = trimTrailingSlashes(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this repository is ready to be used for retrieving issues in "Open Task...".
|
||||
* <p>
|
||||
* Note that if you rely on the presence of some secret exposed through {@link com.intellij.tasks.impl.BaseRepository#getPassword()}
|
||||
* you should access the corresponding field through {@code getPassword()}, not directly via the underlying field.
|
||||
* Otherwise, it might not be loaded from the system password-safe by the moment of the check.
|
||||
*/
|
||||
public boolean isConfigured() {
|
||||
return StringUtil.isNotEmpty(getUrl());
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ public class MantisRepository extends BaseRepositoryImpl {
|
||||
|
||||
@Override
|
||||
public boolean isConfigured() {
|
||||
return super.isConfigured() && StringUtil.isNotEmpty(myUsername) && StringUtil.isNotEmpty(myPassword);
|
||||
return super.isConfigured() && StringUtil.isNotEmpty(getUsername()) && StringUtil.isNotEmpty(getPassword());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -271,9 +271,9 @@ public class RedmineRepository extends NewBaseRepositoryImpl {
|
||||
public boolean isConfigured() {
|
||||
if (!super.isConfigured()) return false;
|
||||
if (isUseHttpAuthentication()) {
|
||||
return StringUtil.isNotEmpty(myPassword) && StringUtil.isNotEmpty(myUsername);
|
||||
return StringUtil.isNotEmpty(getPassword()) && StringUtil.isNotEmpty(getUsername());
|
||||
}
|
||||
return StringUtil.isNotEmpty(myAPIKey);
|
||||
return StringUtil.isNotEmpty(getAPIKey());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -385,7 +385,7 @@ public final class TrelloRepository extends NewBaseRepositoryImpl {
|
||||
|
||||
@Override
|
||||
public boolean isConfigured() {
|
||||
return super.isConfigured() && StringUtil.isNotEmpty(myPassword);
|
||||
return super.isConfigured() && StringUtil.isNotEmpty(getPassword());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user