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.

Bug 206931

Summary: Need a way to pass action specific properties to BaseActionProvider.invokeAction()
Product: java Reporter: J Bachorik <yardus>
Component: ProjectAssignee: J Bachorik <yardus>
Status: RESOLVED WONTFIX    
Severity: normal CC: apireviews, jglick
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 7.1   
Hardware: PC   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: patch
patch(update 1) - completed the javadoc
patch(update 2) - fixed typos in arch.xml
patch(update 3)

Description J Bachorik 2012-01-05 10:11:02 UTC
While working on #203519 a need arose to pass down profiler specific action properties to the project action provider.

The easiest way would be using the context parameter of "invokeAction(command, context)" method to contain an action properties provider to mediate access of the BaseActionProvider to the action specific properties. In order to do that a new interface is introduced - "BaseActionProper.ActionPropertiesProvider".

Please, review the change.
Comment 1 J Bachorik 2012-01-05 10:20:40 UTC
Created attachment 114654 [details]
patch
Comment 2 J Bachorik 2012-01-05 12:30:43 UTC
Created attachment 114655 [details]
patch(update 1) - completed the javadoc
Comment 3 J Bachorik 2012-01-05 12:39:23 UTC
Created attachment 114658 [details]
patch(update 2) - fixed typos in arch.xml
Comment 4 Jesse Glick 2012-01-06 22:01:09 UTC
[JG01] If you try to build Javadoc with this patch, you will find that <class> may not be given a nested type.

BTW apichanges.xml <date> should be the date on which you actually integrate. It is a good idea to set this to one week from when you submit the patch, so you do not forget to update it.


[JG02] It is meaningless to mark an interface "static".


[JG03] "[implementer cannot] rely on the properties not being modified [...so] an immutable or expendable copy should be returned" contradicts itself. If they might be modified, then an immutable copy should not be returned, because the attempt to modify it will throw an exception. Make up your mind.


[JG04] Prefer Map<String,String> to Properties in API contracts which logically deal with strings, since Properties implements Map<Object,Object> and has various other undesirable qualities.


[JG05] An API review diff should normally be accompanied by at least one usage of the proposed API.
Comment 5 J Bachorik 2012-01-09 11:23:20 UTC
Created attachment 114728 [details]
patch(update 3)

Re.[JG01]
Fixed

Re. [JG02]
Adjusted

Re. [JG03]
Updated javadoc to recommend returning an expendable copy

Re. [JG04]
Changed the signature to Map<String, String>

Re. [JG05]
This one is a bit tricky - the only usage I have right now is in the work-in-progress profiler actions rewrite. The rewrite has not been finished yet and the diff of that rewrite is pretty big and spans few profiler projects. 
I might try to extract a sample usage based on the real usage in profiler if you insist.
Comment 6 Jesse Glick 2012-01-09 15:40:52 UTC
JG05 - not strictly necessary, just include a link to usage diffs if you have them.
Comment 7 J Bachorik 2012-01-27 10:11:28 UTC
This change is rendered obsolete by the work going on in #206196.

Closing as won't fix - thanks for the review anyway.