History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-29149
Type: Bug Bug
Status: Open Open
Priority: Normal Normal
Assignee: Alexander Zverev
Reporter: James Hebben
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ReSharper

Change access modifier refactoring

Created: 28 Sep 06 16:01   Updated: 17 Mar 08 13:14
Component/s: Refactorings
Fix Version/s: Future Versions
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive Resharper263AccessModifierBug.zip (360 kb)

Issue Links:
Duplicate
 
This issue is duplicated by:
RSRP-54208 'Change accessibility' CA when applie... Normal Closed
RSRP-29228 Change access modifier for virtual me... Normal Closed
RSRP-44657 Change accessibility of all members i... Normal Closed

Build: 263


 Description  « Hide
If I have a virtual method or property, which is overridden in a number of other classes and I use the R# quickfix to change the method access modifier (E.G. public to protected), R# only changes the modifier on the virtual function, not the overrides.

This results in the code failing to compile.

FIX: When applying an access modifier to a virtual property/method also apply the change to all overrides in the solution.



 All   Comments   Work Log   Change History      Sort Order:
Andrey Simanovsky - 28 Sep 06 21:17
Do you apply the fix on a particular highlighting, or do you just use a context action?

James Hebben - 29 Sep 06 13:44
Being a keyboard freak, I use the wonderful Alt+Enter against the quickfix lightbulb and select the new access modifer.

See the attached video in Resharper263AccessModifierBug.zip


James Hebben - 29 Sep 06 13:44
Contains an htm and swf screen video of the problem

Andrey Simanovsky - 29 Sep 06 16:35
This particular context action was not planned to support changing access modifiers in hierarchy. It was supposed to give an idea of what modifiers can be used with the member.

James Hebben - 29 Sep 06 17:12
Fair enough. What is the correct R# action, assuming there is one, to take in order to achieve this refactoring?

Andrey Simanovsky - 29 Sep 06 17:32
I'm afraid, there is no way of doing that in one step at present. You can find all overrides via advanced find usages, change access modifier in base member and then look through the overrides and apply quickfix on each of them. We will consider providing a way to perform this refactoring.

Ilya Ryzhenkov - 14 Oct 07 19:34
Refactoring should be able to change access modifiers in hierarchy, warn about possible access conflicts (including "inconsistent accessibility"), and provide choice to automatically select the least possible access level.