Skip to content

Commit 7a021f6

Browse files
committed
improve coding styles
1 parent ea315c3 commit 7a021f6

File tree

3 files changed

+2
-41
lines changed

3 files changed

+2
-41
lines changed

aliyun-java-sdk-core/src/main/java/com/aliyuncs/CommonRequest.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -509,30 +509,6 @@ public Map<String, String> getSysPathParameters() {
509509
return pathParameters;
510510
}
511511

512-
public void setSysAccept(FormatType type) {
513-
this.accept = type;
514-
}
515-
516-
public FormatType getSysAccept() {
517-
return this.accept;
518-
}
519-
520-
public SignatureVersion getSysSignatureVersion() {
521-
return signatureVersion;
522-
}
523-
524-
public void setSysSignatureVersion(SignatureVersion signatureVersion) {
525-
this.signatureVersion = signatureVersion;
526-
}
527-
528-
public SignatureAlgorithm getSysSignatureAlgorithm() {
529-
return signatureAlgorithm;
530-
}
531-
532-
public void setSysSignatureAlgorithm(SignatureAlgorithm signatureAlgorithm) {
533-
this.signatureAlgorithm = signatureAlgorithm;
534-
}
535-
536512
public RetryPolicy getSysRetryPolicy() {
537513
return this.retryPolicy;
538514
}

aliyun-java-sdk-core/src/main/java/com/aliyuncs/auth/Signer.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ public abstract class Signer {
3333
private final static Signer HMAC_SM3 = new HmacSM3Signer();
3434
private final static Signer HMAC_SHA256 = new HmacSHA256Signer();
3535

36-
public static Signer getSigner(AlibabaCloudCredentials credentials) {
37-
if (credentials instanceof KeyPairCredentials) {
38-
return SHA256_WITH_RSA_SIGNER;
39-
} else if (credentials instanceof BearerTokenCredentials) {
40-
return BEARER_TOKEN_SIGNER;
41-
} else {
42-
return HMACSHA1_SIGNER;
43-
}
44-
}
45-
4636
public static Signer getSigner(AlibabaCloudCredentials credentials, SignatureVersion signatureVersion, SignatureAlgorithm signatureAlgorithm) {
4737
switch (signatureVersion) {
4838
case V3:

aliyun-java-sdk-core/src/main/java/com/aliyuncs/endpoint/LocationServiceEndpointResolver.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.aliyuncs.exceptions.ClientException;
77
import com.aliyuncs.http.FormatType;
88
import com.aliyuncs.http.ProtocolType;
9+
import com.aliyuncs.utils.StringUtils;
910

1011
import java.util.HashSet;
1112
import java.util.Set;
@@ -44,7 +45,7 @@ public static void setLocationServiceEndpoint(String endpoint) {
4445

4546
@Override
4647
public String resolve(ResolveEndpointRequest request) throws ClientException {
47-
if (request.locationServiceCode == null || request.locationServiceCode.length() == 0) {
48+
if (StringUtils.isEmpty(request.locationServiceCode)) {
4849
return null;
4950
}
5051

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

115-
116116
boolean foundFlag = false;
117117
for (DescribeEndpointsResponse.Endpoint endpoint : response.getEndpoints()) {
118118
if (endpoint.getSerivceCode().equals(request.locationServiceCode)
@@ -149,11 +149,6 @@ public String makeEndpointKey(ResolveEndpointRequest request) {
149149
);
150150
}
151151

152-
@Deprecated
153-
public String makeRegionIdKey(ResolveEndpointRequest request) {
154-
return request.locationServiceCode + "." + request.regionId + "." + request.endpointType;
155-
}
156-
157152
public String makeEndpointKey(String productCode, String locationServiceCode, String regionId,
158153
String endpointType) {
159154
return productCode.toLowerCase() + "." + locationServiceCode + "."

0 commit comments

Comments
 (0)