Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix serialization issue with new functionality #27

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ To deserialize a CodeTF file using these objects, simply deserialize with Jackso

## Gradle
```kotlin
implementation("io.codemodder:codetf-java:4.1.2")
implementation("io.codemodder:codetf-java:4.1.3")
```

## Maven
```xml
<dependency>
<groupId>io.codemodder</groupId>
<artifactId>codetf-java</artifactId>
<version>4.1.2</version>
<version>4.1.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.codemodder</groupId>
<artifactId>codetf-java</artifactId>
<version>4.1.2</version>
<version>4.1.3</version>


<name>codetf-java</name>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/io/codemodder/codetf/CodeTFResult.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.codemodder.codetf;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.*;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -68,7 +69,7 @@ public DetectionTool getDetectionTool() {
return detectionTool;
}

public Failure getFailureState() {
public Failure getFailure() {
return failure;
}

Expand Down Expand Up @@ -100,6 +101,7 @@ public boolean usesAi() {
return changeset.stream().anyMatch(CodeTFChangesetEntry::usesAi);
}

@JsonIgnore
public List<FixedFinding> getFixedFindings() {
return changeset.stream()
.map(CodeTFChangesetEntry::getChanges)
Expand Down Expand Up @@ -189,7 +191,7 @@ public CodeTFResult build() {
updatedSummary != null ? updatedSummary : originalResult.getSummary(),
updatedDescription != null ? updatedDescription : originalResult.getDescription(),
detectionTool != null ? detectionTool : originalResult.getDetectionTool(),
failure != null ? failure : originalResult.getFailureState(),
failure != null ? failure : originalResult.getFailure(),
originalResult.getFailedFiles(),
updatedReferences != null ? updatedReferences : originalResult.getReferences(),
originalResult.getProperties(),
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/codemodder/codetf/Failure.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public Failure(
this.exception = exception;
}

public String reason() {
public String getReason() {
return reason;
}

public String exception() {
public String getException() {
return exception;
}
}
4 changes: 2 additions & 2 deletions src/test/java/io/codemodder/codetf/CodeTFResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void it_has_changeset_with_ai() {
@Test
void it_has_failure_state() {
Failure state = new Failure("reason", "exception");
assertEquals("reason", state.reason());
assertEquals("exception", state.exception());
assertEquals("reason", state.getReason());
assertEquals("exception", state.getException());
}
}
Loading