Skip to content

Commit 46f3859

Browse files
authored
Remove Cloneable interface (#348)
Remove Cloneable interface
1 parent b108a2e commit 46f3859

26 files changed

+55
-449
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@Builder(setterPrefix = "with")
3636
@NoArgsConstructor
3737
@AllArgsConstructor
38-
public class CloudFormationCustomResourceEvent implements Serializable, Cloneable {
38+
public class CloudFormationCustomResourceEvent implements Serializable {
3939

4040
@JsonProperty("RequestType")
4141
private String requestType;

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

+7-69
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@Builder(setterPrefix = "with")
3333
@NoArgsConstructor
3434
@AllArgsConstructor
35-
public class CloudFrontEvent implements Serializable, Cloneable {
35+
public class CloudFrontEvent implements Serializable {
3636

3737
private static final long serialVersionUID = -7169297388214516660L;
3838

@@ -47,23 +47,14 @@ public class CloudFrontEvent implements Serializable, Cloneable {
4747
@Builder(setterPrefix = "with")
4848
@NoArgsConstructor
4949
@AllArgsConstructor
50-
public static class Header implements Serializable, Cloneable {
50+
public static class Header implements Serializable {
5151

5252
private static final long serialVersionUID = 7041042740552686996L;
5353

5454
private String key;
5555

5656
private String value;
5757

58-
@Override
59-
public Header clone() {
60-
try {
61-
return (Header) super.clone();
62-
} catch (CloneNotSupportedException e) {
63-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
64-
}
65-
}
66-
6758
}
6859

6960
/**
@@ -74,21 +65,12 @@ public Header clone() {
7465
@Builder(setterPrefix = "with")
7566
@NoArgsConstructor
7667
@AllArgsConstructor
77-
public static class Config implements Serializable, Cloneable {
68+
public static class Config implements Serializable {
7869

7970
private static final long serialVersionUID = -286083903805870299L;
8071

8172
private String distributionId;
8273

83-
@Override
84-
public Config clone() {
85-
try {
86-
return (Config) super.clone();
87-
} catch (CloneNotSupportedException e) {
88-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
89-
}
90-
}
91-
9274
}
9375

9476
/**
@@ -99,7 +81,7 @@ public Config clone() {
9981
@Builder(setterPrefix = "with")
10082
@NoArgsConstructor
10183
@AllArgsConstructor
102-
public static class Request implements Serializable, Cloneable {
84+
public static class Request implements Serializable {
10385

10486
private static final long serialVersionUID = 3245036101075464149L;
10587

@@ -113,14 +95,6 @@ public static class Request implements Serializable, Cloneable {
11395

11496
private Map<String, List<Header>> headers;
11597

116-
@Override
117-
public Request clone() {
118-
try {
119-
return (Request) super.clone();
120-
} catch (CloneNotSupportedException e) {
121-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
122-
}
123-
}
12498
}
12599

126100
/**
@@ -131,7 +105,7 @@ public Request clone() {
131105
@Builder(setterPrefix = "with")
132106
@NoArgsConstructor
133107
@AllArgsConstructor
134-
public static class Response implements Serializable, Cloneable {
108+
public static class Response implements Serializable {
135109

136110
private static final long serialVersionUID = -3711565862079053710L;
137111

@@ -143,15 +117,6 @@ public static class Response implements Serializable, Cloneable {
143117

144118
private Map<String, List<Header>> headers;
145119

146-
@Override
147-
public Response clone() {
148-
try {
149-
return (Response) super.clone();
150-
} catch (CloneNotSupportedException e) {
151-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
152-
}
153-
}
154-
155120
}
156121

157122
/**
@@ -162,7 +127,7 @@ public Response clone() {
162127
@Builder(setterPrefix = "with")
163128
@NoArgsConstructor
164129
@AllArgsConstructor
165-
public static class CF implements Serializable, Cloneable {
130+
public static class CF implements Serializable {
166131

167132
private static final long serialVersionUID = -5940167419180448832L;
168133

@@ -172,15 +137,6 @@ public static class CF implements Serializable, Cloneable {
172137

173138
private Response response;
174139

175-
@Override
176-
public CF clone() {
177-
try {
178-
return (CF) super.clone();
179-
} catch (CloneNotSupportedException e) {
180-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
181-
}
182-
}
183-
184140
}
185141

186142
/**
@@ -191,29 +147,11 @@ public CF clone() {
191147
@Builder(setterPrefix = "with")
192148
@NoArgsConstructor
193149
@AllArgsConstructor
194-
public static class Record implements Serializable, Cloneable {
150+
public static class Record implements Serializable {
195151

196152
private static final long serialVersionUID = -6114551370798889850L;
197153

198154
private CF cf;
199155

200-
@Override
201-
public Record clone() {
202-
try {
203-
return (Record) super.clone();
204-
} catch (CloneNotSupportedException e) {
205-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
206-
}
207-
}
208-
209-
}
210-
211-
@Override
212-
public CloudFrontEvent clone() {
213-
try {
214-
return (CloudFrontEvent) super.clone();
215-
} catch (CloneNotSupportedException e) {
216-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
217-
}
218156
}
219157
}

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

+2-20
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@Builder(setterPrefix = "with")
3030
@NoArgsConstructor
3131
@AllArgsConstructor
32-
public class CloudWatchLogsEvent implements Serializable, Cloneable {
32+
public class CloudWatchLogsEvent implements Serializable {
3333

3434
private static final long serialVersionUID = -1617470828168156271L;
3535

@@ -43,29 +43,11 @@ public class CloudWatchLogsEvent implements Serializable, Cloneable {
4343
@Builder(setterPrefix = "with")
4444
@NoArgsConstructor
4545
@AllArgsConstructor
46-
public static class AWSLogs implements Serializable, Cloneable {
46+
public static class AWSLogs implements Serializable {
4747

4848
private static final long serialVersionUID = -7793438350437169987L;
4949

5050
private String data;
5151

52-
@Override
53-
public AWSLogs clone() {
54-
try {
55-
return (AWSLogs) super.clone();
56-
} catch (CloneNotSupportedException e) {
57-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
58-
}
59-
}
60-
61-
}
62-
63-
@Override
64-
public CloudWatchLogsEvent clone() {
65-
try {
66-
return (CloudWatchLogsEvent) super.clone();
67-
} catch (CloneNotSupportedException e) {
68-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
69-
}
7052
}
7153
}

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

+4-40
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@Builder(setterPrefix = "with")
3535
@NoArgsConstructor
3636
@AllArgsConstructor
37-
public class CodeCommitEvent implements Serializable, Cloneable {
37+
public class CodeCommitEvent implements Serializable {
3838

3939
private static final long serialVersionUID = 2404735479795009282L;
4040

@@ -49,7 +49,7 @@ public class CodeCommitEvent implements Serializable, Cloneable {
4949
@Builder(setterPrefix = "with")
5050
@NoArgsConstructor
5151
@AllArgsConstructor
52-
public static class Reference implements Serializable, Cloneable {
52+
public static class Reference implements Serializable {
5353

5454
private static final long serialVersionUID = 9166524005926768827L;
5555

@@ -58,15 +58,6 @@ public static class Reference implements Serializable, Cloneable {
5858
private String ref;
5959

6060
private Boolean created;
61-
62-
@Override
63-
public Reference clone() {
64-
try {
65-
return (Reference) super.clone();
66-
} catch (CloneNotSupportedException e) {
67-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
68-
}
69-
}
7061
}
7162

7263
/**
@@ -77,20 +68,11 @@ public Reference clone() {
7768
@Builder(setterPrefix = "with")
7869
@NoArgsConstructor
7970
@AllArgsConstructor
80-
public static class CodeCommit implements Serializable, Cloneable {
71+
public static class CodeCommit implements Serializable {
8172

8273
private static final long serialVersionUID = 2594306162311794147L;
8374

8475
private List<Reference> references;
85-
86-
@Override
87-
public CodeCommit clone() {
88-
try {
89-
return (CodeCommit) super.clone();
90-
} catch (CloneNotSupportedException e) {
91-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
92-
}
93-
}
9476
}
9577

9678
/**
@@ -101,7 +83,7 @@ public CodeCommit clone() {
10183
@Builder(setterPrefix = "with")
10284
@NoArgsConstructor
10385
@AllArgsConstructor
104-
public static class Record implements Serializable, Cloneable {
86+
public static class Record implements Serializable {
10587

10688
private static final long serialVersionUID = 1116409777237432728L;
10789

@@ -137,23 +119,5 @@ public static class Record implements Serializable, Cloneable {
137119

138120
private Integer eventTotalParts;
139121

140-
@Override
141-
public Record clone() {
142-
try {
143-
return (Record) super.clone();
144-
} catch (CloneNotSupportedException e) {
145-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
146-
}
147-
}
148-
149-
}
150-
151-
@Override
152-
public CodeCommitEvent clone() {
153-
try {
154-
return (CodeCommitEvent) super.clone();
155-
} catch (CloneNotSupportedException e) {
156-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
157-
}
158122
}
159123
}

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

+1-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
@Builder(setterPrefix = "with")
2929
@NoArgsConstructor
3030
@AllArgsConstructor
31-
public class ConfigEvent implements Serializable, Cloneable {
31+
public class ConfigEvent implements Serializable {
3232

3333
private static final long serialVersionUID = -3484211708255634243L;
3434

@@ -92,13 +92,4 @@ public class ConfigEvent implements Serializable, Cloneable {
9292
*/
9393
private boolean eventLeftScope;
9494

95-
@Override
96-
public ConfigEvent clone() {
97-
try {
98-
return (ConfigEvent) super.clone();
99-
} catch (CloneNotSupportedException e) {
100-
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone()", e);
101-
}
102-
}
103-
10495
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@Builder(setterPrefix = "with")
3636
@NoArgsConstructor
3737
@AllArgsConstructor
38-
public class ConnectEvent implements Serializable, Cloneable {
38+
public class ConnectEvent implements Serializable {
3939

4040
@JsonProperty("Details")
4141
private Details details;
@@ -47,7 +47,7 @@ public class ConnectEvent implements Serializable, Cloneable {
4747
@Builder(setterPrefix = "with")
4848
@NoArgsConstructor
4949
@AllArgsConstructor
50-
public static class Details implements Serializable, Cloneable {
50+
public static class Details implements Serializable {
5151

5252
@JsonProperty("ContactData")
5353
private ContactData contactData;
@@ -60,7 +60,7 @@ public static class Details implements Serializable, Cloneable {
6060
@Builder(setterPrefix = "with")
6161
@NoArgsConstructor
6262
@AllArgsConstructor
63-
public static class ContactData implements Serializable, Cloneable {
63+
public static class ContactData implements Serializable {
6464

6565
@JsonProperty("Attributes")
6666
private Map<String, String> attributes;
@@ -97,7 +97,7 @@ public static class ContactData implements Serializable, Cloneable {
9797
@Builder(setterPrefix = "with")
9898
@NoArgsConstructor
9999
@AllArgsConstructor
100-
public static class CustomerEndpoint implements Serializable, Cloneable {
100+
public static class CustomerEndpoint implements Serializable {
101101

102102
@JsonProperty("Address")
103103
private String address;
@@ -110,7 +110,7 @@ public static class CustomerEndpoint implements Serializable, Cloneable {
110110
@Builder(setterPrefix = "with")
111111
@NoArgsConstructor
112112
@AllArgsConstructor
113-
public static class SystemEndpoint implements Serializable, Cloneable {
113+
public static class SystemEndpoint implements Serializable {
114114

115115
@JsonProperty("Address")
116116
private String address;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static IamPolicyResponseV1.Statement denyStatement(String resource) {
9090
@Builder(setterPrefix = "with")
9191
@NoArgsConstructor
9292
@AllArgsConstructor
93-
public static class PolicyDocument implements Serializable, Cloneable {
93+
public static class PolicyDocument implements Serializable {
9494

9595
@JsonProperty("Version")
9696
private String version;
@@ -102,7 +102,7 @@ public static class PolicyDocument implements Serializable, Cloneable {
102102
@Builder(setterPrefix = "with")
103103
@NoArgsConstructor
104104
@AllArgsConstructor
105-
public static class Statement implements Serializable, Cloneable {
105+
public static class Statement implements Serializable {
106106

107107
@JsonProperty("Action")
108108
private List<String> action;

0 commit comments

Comments
 (0)