-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Avoid NPEs on creating events
When creating trace event format events, the code used to throw NullPointerExceptions when trying to construct an event from a JsonObject that was missing required members. This change adds static `fromJson` methods, which check the members exist, or otherwise throw an IllegalArgumentException. It also adds some basic tests for the Event classes. Signed-off-by: Sara Adams <sara.e.adams@gmail.com>
- Loading branch information
Showing
9 changed files
with
396 additions
and
22 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
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
12 changes: 12 additions & 0 deletions
12
analyzer/javatests/com/engflow/bazel/invocation/analyzer/traceeventformat/BUILD
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,12 @@ | ||
java_test( | ||
name = "traceeventformat", | ||
srcs = glob(["**/*.java"]), | ||
test_class = "com.engflow.bazel.invocation.analyzer.traceeventformat.TraceEventFormatTestSuite", | ||
deps = [ | ||
"//analyzer/java/com/engflow/bazel/invocation/analyzer/time", | ||
"//analyzer/java/com/engflow/bazel/invocation/analyzer/traceeventformat", | ||
"//third_party/gson", | ||
"//third_party/junit", | ||
"//third_party/truth", | ||
], | ||
) |
Oops, something went wrong.