This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Java EE projects should be able to register listeners which will be notified on DoS event.
Thank you!
Created attachment 115234 [details] the patch Denis, please prototype and verify your usage and add it to the patch if possible.
Please review.
There is a bug in the patch . Current code is (inside DeployOnSaveManager) : deployNow = toDeploy; toDeploy = new HashMap<J2eeModuleProvider, Set<Artifact>>(); // copy the listeners for (Map.Entry<J2eeModuleProvider, List<J2eeModuleProvider.DeployOnSaveListener>> entry : projectListeners.entrySet()) { if (!toDeploy.containsKey(entry.getKey())) { continue; } listeners.put(entry.getKey(), new ArrayList<J2eeModuleProvider.DeployOnSaveListener>(entry.getValue())); } toDeploy is obviously empty and check toDeploy.containsKey(entry.getKey()) has no sense. I suppose toDeploy should be changed to the deployNow : deployNow = toDeploy; toDeploy = new HashMap<J2eeModuleProvider, Set<Artifact>>(); // copy the listeners for (Map.Entry<J2eeModuleProvider, List<J2eeModuleProvider.DeployOnSaveListener>> entry : projectListeners.entrySet()) { if (!deployNow.containsKey(entry.getKey())) { continue; } listeners.put(entry.getKey(), new ArrayList<J2eeModuleProvider.DeployOnSaveListener>(entry.getValue())); } Corrected code works for me.
Yep, deployNow is right. I plan to write some test(s) anyway. I just wanted to give you a sketch soon enough. Sorry for the mistake. (In reply to comment #4) > There is a bug in the patch . > Current code is (inside DeployOnSaveManager) : > deployNow = toDeploy; > toDeploy = new HashMap<J2eeModuleProvider, Set<Artifact>>(); > > // copy the listeners > for (Map.Entry<J2eeModuleProvider, > List<J2eeModuleProvider.DeployOnSaveListener>> entry : > projectListeners.entrySet()) { > if (!toDeploy.containsKey(entry.getKey())) { > continue; > } > listeners.put(entry.getKey(), new > ArrayList<J2eeModuleProvider.DeployOnSaveListener>(entry.getValue())); > } > > toDeploy is obviously empty and check toDeploy.containsKey(entry.getKey()) > has no sense. > I suppose toDeploy should be changed to the deployNow : > > deployNow = toDeploy; > toDeploy = new HashMap<J2eeModuleProvider, Set<Artifact>>(); > > // copy the listeners > for (Map.Entry<J2eeModuleProvider, > List<J2eeModuleProvider.DeployOnSaveListener>> entry : > projectListeners.entrySet()) { > if (!deployNow.containsKey(entry.getKey())) { > continue; > } > listeners.put(entry.getKey(), new > ArrayList<J2eeModuleProvider.DeployOnSaveListener>(entry.getValue())); > } > > Corrected code works for me.
(In reply to comment #5) > Yep, deployNow is right. I plan to write some test(s) anyway. I just wanted to > give you a sketch soon enough. Sorry for the mistake. > No problem.
Thanks for the review. The patch is integrated into easel_css_72 branch and will be eventually merged to trunk together with the client.