Skip to content

Commit 8fed235

Browse files
committed
awsGH-72: Replace 'joda-time' with 'java.time.ZonedDateTime'
1 parent 9c2c1ea commit 8fed235

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

aws-lambda-java-events/pom.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,17 @@
4343
</distributionManagement>
4444

4545
<dependencies>
46-
<dependency>
47-
<groupId>joda-time</groupId>
48-
<artifactId>joda-time</artifactId>
49-
<version>2.6</version>
50-
</dependency>
5146
<dependency>
5247
<groupId>com.amazonaws</groupId>
5348
<artifactId>aws-java-sdk-s3</artifactId>
5449
<version>1.11.163</version>
5550
<scope>provided</scope>
51+
<exclusions>
52+
<exclusion>
53+
<groupId>joda-time</groupId>
54+
<artifactId>joda-time</artifactId>
55+
</exclusion>
56+
</exclusions>
5657
</dependency>
5758
<dependency>
5859
<groupId>com.amazonaws</groupId>

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/CodeCommitEvent.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package com.amazonaws.services.lambda.runtime.events;
22

3-
import org.joda.time.DateTime;
4-
53
import java.io.Serializable;
4+
import java.time.ZonedDateTime;
65
import java.util.List;
76

87
/**
@@ -270,7 +269,7 @@ public static class Record implements Serializable, Cloneable {
270269

271270
private String eventVersion;
272271

273-
private DateTime eventTime;
272+
private ZonedDateTime eventTime;
274273

275274
private String eventTriggerName;
276275

@@ -346,22 +345,22 @@ public Record withEventVersion(String eventVersion) {
346345
/**
347346
* @return event timestamp
348347
*/
349-
public DateTime getEventTime() {
348+
public ZonedDateTime getEventTime() {
350349
return this.eventTime;
351350
}
352351

353352
/**
354353
* @param eventTime event timestamp
355354
*/
356-
public void setEventTime(DateTime eventTime) {
355+
public void setEventTime(ZonedDateTime eventTime) {
357356
this.eventTime = eventTime;
358357
}
359358

360359
/**
361360
* @param eventTime event timestamp
362361
* @return Record
363362
*/
364-
public Record withEventTime(DateTime eventTime) {
363+
public Record withEventTime(ZonedDateTime eventTime) {
365364
setEventTime(eventTime);
366365
return this;
367366
}

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
*/
1313
package com.amazonaws.services.lambda.runtime.events;
1414

15-
import org.joda.time.DateTime;
16-
1715
import java.io.Serializable;
16+
import java.time.ZonedDateTime;
1817
import java.util.List;
1918
import java.util.Map;
2019

@@ -181,7 +180,7 @@ public static class SNS implements Serializable, Cloneable {
181180

182181
private String signature;
183182

184-
private DateTime timestamp;
183+
private ZonedDateTime timestamp;
185184

186185
private String topicArn;
187186

@@ -421,23 +420,23 @@ public SNS withSignature(String signature) {
421420
* Gets the message time stamp
422421
* @return timestamp of sns message
423422
*/
424-
public DateTime getTimestamp() {
423+
public ZonedDateTime getTimestamp() {
425424
return timestamp;
426425
}
427426

428427
/**
429428
* Sets the message time stamp
430429
* @param timestamp A Date object representing the message time stamp
431430
*/
432-
public void setTimestamp(DateTime timestamp) {
431+
public void setTimestamp(ZonedDateTime timestamp) {
433432
this.timestamp = timestamp;
434433
}
435434

436435
/**
437436
* @param timestamp timestamp
438437
* @return SNS
439438
*/
440-
public SNS withTimestamp(DateTime timestamp) {
439+
public SNS withTimestamp(ZonedDateTime timestamp) {
441440
setTimestamp(timestamp);
442441
return this;
443442
}

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/ScheduledEvent.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
package com.amazonaws.services.lambda.runtime.events;
1515

16-
import org.joda.time.DateTime;
17-
1816
import java.io.Serializable;
17+
import java.time.ZonedDateTime;
1918
import java.util.List;
2019
import java.util.Map;
2120

@@ -38,7 +37,7 @@ public class ScheduledEvent implements Serializable, Cloneable {
3837

3938
private String id;
4039

41-
private DateTime time;
40+
private ZonedDateTime time;
4241

4342
private List<String> resources;
4443

@@ -165,22 +164,22 @@ public ScheduledEvent withSource(String source) {
165164
/**
166165
* @return the timestamp for when the event is scheduled
167166
*/
168-
public DateTime getTime() {
167+
public ZonedDateTime getTime() {
169168
return this.time;
170169
}
171170

172171
/**
173172
* @param time the timestamp for when the event is scheduled
174173
*/
175-
public void setTime(DateTime time) {
174+
public void setTime(ZonedDateTime time) {
176175
this.time = time;
177176
}
178177

179178
/**
180179
* @param time the timestamp for when the event is scheduled
181180
* @return ScheduledEvent
182181
*/
183-
public ScheduledEvent withTime(DateTime time) {
182+
public ScheduledEvent withTime(ZonedDateTime time) {
184183
setTime(time);
185184
return this;
186185
}

0 commit comments

Comments
 (0)