-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Java): Improve Collection of Errors string (#1478)
- Loading branch information
Showing
9 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ test/**/Output/* | |
specification_compliance_report.html | ||
/compliance | ||
/.smithy.lsp.log | ||
|
||
# logs | ||
*.log |
27 changes: 27 additions & 0 deletions
27
DynamoDbEncryption/codegen-patches/DynamoDbEncryption/java/dafny-4.8.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 | ||
index c6f44188..c2af7d32 100644 | ||
--- 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 | ||
@@ -4,6 +4,7 @@ | ||
package software.amazon.cryptography.dbencryptionsdk.dynamodb.model; | ||
|
||
import java.util.List; | ||
+import java.util.stream.Collectors; | ||
|
||
public class CollectionOfErrors extends RuntimeException { | ||
|
||
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException { | ||
} | ||
|
||
public CollectionOfErrors build() { | ||
+ if (!(this.list == null || this.list.isEmpty())) { | ||
+ this.message = | ||
+ this.message + | ||
+ " String representation of Exceptions in list.\n" + | ||
+ this.list.stream() | ||
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage()) | ||
+ .collect(Collectors.joining("\n")); | ||
+ } | ||
return new CollectionOfErrors(this); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
DynamoDbEncryption/codegen-patches/DynamoDbEncryptionTransforms/java/dafny-4.8.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 | ||
index 7a2ca9b0..db01d961 100644 | ||
--- 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 | ||
@@ -4,6 +4,7 @@ | ||
package software.amazon.cryptography.dbencryptionsdk.dynamodb.transforms.model; | ||
|
||
import java.util.List; | ||
+import java.util.stream.Collectors; | ||
|
||
public class CollectionOfErrors extends RuntimeException { | ||
|
||
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException { | ||
} | ||
|
||
public CollectionOfErrors build() { | ||
+ if (!(this.list == null || this.list.isEmpty())) { | ||
+ this.message = | ||
+ this.message + | ||
+ " String representation of Exceptions in list.\n" + | ||
+ this.list.stream() | ||
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage()) | ||
+ .collect(Collectors.joining("\n")); | ||
+ } | ||
return new CollectionOfErrors(this); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
DynamoDbEncryption/codegen-patches/DynamoDbItemEncryptor/java/dafny-4.8.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 | ||
index 1bb59f8f..19928c23 100644 | ||
--- 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 | ||
@@ -4,6 +4,7 @@ | ||
package software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.model; | ||
|
||
import java.util.List; | ||
+import java.util.stream.Collectors; | ||
|
||
public class CollectionOfErrors extends RuntimeException { | ||
|
||
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException { | ||
} | ||
|
||
public CollectionOfErrors build() { | ||
+ if (!(this.list == null || this.list.isEmpty())) { | ||
+ this.message = | ||
+ this.message + | ||
+ " String representation of Exceptions in list.\n" + | ||
+ this.list.stream() | ||
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage()) | ||
+ .collect(Collectors.joining("\n")); | ||
+ } | ||
return new CollectionOfErrors(this); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
DynamoDbEncryption/codegen-patches/StructuredEncryption/java/dafny-4.8.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 | ||
index a4d45a55..a6c2fc43 100644 | ||
--- 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 | ||
@@ -4,6 +4,7 @@ | ||
package software.amazon.cryptography.dbencryptionsdk.structuredencryption.model; | ||
|
||
import java.util.List; | ||
+import java.util.stream.Collectors; | ||
|
||
public class CollectionOfErrors extends RuntimeException { | ||
|
||
@@ -134,6 +135,14 @@ public class CollectionOfErrors extends RuntimeException { | ||
} | ||
|
||
public CollectionOfErrors build() { | ||
+ if (!(this.list == null || this.list.isEmpty())) { | ||
+ this.message = | ||
+ this.message + | ||
+ " String representation of Exceptions in list.\n" + | ||
+ this.list.stream() | ||
+ .map(ex -> ex.getClass().getSimpleName() + ": " + ex.getMessage()) | ||
+ .collect(Collectors.joining("\n")); | ||
+ } | ||
return new CollectionOfErrors(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters