Skip to content

Commit f845fd8

Browse files
JacksonTianyndu13
authored andcommitted
remove lombok
1 parent 9edfe14 commit f845fd8

File tree

9 files changed

+162
-34
lines changed

9 files changed

+162
-34
lines changed

aliyun-java-sdk-core/pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<licenses>
3232
<license>
3333
<name>The Apache License, Version 2.0</name>
34-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
34+
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
3535
</license>
3636
</licenses>
3737
<scm>
@@ -135,12 +135,6 @@
135135
<version>0.8.12</version>
136136
<classifier>runtime</classifier>
137137
</dependency>
138-
<dependency>
139-
<groupId>org.projectlombok</groupId>
140-
<artifactId>lombok</artifactId>
141-
<version>1.18.34</version>
142-
<scope>provided</scope>
143-
</dependency>
144138
<dependency>
145139
<groupId>org.ini4j</groupId>
146140
<artifactId>ini4j</artifactId>

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/HttpMessage.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.aliyuncs.exceptions.ClientException;
44
import com.aliyuncs.policy.retry.RetryPolicy;
55
import com.aliyuncs.utils.ParameterHelper;
6-
import lombok.ToString;
76

87
import javax.net.ssl.KeyManager;
98
import javax.net.ssl.X509TrustManager;
@@ -12,7 +11,6 @@
1211
import java.util.HashMap;
1312
import java.util.Map;
1413

