Fix more problems with CF CLI target expired token killing other targets results.
This commit is contained in:
@@ -27,16 +27,60 @@ public class ClientParamsCacheKey {
|
||||
private ClientParamsCacheKey(CFClientParams fullParams) {
|
||||
this.fullParams = fullParams;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @Override
|
||||
// public int hashCode() {
|
||||
// final int prime = 31;
|
||||
// int result = 1;
|
||||
// result = prime * result + ((fullParams.getApiUrl() == null) ? 0 : fullParams.getApiUrl().hashCode());
|
||||
// result = prime * result + ((fullParams.getOrgName() == null) ? 0 : fullParams.getOrgName().hashCode());
|
||||
// result = prime * result + (fullParams.skipSslValidation() ? 1231 : 1237);
|
||||
// result = prime * result + ((fullParams.getSpaceName() == null) ? 0 : fullParams.getSpaceName().hashCode());
|
||||
// result = prime * result + ((fullParams.getUsername() == null) ? 0 : fullParams.getUsername().hashCode());
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean equals(Object obj) {
|
||||
// if (this == obj)
|
||||
// return true;
|
||||
// if (obj == null)
|
||||
// return false;
|
||||
// if (getClass() != obj.getClass())
|
||||
// return false;
|
||||
// ClientParamsCacheKey other = (ClientParamsCacheKey) obj;
|
||||
// if (fullParams.getApiUrl() == null) {
|
||||
// if (other.fullParams.getApiUrl() != null)
|
||||
// return false;
|
||||
// } else if (!fullParams.getApiUrl().equals(other.fullParams.getApiUrl()))
|
||||
// return false;
|
||||
// if (fullParams.getOrgName() == null) {
|
||||
// if (other.fullParams.getOrgName() != null)
|
||||
// return false;
|
||||
// } else if (!fullParams.getOrgName().equals(other.fullParams.getOrgName()))
|
||||
// return false;
|
||||
// if (fullParams.skipSslValidation() != other.fullParams.skipSslValidation())
|
||||
// return false;
|
||||
// if (fullParams.getSpaceName() == null) {
|
||||
// if (other.fullParams.getSpaceName() != null)
|
||||
// return false;
|
||||
// } else if (!fullParams.getSpaceName().equals(other.fullParams.getSpaceName()))
|
||||
// return false;
|
||||
// if (fullParams.getUsername() == null) {
|
||||
// if (other.fullParams.getUsername() != null)
|
||||
// return false;
|
||||
// } else if (!fullParams.getUsername().equals(other.fullParams.getUsername()))
|
||||
// return false;
|
||||
// return true;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((fullParams.getApiUrl() == null) ? 0 : fullParams.getApiUrl().hashCode());
|
||||
result = prime * result + ((fullParams.getOrgName() == null) ? 0 : fullParams.getOrgName().hashCode());
|
||||
result = prime * result + (fullParams.skipSslValidation() ? 1231 : 1237);
|
||||
result = prime * result + ((fullParams.getSpaceName() == null) ? 0 : fullParams.getSpaceName().hashCode());
|
||||
result = prime * result + ((fullParams.getUsername() == null) ? 0 : fullParams.getUsername().hashCode());
|
||||
result = prime * result + ((fullParams == null) ? 0 : fullParams.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -49,31 +93,16 @@ public class ClientParamsCacheKey {
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ClientParamsCacheKey other = (ClientParamsCacheKey) obj;
|
||||
if (fullParams.getApiUrl() == null) {
|
||||
if (other.fullParams.getApiUrl() != null)
|
||||
if (fullParams == null) {
|
||||
if (other.fullParams != null)
|
||||
return false;
|
||||
} else if (!fullParams.getApiUrl().equals(other.fullParams.getApiUrl()))
|
||||
return false;
|
||||
if (fullParams.getOrgName() == null) {
|
||||
if (other.fullParams.getOrgName() != null)
|
||||
return false;
|
||||
} else if (!fullParams.getOrgName().equals(other.fullParams.getOrgName()))
|
||||
return false;
|
||||
if (fullParams.skipSslValidation() != other.fullParams.skipSslValidation())
|
||||
return false;
|
||||
if (fullParams.getSpaceName() == null) {
|
||||
if (other.fullParams.getSpaceName() != null)
|
||||
return false;
|
||||
} else if (!fullParams.getSpaceName().equals(other.fullParams.getSpaceName()))
|
||||
return false;
|
||||
if (fullParams.getUsername() == null) {
|
||||
if (other.fullParams.getUsername() != null)
|
||||
return false;
|
||||
} else if (!fullParams.getUsername().equals(other.fullParams.getUsername()))
|
||||
} else if (!fullParams.equals(other.fullParams))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static ClientParamsCacheKey from(CFClientParams params) {
|
||||
return new ClientParamsCacheKey(params);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class ManifestYamlLanguageServer extends SimpleLanguageServer {
|
||||
for (ClientParamsProvider provider : providers) {
|
||||
try {
|
||||
params.addAll(provider.getParams());
|
||||
} catch (NoTargetsException e) {
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user