git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [EGIT PATCH 02/11] Use Set instead of array to keep track of change listeners

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Feb 5, 2009, 16:36 UTC
Message-ID
<498B159B.4040001@gmail.com>
In-Reply-To
<20090205154815.GG26880@spearce.org>
Shawn O. Pearce wrote:
Show 24 quoted lines
> Tor Arne Vestbø <torarnv@gmail.com> wrote:
>> +	public static synchronized void removeRepositoryChangeListener(
>> +			final RepositoryChangeListener objectThatCares) {
>> +		repositoryChangeListeners.remove(objectThatCares);
>>  	}
>>  
>>  	/**
>> @@ -131,13 +133,8 @@ public static synchronized void addRepositoryChangeListener(
>>  	 *            the repository which has had changes occur within it.
>>  	 */
>>  	static void fireRepositoryChanged(final RepositoryMapping which) {
>> -		final RepositoryChangeListener[] e = getRepositoryChangeListeners();
>> -		for (int k = e.length - 1; k >= 0; k--)
>> -			e[k].repositoryChanged(which);
>> -	}
>> -
>> -	private static synchronized RepositoryChangeListener[] getRepositoryChangeListeners() {
>> -		return repositoryChangeListeners;
>> +		for (RepositoryChangeListener listener : repositoryChangeListeners)
>> +			listener.repositoryChanged(which);
> 
> See anything wrong here, like that the Set can be modified while
> GitProjectData's class lock is held, but its being read here without
> any locking?
You're perfectly right. New patch coming up!
Tor Arne
Previous: Shawn O. PearceNext: Tor Arne Vestbø
Message 20 of 31 in “Support customizable label decorations”
  1. 00/11 Support customizable label decorationsTor Arne Vestbø, Feb 5, 2009
  2. 01/11 Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  3. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  4. 03/11 Add a specialized team exception for GitTor Arne Vestbø, Feb 5, 2009
  5. 04/11 Add new class ExceptionCollector for grouping exceptionsTor Arne Vestbø, Feb 5, 2009
  6. 05/11 Add new class SWTUtils with helper-methods for creating controlsTor Arne Vestbø, Feb 5, 2009
  7. 06/11 Implement basic customizable label decorations with preferencesTor Arne Vestbø, Feb 5, 2009
  8. 07/11 Add binding for name of the current branchTor Arne Vestbø, Feb 5, 2009
  9. 08/11 Add icon decoration for tracked and untracked resourcesTor Arne Vestbø, Feb 5, 2009
  10. 09/11 Implement decorations of dirty, staged, and conflicting resourcesTor Arne Vestbø, Feb 5, 2009
  11. 10/11 Don't decorate every single resource on repository changeTor Arne Vestbø, Feb 5, 2009
  12. 11/11 Implement label decorations for folders and projectsTor Arne Vestbø, Feb 5, 2009
  13. Robin RosenbergFeb 5, 2009
  14. Tor Arne VestbøFeb 5, 2009
  15. Tor Arne VestbøFeb 5, 2009
  16. Robin RosenbergFeb 5, 2009
  17. Tor Arne VestbøFeb 5, 2009
  18. Robin RosenbergFeb 5, 2009
  19. Shawn O. PearceFeb 5, 2009
  20. Tor Arne VestbøFeb 5, 2009
  21. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  22. Shawn O. PearceFeb 5, 2009
  23. Tor Arne VestbøFeb 5, 2009
  24. Shawn O. PearceFeb 5, 2009
  25. Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  26. Tor Arne VestbøFeb 5, 2009
  27. Shawn O. PearceFeb 5, 2009
  28. Tor Arne VestbøFeb 5, 2009
  29. Robin RosenbergFeb 5, 2009
  30. Tor Arne VestbøFeb 5, 2009
  31. Robin RosenbergFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.