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

Key: RSRP-45656
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Ilya Ryzhenkov
Reporter: Andrew Serebryansky
Votes: 1
Watchers: 0
Operations

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

'Check for null or empty' context action for string parameters

Created: 17 Jul 07 12:46   Updated: 13 Mar 08 22:38
Component/s: Generate Action
Fix Version/s: 4.0
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Consider the following method.

public FolderProperty GetFolderProperty(Guid folderId, string propertyName)
{
// some code
}

Resharper suggests to check if propertyName != null, and when applied looks as follows:

public FolderProperty GetFolderProperty(Guid folderId, string propertyName)
{
if (propertyName == null)
{
throw new ArgumentNullException("propertyName");
}
// some code
}

However, since its a string, I would actually like to check if its null or empty. Can Resharper suggest both "check if propertyName is null" and "check if propertyName is null or empty". When the second one is selected, the following gets generated:

public FolderProperty GetFolderProperty(Guid folderId, string propertyName)
{
if (string.IsNullOrEmpty(propertyName))
{
throw new ArgumentNullException("propertyName");
}
}



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.