Skip to content

Commit

Permalink
improve coding styles
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Jul 22, 2024
1 parent ea315c3 commit 7a021f6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 41 deletions.
24 changes: 0 additions & 24 deletions aliyun-java-sdk-core/src/main/java/com/aliyuncs/CommonRequest.java
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
10 changes: 0 additions & 10 deletions aliyun-java-sdk-core/src/main/java/com/aliyuncs/auth/Signer.java
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

0 comments on commit 7a021f6

Please sign in to comment.