15-
@ToString
1614
public abstract class HttpMessage {
1715

1816
protected static final String CONTENT_TYPE = "Content-Type";

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/HttpRequest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package com.aliyuncs.http;
22

3-
import lombok.ToString;
4-
53
import java.util.Map;
64

7-
@ToString(callSuper = true)
85
public class HttpRequest extends HttpMessage {
96

107
public HttpRequest(String strUrl) {
@@ -17,4 +14,5 @@ public HttpRequest(String strUrl, Map<String, String> tmpHeaders) {
1714
this.headers = tmpHeaders;
1815
}
1916
}
17+
2018
}

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/HttpResponse.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package com.aliyuncs.http;
22

3-
import lombok.ToString;
4-
5-
@ToString(callSuper = true)
63
public class HttpResponse extends HttpMessage {
74

85
private int status;

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/IHttpClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public IHttpClient(HttpClientConfig clientConfig) throws ClientException {
1616
}
1717
this.clientConfig = clientConfig;
1818
init(clientConfig);
19-
2019
}
2120

2221
public IHttpClient() {

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/clients/CompatibleUrlConnClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ private Proxy calcProxy(URL url, HttpRequest request) throws ClientException {
182182
proxy = HttpUtil.getJDKProxy(clientConfig.getHttpProxy(), httpProxy, request);
183183
}
184184
return proxy;
185-
186185
}
187186

188187
private HttpURLConnection initHttpConnection(URL url, HttpRequest request) throws ClientException, IOException {

aliyun-java-sdk-core/src/main/java/com/aliyuncs/utils/LogUtils.java

Lines changed: 160 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import com.aliyuncs.exceptions.ClientException;
44
import com.aliyuncs.http.HttpRequest;
55
import com.aliyuncs.http.HttpResponse;
6-
import lombok.Getter;
7-
import lombok.Setter;
86

97
import java.net.InetAddress;
108
import java.net.MalformedURLException;
@@ -120,8 +118,6 @@ public static LogUnit createLogUnit(HttpRequest httpRequest, HttpResponse httpRe
120118
return new LogUnit(httpRequest, httpResponse);
121119
}
122120

123-
@Getter
124-
@Setter
125121
public static class LogUnit {
126122
private HttpRequest httpRequest;
127123
private HttpResponse httpResponse;
@@ -186,5 +182,165 @@ public LogUnit(HttpRequest httpRequest, HttpResponse httpResponse) {
186182
this.pid = String.valueOf(getCurrentPID());
187183
this.time = localeNow();
188184
}
185+
186+
public String getMethod() {
187+
return method;
188+
}
189+
190+
public void setMethod(String method) {
191+
this.method = method;
192+
}
193+
194+
public String getUrl() {
195+
return url;
196+
}
197+
198+
public void setUrl(String url) {
199+
this.url = url;
200+
}
201+
202+
public String getVersion() {
203+
return version;
204+
}
205+
206+
public void setVersion(String version) {
207+
this.version = version;
208+
}
209+
210+
public String getTime() {
211+
return time;
212+
}
213+
214+
public void setTime(String time) {
215+
this.time = time;
216+
}
217+
218+
public HttpRequest getHttpRequest() {
219+
return httpRequest;
220+
}
221+
222+
public void setHttpRequest(HttpRequest httpRequest) {
223+
this.httpRequest = httpRequest;
224+
}
225+
226+
public HttpResponse getHttpResponse() {
227+
return httpResponse;
228+
}
229+
230+
public void setHttpResponse(HttpResponse httpResponse) {
231+
this.httpResponse = httpResponse;
232+
}
233+
234+
public String getTs() {
235+
return ts;
236+
}
237+
238+
public void setTs(String ts) {
239+
this.ts = ts;
240+
}
241+
242+
public String getHost() {
243+
return host;
244+
}
245+
246+
public void setHost(String host) {
247+
this.host = host;
248+
}
249+
250+
public String getTarget() {
251+
return target;
252+
}
253+
254+
public void setTarget(String target) {
255+
this.target = target;
256+
}
257+
258+
public String getReqHeaders() {
259+
return reqHeaders;
260+
}
261+
262+
public void setReqHeaders(String reqHeaders) {
263+
this.reqHeaders = reqHeaders;
264+
}
265+
266+
public String getResHeaders() {
267+
return resHeaders;
268+
}
269+
270+
public void setResHeaders(String resHeaders) {
271+
this.resHeaders = resHeaders;
272+
}
273+
274+
public String getPhrase() {
275+
return phrase;
276+
}
277+
278+
public void setPhrase(String phrase) {
279+
this.phrase = phrase;
280+
}
281+
282+
public String getHostname() {
283+
return hostname;
284+
}
285+
286+
public void setHostname(String hostname) {
287+
this.hostname = hostname;
288+
}
289+
290+
public String getReqBody() {
291+
return reqBody;
292+
}
293+
294+
public void setReqBody(String reqBody) {
295+
this.reqBody = reqBody;
296+
}
297+
298+
public String getResBody() {
299+
return resBody;
300+
}
301+
302+
public void setResBody(String resBody) {
303+
this.resBody = resBody;
304+
}
305+
306+
public String getPid() {
307+
return pid;
308+
}
309+
310+
public void setPid(String pid) {
311+
this.pid = pid;
312+
}
313+
314+
public String getCost() {
315+
return cost;
316+
}
317+
318+
public void setCost(String cost) {
319+
this.cost = cost;
320+
}
321+
322+
public String getStartTime() {
323+
return startTime;
324+
}
325+
326+
public void setStartTime(String startTime) {
327+
this.startTime = startTime;
328+
}
329+
330+
public String getError() {
331+
return error;
332+
}
333+
334+
public void setError(String error) {
335+
this.error = error;
336+
}
337+
338+
public String getCode() {
339+
return code;
340+
}
341+
342+
public void setCode(String code) {
343+
this.code = code;
344+
}
189345
}
190346
}

aliyun-java-sdk-core/src/test/java/com/aliyuncs/http/HttpRequestTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,4 @@ public void getHttpContentStringTest() throws ClientException, UnsupportedEncodi
6565
}
6666

6767
}
68-
69-
@Test
70-
public void toStringTest() {
71-
HttpRequest request = new HttpRequest("testURL");
72-
String res = request.toString();
73-
Assert.assertTrue(res.contains("testURL"));
74-
}
7568
}

aliyun-java-sdk-core/src/test/java/com/aliyuncs/http/HttpResponseTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,4 @@ public void isSuccessTest() {
5454
response.setStatus(100);
5555
Assert.assertFalse(response.isSuccess());
5656
}
57-
58-
@Test
59-
public void toStringTest() {
60-
HttpResponse response = new HttpResponse("testURL");
61-
Assert.assertTrue(response.toString().contains("testURL"));
62-
}
6357
}

0 commit comments

Comments
 (0)