Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed newly created security being added to watchlist of different file
The problem was that the posted event lacked information about the client context in which the security was created. As a result, all open watchlists were erroneously adding the security to themselves. This change addresses the issue by creating an event that includes the client context. Additionally, the change is using the already existing event code for editing an existing security. Issue: #3452 #3453 Co-authored-by: OnkelDok <90478568+OnkelDok@users.noreply.github.com> Co-authored-by: Andreas Buchen <andreas.buchen@gmail.com>
- Loading branch information
Showing
6 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
name.abuchen.portfolio/src/name/abuchen/portfolio/events/SecurityCreatedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package name.abuchen.portfolio.events; | ||
|
||
import name.abuchen.portfolio.model.Client; | ||
import name.abuchen.portfolio.model.Security; | ||
|
||
public class SecurityCreatedEvent extends ChangeEvent | ||
{ | ||
public SecurityCreatedEvent(Client client, Security security) | ||
{ | ||
super(client, security); | ||
} | ||
|
||
public Security getSecurity() | ||
{ | ||
return (Security) getSubject(); | ||
} | ||
} |