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

remove lombok #920

Merged
merged 1 commit into from
Jul 22, 2024
Merged
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
8 changes: 1 addition & 7 deletions aliyun-java-sdk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
Expand Down Expand Up @@ -135,12 +135,6 @@
<version>0.8.12</version>
<classifier>runtime</classifier>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.policy.retry.RetryPolicy;
import com.aliyuncs.utils.ParameterHelper;
import lombok.ToString;

import javax.net.ssl.KeyManager;
import javax.net.ssl.X509TrustManager;
Expand All @@ -12,7 +11,6 @@
import java.util.HashMap;
import java.util.Map;

@ToString
public abstract class HttpMessage {

protected static final String CONTENT_TYPE = "Content-Type";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.aliyuncs.http;

import lombok.ToString;

import java.util.Map;

@ToString(callSuper = true)
public class HttpRequest extends HttpMessage {

public HttpRequest(String strUrl) {
Expand All @@ -17,4 +14,5 @@ public HttpRequest(String strUrl, Map<String, String> tmpHeaders) {
this.headers = tmpHeaders;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.aliyuncs.http;

import lombok.ToString;

@ToString(callSuper = true)
public class HttpResponse extends HttpMessage {

private int status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public IHttpClient(HttpClientConfig clientConfig) throws ClientException {
}
this.clientConfig = clientConfig;
init(clientConfig);

}

public IHttpClient() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ private Proxy calcProxy(URL url, HttpRequest request) throws ClientException {
proxy = HttpUtil.getJDKProxy(clientConfig.getHttpProxy(), httpProxy, request);
}
return proxy;

}

private HttpURLConnection initHttpConnection(URL url, HttpRequest request) throws ClientException, IOException {
Expand Down
164 changes: 160 additions & 4 deletions aliyun-java-sdk-core/src/main/java/com/aliyuncs/utils/LogUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.http.HttpRequest;
import com.aliyuncs.http.HttpResponse;
import lombok.Getter;
import lombok.Setter;

import java.net.InetAddress;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -120,8 +118,6 @@ public static LogUnit createLogUnit(HttpRequest httpRequest, HttpResponse httpRe
return new LogUnit(httpRequest, httpResponse);
}

@Getter
@Setter
public static class LogUnit {
private HttpRequest httpRequest;
private HttpResponse httpResponse;
Expand Down Expand Up @@ -186,5 +182,165 @@ public LogUnit(HttpRequest httpRequest, HttpResponse httpResponse) {
this.pid = String.valueOf(getCurrentPID());
this.time = localeNow();
}

public String getMethod() {
return method;
}

public void setMethod(String method) {
this.method = method;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}

public String getTime() {
return time;
}

public void setTime(String time) {
this.time = time;
}

public HttpRequest getHttpRequest() {
return httpRequest;
}

public void setHttpRequest(HttpRequest httpRequest) {
this.httpRequest = httpRequest;
}

public HttpResponse getHttpResponse() {
return httpResponse;
}

public void setHttpResponse(HttpResponse httpResponse) {
this.httpResponse = httpResponse;
}

public String getTs() {
return ts;
}

public void setTs(String ts) {
this.ts = ts;
}

public String getHost() {
return host;
}

public void setHost(String host) {
this.host = host;
}

public String getTarget() {
return target;
}

public void setTarget(String target) {
this.target = target;
}

public String getReqHeaders() {
return reqHeaders;
}

public void setReqHeaders(String reqHeaders) {
this.reqHeaders = reqHeaders;
}

public String getResHeaders() {
return resHeaders;
}

public void setResHeaders(String resHeaders) {
this.resHeaders = resHeaders;
}

public String getPhrase() {
return phrase;
}

public void setPhrase(String phrase) {
this.phrase = phrase;
}

public String getHostname() {
return hostname;
}

public void setHostname(String hostname) {
this.hostname = hostname;
}

public String getReqBody() {
return reqBody;
}

public void setReqBody(String reqBody) {
this.reqBody = reqBody;
}

public String getResBody() {
return resBody;
}

public void setResBody(String resBody) {
this.resBody = resBody;
}

public String getPid() {
return pid;
}

public void setPid(String pid) {
this.pid = pid;
}

public String getCost() {
return cost;
}

public void setCost(String cost) {
this.cost = cost;
}

public String getStartTime() {
return startTime;
}

public void setStartTime(String startTime) {
this.startTime = startTime;
}

public String getError() {
return error;
}

public void setError(String error) {
this.error = error;
}

public String getCode() {
return code;
}

public void setCode(String code) {
this.code = code;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,4 @@ public void getHttpContentStringTest() throws ClientException, UnsupportedEncodi
}

}

@Test
public void toStringTest() {
HttpRequest request = new HttpRequest("testURL");
String res = request.toString();
Assert.assertTrue(res.contains("testURL"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,4 @@ public void isSuccessTest() {
response.setStatus(100);
Assert.assertFalse(response.isSuccess());
}

@Test
public void toStringTest() {
HttpResponse response = new HttpResponse("testURL");
Assert.assertTrue(response.toString().contains("testURL"));
}
}
Loading