Skip to content

Commit 562b3ef

Browse files
authored
fix(Java): Improve Collection of Errors string (#1478)
1 parent cc937b4 commit 562b3ef

File tree

9 files changed

+147
-0
lines changed

9 files changed

+147
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ test/**/Output/*
1616
specification_compliance_report.html
1717
/compliance
1818
/.smithy.lsp.log
19+
20+
# logs
21+
*.log
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java
2+
index c6f44188..c2af7d32 100644
3+
--- b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java
4+
+++ a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.dbencryptionsdk.dynamodb.model;
7+
8+
import java.util.List;
9+
+import java.util.stream.Collectors;
10+
11+
public class CollectionOfErrors extends RuntimeException {
12+
13+
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException {
14+
}
15+
16+
public CollectionOfErrors build() {
17+
+ if (!(this.list == null || this.list.isEmpty())) {
18+
+ this.message =
19+
+ this.message +
20+
+ " String representation of Exceptions in list.\n" +
21+
+ this.list.stream()
22+
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
23+
+ .collect(Collectors.joining("\n"));
24+
+ }
25+
return new CollectionOfErrors(this);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java
2+
index 7a2ca9b0..db01d961 100644
3+
--- b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java
4+
+++ a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model;
7+
8+
import java.util.List;
9+
+import java.util.stream.Collectors;
10+
11+
public class CollectionOfErrors extends RuntimeException {
12+
13+
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException {
14+
}
15+
16+
public CollectionOfErrors build() {
17+
+ if (!(this.list == null || this.list.isEmpty())) {
18+
+ this.message =
19+
+ this.message +
20+
+ " String representation of Exceptions in list.\n" +
21+
+ this.list.stream()
22+
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
23+
+ .collect(Collectors.joining("\n"));
24+
+ }
25+
return new CollectionOfErrors(this);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java
2+
index 1bb59f8f..19928c23 100644
3+
--- b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java
4+
+++ a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model;
7+
8+
import java.util.List;
9+
+import java.util.stream.Collectors;
10+
11+
public class CollectionOfErrors extends RuntimeException {
12+
13+
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException {
14+
}
15+
16+
public CollectionOfErrors build() {
17+
+ if (!(this.list == null || this.list.isEmpty())) {
18+
+ this.message =
19+
+ this.message +
20+
+ " String representation of Exceptions in list.\n" +
21+
+ this.list.stream()
22+
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
23+
+ .collect(Collectors.joining("\n"));
24+
+ }
25+
return new CollectionOfErrors(this);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java
2+
index a4d45a55..a6c2fc43 100644
3+
--- b/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java
4+
+++ a/DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.dbencryptionsdk.structuredencryption.model;
7+
8+
import java.util.List;
9+
+import java.util.stream.Collectors;
10+
11+
public class CollectionOfErrors extends RuntimeException {
12+
13+
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException {
14+
}
15+
16+
public CollectionOfErrors build() {
17+
+ if (!(this.list == null || this.list.isEmpty())) {
18+
+ this.message =
19+
+ this.message +
20+
+ " String representation of Exceptions in list.\n" +
21+
+ this.list.stream()
22+
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
23+
+ .collect(Collectors.joining("\n"));
24+
+ }
25+
return new CollectionOfErrors(this);
26+
}
27+
}

DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/itemencryptor/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model;
55

66
import java.util.List;
7+
import java.util.stream.Collectors;
78

89
public class CollectionOfErrors extends RuntimeException {
910

@@ -134,6 +135,14 @@ public List<RuntimeException> list() {
134135
}
135136

136137
public CollectionOfErrors build() {
138+
if (!(this.list == null || this.list.isEmpty())) {
139+
this.message =
140+
this.message +
141+
" String representation of Exceptions in list.\n" +
142+
this.list.stream()
143+
.map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
144+
.collect(Collectors.joining("\n"));
145+
}
137146
return new CollectionOfErrors(this);
138147
}
139148
}

DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.dbencryptionsdk.dynamodb.model;
55

66
import java.util.List;
7+
import java.util.stream.Collectors;
78

89
public class CollectionOfErrors extends RuntimeException {
910

@@ -134,6 +135,14 @@ public List<RuntimeException> list() {
134135
}
135136

136137
public CollectionOfErrors build() {
138+
if (!(this.list == null || this.list.isEmpty())) {
139+
this.message =
140+
this.message +
141+
" String representation of Exceptions in list.\n" +
142+
this.list.stream()
143+
.map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
144+
.collect(Collectors.joining("\n"));
145+
}
137146
return new CollectionOfErrors(this);
138147
}
139148
}

DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/dynamodb/transforms/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model;
55

66
import java.util.List;
7+
import java.util.stream.Collectors;
78

89
public class CollectionOfErrors extends RuntimeException {
910

@@ -134,6 +135,14 @@ public List<RuntimeException> list() {
134135
}
135136

136137
public CollectionOfErrors build() {
138+
if (!(this.list == null || this.list.isEmpty())) {
139+
this.message =
140+
this.message +
141+
" String representation of Exceptions in list.\n" +
142+
this.list.stream()
143+
.map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
144+
.collect(Collectors.joining("\n"));
145+
}
137146
return new CollectionOfErrors(this);
138147
}
139148
}

DynamoDbEncryption/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/dbencryptionsdk/structuredencryption/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.dbencryptionsdk.structuredencryption.model;
55

66
import java.util.List;
7+
import java.util.stream.Collectors;
78

89
public class CollectionOfErrors extends RuntimeException {
910

@@ -134,6 +135,14 @@ public List<RuntimeException> list() {
134135
}
135136

136137
public CollectionOfErrors build() {
138+
if (!(this.list == null || this.list.isEmpty())) {
139+
this.message =
140+
this.message +
141+
" String representation of Exceptions in list.\n" +
142+
this.list.stream()
143+
.map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage())
144+
.collect(Collectors.joining("\n"));
145+
}
137146
return new CollectionOfErrors(this);
138147
}
139148
}

0 commit comments

Comments
 (0)