Project
ReSharper
Priority
Show-stopper
Type
Bug
Fix versions
4.0, 4.1
State
Fixed
Assignee
Sergey Shkredov
Subsystem
No subsystem
Affected versions
No Affected versions
Fixed in build
5.0.1612.107  
  • Created by   Mikhail Pilin
    3 years ago (05 Jun 2008 12:31)
  • Updated by   Mikhail Pilin
    3 years ago (05 Jun 2008 14:28)
  • Jira: RSRP-71192
    (history, comments)
 
RSRP-71192 Introduce variable does not work for try/catch/finally blocks
0
Issue is visible to: All Users
  The issue is visible to the selected user group only

Before

        protected static void DoDeploy(IHost host, Action<string> action)
        {
            string remotePath = host.CreateUniqueTempPath("dep");
            try
            {
                action(remotePath);
                host.Directory.Delete(remotePath, true);
            }
            catch
            {
                try
                {
                    if (host.Directory.Exists(remotePath))
                        host.Directory.Delete(remotePath, true);
                }
                catch
                {
                }
                throw;
            }
        }

After

        protected static void DoDeploy(IHost host, Action<string> action)
        {
            string remotePath = host.CreateUniqueTempPath("dep");
            try
            {
                IDirectoryControl directoryControl = host.Directory;
                {
                    action(remotePath);
                    directoryControl.Delete(remotePath, true);
                }
            }
            catch
            {
                try
                {
                    if (directoryControl.Exists(remotePath))
                        directoryControl.Delete(remotePath, true);
                }
                catch
                {
                }
                throw;
            }
        }


Issue was closed
Comments (0)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Issue has no comments