Bug 210673 - Add a method to remove item from refactoring context.
Add a method to remove item from refactoring context.
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Refactoring
7.2
All All
: P3 (vote)
: 7.2
Assigned To: Ralph Ruijs
issues@editor
: API, API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-04 08:40 UTC by Ralph Ruijs
Modified: 2012-04-12 09:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Changes (2.66 KB, patch)
2012-04-04 08:49 UTC, Ralph Ruijs
Details | Diff
Related class (4.04 KB, text/x-java)
2012-04-04 08:50 UTC, Ralph Ruijs
Details
Updated patch (3.58 KB, patch)
2012-04-11 13:11 UTC, Ralph Ruijs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Ruijs 2012-04-04 08:40:35 UTC
Some refactoring implementations use the refactoring context to store information about the "environment" of the refactoring. A new method is needed to remove information from this context to be able to correctly refresh/reconfigure these refactorings.


The method is already in trunk, but should have been reviewed. Please review  attached patch and related class.


Thanks
Comment 1 Ralph Ruijs 2012-04-04 08:49:31 UTC
Created attachment 117793 [details]
Changes
Comment 2 Ralph Ruijs 2012-04-04 08:50:42 UTC
Created attachment 117794 [details]
Related class
Comment 3 Jesse Glick 2012-04-10 23:35:53 UTC
Context Javadoc should explain that it acts as a Map<Class,Object> keyed off the concrete implementation class of the "values", since is neither obvious nor consistent with either Set<Object> or AbstractLookup semantics.


add(...) could be simplified to:

Parameters.notNull("value", value);
remove(value.getClass());
instanceContent.add(value);
Comment 4 Ralph Ruijs 2012-04-11 13:11:10 UTC
Created attachment 118126 [details]
Updated patch

Updated the patch with Jesse's comments.


Will integrate tomorrow.
Comment 5 Jesse Glick 2012-04-11 13:43:58 UTC
BTW in Javadoc pay attention to the location of the summary sentence, boldfaced in the editor; currently it is I think

  Context contains "environment" in which the refactoring was invoked e.g.

which makes no sense. Also "Context acts as a..." looks like it is supposed to be a new paragraph but is not using <p> to indicate this. So you probably want something like

 /**
  * A context is the environment in which the refactoring was invoked.
  * For example, Java refactoring might add an instance of {@code ClasspathInfo}.
  * <p>The context acts as a {@code Map<Class,Object>} keyed off the concrete
  * implementation classes of the values.
Comment 6 Ralph Ruijs 2012-04-12 09:51:23 UTC
I updated the javadoc, thanks!

jet-main #8466634b6098


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo