Skip to content

Commit

Permalink
Merge pull request #3051 from nscuro/fix-transient-fields-jsonignore
Browse files Browse the repository at this point in the history
Fix `@JsonIgnore` having no effect on `transient` fields
  • Loading branch information
nscuro authored Sep 23, 2023
2 parents ec6b704 + 9ca5f79 commit fb28926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/dependencytrack/model/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,8 @@ public enum FetchGroup {
private transient DependencyMetrics metrics;
private transient RepositoryMetaComponent repositoryMeta;
private transient int usedBy;

@JsonIgnore
private transient JsonObject cacheResult;

private transient Set<String> dependencyGraph;

private transient boolean expandDependencyGraph;

public long getId() {
Expand Down Expand Up @@ -778,10 +774,12 @@ public void setUsedBy(int usedBy) {
this.usedBy = usedBy;
}

@JsonIgnore
public JsonObject getCacheResult() {
return cacheResult;
}

@JsonIgnore
public void setCacheResult(JsonObject cacheResult) {
this.cacheResult = cacheResult;
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/dependencytrack/model/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,7 @@ public enum FetchGroup {
private List<ExternalReference> externalReferences;

private transient ProjectMetrics metrics;

private transient List<ProjectVersion> versions;

@JsonIgnore
private transient List<Component> dependencyGraph;

public long getId() {
Expand Down Expand Up @@ -484,10 +481,12 @@ public void addAccessTeam(Team accessTeam) {
this.accessTeams.add(accessTeam);
}

@JsonIgnore
public List<Component> getDependencyGraph() {
return dependencyGraph;
}

@JsonIgnore
public void setDependencyGraph(List<Component> dependencyGraph) {
this.dependencyGraph = dependencyGraph;
}
Expand Down

0 comments on commit fb28926

Please sign in to comment.