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

Fixed TimedParallelMultistarter.getSearchHistory() to return a copy #671

Merged
merged 2 commits into from
Aug 5, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Improved BlockInterchangeIterator.rollback().
* Performance improvement to LargestCommonSubgraph.
* Removed unnecessary equals() and hashCode() methods from evolutionary operators.
* Return a copy from TimedParallelMultistarter.getSearchHistory() rather than reference to field.

### Dependencies

Expand Down
7 changes: 0 additions & 7 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@
<Bug code="SECPTI,SECPTO" />
<Package name="org.cicirello.search.problems.scheduling" />
</Match>

<!-- False positive exposed representation -->
<Match>
<Bug pattern="EI_EXPOSE_REP" />
<Class name="org.cicirello.search.concurrent.TimedParallelMultistarter" />
<Method name="getSearchHistory" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public final int getTimeUnit() {
* #optimize} has not been called.
*/
public final ArrayList<SolutionCostPair<T>> getSearchHistory() {
return history;
return history == null ? null : new ArrayList<SolutionCostPair<T>>(history);
}

/**
Expand Down