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

[ENTESB-20693] Use only serializable objects in patch metadata #321

Merged
merged 1 commit into from
Jan 20, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ public void afterProjectsRead(MavenSession session) throws MavenExecutionExcepti
Map<String, Object> specData = new LinkedHashMap<>();
specData.put("groupId", spec.getGroupIdSpec());
specData.put("artifactId", spec.getArtifactIdSpec());
specData.put("versions", spec.getVersionRange());
specData.put("fix", spec.getFixVersion());
specData.put("versions", spec.getVersionRangeString());
specData.put("fix", spec.getFixVersionString());
changesData.add(specData);
}
}
Expand All @@ -292,8 +292,8 @@ public void afterProjectsRead(MavenSession session) throws MavenExecutionExcepti
Map<String, Object> specData = new LinkedHashMap<>();
specData.put("groupId", spec.getGroupIdSpec());
specData.put("artifactId", spec.getArtifactIdSpec());
specData.put("versions", spec.getVersionRange());
specData.put("fix", spec.getFixVersion());
specData.put("versions", spec.getVersionRangeString());
specData.put("fix", spec.getFixVersionString());
changesData.add(specData);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public class AffectedArtifactSpec {
private String groupIdSpec;
private String artifactIdSpec;
// TOCHECK: for now we're sticking to version ranges and no direct version
private VersionRange versionRange;
private Version fixVersion;
private transient VersionRange versionRange;
private String versionRangeString;
private transient Version fixVersion;
private String fixVersionString;

private Pattern groupIdSpecPattern;
private Pattern artifactIdSpecPattern;
private transient Pattern groupIdSpecPattern;
private transient Pattern artifactIdSpecPattern;

public boolean matches(Dependency dependency) {
String g = dependency.getGroupId();
Expand Down Expand Up @@ -89,16 +91,26 @@ public VersionRange getVersionRange() {
return versionRange;
}

public String getVersionRangeString() {
return versionRangeString;
}

public void setVersionRange(VersionRange versionRange) {
this.versionRange = versionRange;
this.versionRangeString = versionRange == null ? null : versionRange.toString();
}

public Version getFixVersion() {
return fixVersion;
}

public String getFixVersionString() {
return fixVersionString;
}

public void setFixVersion(Version fixVersion) {
this.fixVersion = fixVersion;
this.fixVersionString = fixVersion == null ? null : fixVersion.toString();
}

@Override
Expand Down