Skip to content

Commit 9e195a1

Browse files
authored
fix(Java): Improve Collection of Errors string (#1056)
1 parent 1169bc8 commit 9e195a1

File tree

8 files changed

+144
-0
lines changed

8 files changed

+144
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java a/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java
2+
index 796adaa3e..be9fd9100 100644
3+
--- b/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java
4+
+++ a/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.materialproviders.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/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java a/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java
2+
index 9247dd55f..b98c91f23 100644
3+
--- b/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java
4+
+++ a/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.keystore.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+
}

AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.keystore.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
}

AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.materialproviders.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
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/CollectionOfErrors.java a/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/CollectionOfErrors.java
2+
index 7ba6ce4a4..06df95868 100644
3+
--- b/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/CollectionOfErrors.java
4+
+++ a/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.primitives.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+
}

AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.primitives.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
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git b/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java a/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java
2+
index c8bb5b93a..97013b1f5 100644
3+
--- b/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java
4+
+++ a/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java
5+
@@ -4,6 +4,7 @@
6+
package software.amazon.cryptography.materialproviderstestvectorkeys.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+
}

TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package software.amazon.cryptography.materialproviderstestvectorkeys.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)