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

Key: RSRP-63531
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Eugene Pasynkov
Reporter: Yuri Astrakhan
Votes: 0
Watchers: 1
Operations

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

Serializable objects should not be converted to auto-properties

Created: 02 Apr 08 22:42   Updated: 25 Apr 08 22:57
Component/s: Code Cleanup
Fix Version/s: 4.0
Security Level: Everybody (All jira users)

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

Build: 767


 Description  « Hide
[Serializable]
public class Foo
{
    private string bar;
    public string Bar
    {
        get { return bar; }
        set { bar = value; }
    }
}

In the above code, Bar property is shown as it should be converted to autoproperty. The problem is that when the object is serializable, the internal variable name used for storage will be different from "bar", thus it will no longer de-serialize from storage or accross the network.

I think any object marked with either [Serializable] or [DataContract] should show a hint, not a suggestion for the conversion, otherwise it may lead to significant serialization problems.



 All   Comments   Work Log   Change History      Sort Order:
Ilya Ryzhenkov - 25 Apr 08 22:57
I think we definitly should not break the code in automatic actions, like code cleanup.