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 210673 - Add a method to remove item from refactoring context.
Summary: Add a method to remove item from refactoring context.
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Ralph Ruijs
Depends on:
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
Exception Reporter:

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
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.

Comment 1 Ralph Ruijs 2012-04-04 08:49:31 UTC
Created attachment 117793 [details]
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);
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