/Community

A Support Community for SubMain Products
in Search
Welcome to SubMain Community Sign in | Join | Help

BUG : RemoveUnusedLocals

Last post 07-08-2008, 12:12 AM by Serge B.. 2 replies.
Sort Posts: Previous Next
  •  07-06-2008, 4:00 PM 579

    BUG : RemoveUnusedLocals

    I have the following code :

    Public Shared Function GetDirectActionGroupsInstancesForMessageType(ByVal messageType As System.Type) As ActionGroupList

    Dim typeList As TypeList = GetDirectActionGroupTypesForMessageType(messageType)

    Dim result As ActionGroupList = typeList.ConvertToInstances(Of ActionGroup, ActionGroupList)()

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    Dim result As ActionGroupList = typeList.ConvertToInstances(Of ActionGroup, ActionGroupList)()

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    Dim typeList As TypeList = GetDirectActionGroupTypesForMessageType(messageType)

    Dim result As ActionGroupList = typeList.ConvertToInstances(Of ActionGroup, ActionGroupList)()

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    Dim result As ActionGroupList = typeList.ConvertToInstances(Of ActionGroup, ActionGroupList)()

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    result.AddIfNotNothing(GetDirectOrphanActionInstancesForMessageType(messageType, result))

    result.SortBySuggestedPriorityLevel()

    Return result

    End Function

    End Function

    CodeIt.Right suggests commenting out the first line in the method because it thinks the variable is not used.  It is clearly used on the second line of the routine.  I have a strong feeling this is a bug (maybe caused by the fact that typeList is both a local variable and a type and that there are some generic methods involved)

     

    Filed under:
  •  07-06-2008, 4:02 PM 580 in reply to 579

    Re: BUG : RemoveUnusedLocals

    By the way, I only pasted the code once and tried mending the output but there is a bug in the forum editor code as well ;-)
  •  07-08-2008, 12:12 AM 581 in reply to 580

    Re: BUG : RemoveUnusedLocals

    Hi Willy,

    Thank you for reporting the issue.

    Can you please provide me the following for troubleshooting:

     

    • TypeList class (declaration only)
    • ConvertToInstances method in TypeList class (declaration only)
    • ActionGroupList class (declaration only)
    • ActionGroup class (declaration only)

    If you can't post them in the forum, you can email the information to me at support@submain.com

    Thank you!
    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft VB MVP  |  http://vbcity.com - VB Developer Community
    » » (Static Code Analysis + Automatic Refactoring) / Painless Coding Guidelines = CodeIt.Right - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
View as RSS news feed in XML