Skip to content

Commit

Permalink
Add @serial annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 4, 2025
1 parent c5a8f55 commit 4de7d79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/edu/hm/hafner/coverage/ClassNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public ClassNode copy() {
*
* @return this
*/
@Serial
@SuppressFBWarnings(value = "RCN", justification = "Value might be null in old serializations")
private Object readResolve() {
if (testCases == null) {

Check warning on line 62 in src/main/java/edu/hm/hafner/coverage/ClassNode.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Partially covered line

Line 62 is only partially covered, one branch is missing

Check warning on line 62 in src/main/java/edu/hm/hafner/coverage/ClassNode.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Mutation survived

One mutation survived in line 62 (NegateConditionalsMutator)
Raw output
Survived mutations:
- negated conditional (org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/edu/hm/hafner/coverage/CoverageParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ protected void handleEmptyResults(final String fileName, final FilteredLog log)
}

/**
* Called after de-serialization to restore transient fields.
* Called after deserialization to restore transient fields.
*
* @return this
*/
@Serial
@SuppressWarnings("PMD.NullAssignment")
protected Object readResolve() {
treeStringBuilder = new TreeStringBuilder();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/hm/hafner/coverage/FileNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public String getId() {
*
* @return this
*/
@Serial
@SuppressFBWarnings(value = "RCN", justification = "Value might be null in old serializations")
private Object readResolve() {
if (relativePath == null) {

Check warning on line 104 in src/main/java/edu/hm/hafner/coverage/FileNode.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Partially covered line

Line 104 is only partially covered, one branch is missing
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/hm/hafner/coverage/MethodNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public MethodNode(final String name, final String signature, final int lineNumbe
this.lineNumber = lineNumber;
}

@Serial
@SuppressFBWarnings(value = "RCN", justification = "Value might be null in old serializations")
private Object readResolve() {
if (methodName == null) { // serialization of old versions

Check warning on line 55 in src/main/java/edu/hm/hafner/coverage/MethodNode.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Partially covered line

Line 55 is only partially covered, one branch is missing

Check warning on line 55 in src/main/java/edu/hm/hafner/coverage/MethodNode.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Mutation survived

One mutation survived in line 55 (NegateConditionalsMutator)
Raw output
Survived mutations:
- negated conditional (org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator)
Expand Down

0 comments on commit 4de7d79

Please sign in to comment.