Share

jConfig

Tracker: Bugs

5 CM should not add multiple listeners to same config - ID: 1935848
Last Update: Tracker Item Submitted ( guyr )

The load method of ConfigurationManager has this:

if(configurationHandler instanceof AbstractHandler) {
((AbstractHandler)configurationHandler).addFileListener(new
ConfigurationFileListener(configurationName));
}
if (config != null) {
//config.setConfigName(configurationName);
configurations.put(configurationName, config);
handlerMapping.put(configurationName, configurationHandler);
}

Since configurations is a hashmap, if the same configuration is loaded
multiple times, one will overwrite the other. That's a good thing; you
maintain just one config of given name. However, the first condition
doesn't check for that, but blindly adds a new listener every time the load
function is called. The result is that if the load method is called 10
times for the same config, you end up with 1 config (good) but 10 listeners
(bad).


Guy Rouillier ( guyr ) - 2008-04-06 08:14

5

Open

None

Nobody/Anonymous

jConfig

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.