Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]improve coding styles #913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -509,30 +509,6 @@ public Map<String, String> getSysPathParameters() {
return pathParameters;
}

public void setSysAccept(FormatType type) {
this.accept = type;
}

public FormatType getSysAccept() {
return this.accept;
}

public SignatureVersion getSysSignatureVersion() {
return signatureVersion;
}

public void setSysSignatureVersion(SignatureVersion signatureVersion) {
this.signatureVersion = signatureVersion;
}

public SignatureAlgorithm getSysSignatureAlgorithm() {
return signatureAlgorithm;
}

public void setSysSignatureAlgorithm(SignatureAlgorithm signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
}

public RetryPolicy getSysRetryPolicy() {
return this.retryPolicy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ public abstract class Signer {
private final static Signer HMAC_SM3 = new HmacSM3Signer();
private final static Signer HMAC_SHA256 = new HmacSHA256Signer();

public static Signer getSigner(AlibabaCloudCredentials credentials) {
if (credentials instanceof KeyPairCredentials) {
return SHA256_WITH_RSA_SIGNER;
} else if (credentials instanceof BearerTokenCredentials) {
return BEARER_TOKEN_SIGNER;
} else {
return HMACSHA1_SIGNER;
}
}

public static Signer getSigner(AlibabaCloudCredentials credentials, SignatureVersion signatureVersion, SignatureAlgorithm signatureAlgorithm) {
switch (signatureVersion) {
case V3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.FormatType;
import com.aliyuncs.http.ProtocolType;
import com.aliyuncs.utils.StringUtils;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -44,7 +45,7 @@ public static void setLocationServiceEndpoint(String endpoint) {

@Override
public String resolve(ResolveEndpointRequest request) throws ClientException {
if (request.locationServiceCode == null || request.locationServiceCode.length() == 0) {
if (StringUtils.isEmpty(request.locationServiceCode)) {
return null;
}

Expand Down Expand Up @@ -112,7 +113,6 @@ private void callLocationService(String key, ResolveEndpointRequest request) thr
validProductCodes.add(request.productCodeLower);
validRegionIds.add(request.regionId);


boolean foundFlag = false;
for (DescribeEndpointsResponse.Endpoint endpoint : response.getEndpoints()) {
if (endpoint.getSerivceCode().equals(request.locationServiceCode)
Expand Down Expand Up @@ -149,11 +149,6 @@ public String makeEndpointKey(ResolveEndpointRequest request) {
);
}

@Deprecated
public String makeRegionIdKey(ResolveEndpointRequest request) {
return request.locationServiceCode + "." + request.regionId + "." + request.endpointType;
}

public String makeEndpointKey(String productCode, String locationServiceCode, String regionId,
String endpointType) {
return productCode.toLowerCase() + "." + locationServiceCode + "."
Expand Down
Loading