Code Analysis 'Duplicate Case' Error

4 posts, 0 answers
  1. Pat
    Pat avatar
    5 posts
    Member since:
    Jul 2011

    Posted 12 Sep 2012 Link to this post

    Why are these considered duplicate cases?


          
    static void Main(string[] args)
    {
        string m = "";
        string result = "";
        switch (m)
        {
            case @"\Z":
                result = "Escaped Z";
                break;
            case @"\Q":
                result = "Escaped Q";
                break;
            default:
                break;
        }
    }
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 17 Sep 2012 Link to this post

    Hi,

     Thanks for the feedback.
    We successfully reproduced the issue and made an item for it in our system.
    We will do our best to fix it as soon as possible.
    Meanwhile, I will suggest you to ignore the error until we fix it..
    I also added 600 Telerik points to your account as a reward for your efforts.
    Thanks.

    Kind regards,
    Zdravko
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. SHING SHUN
    SHING SHUN avatar
    3 posts
    Member since:
    Jul 2012

    Posted 20 Oct 2012 Link to this post

    is the following code duplicate case belong to same error?

    public static string EscapeXmlString(IEnumerable<char> rawString)
            {
                StringBuilder stringBuilder = new StringBuilder();
                foreach (char c in rawString)
                {
                    switch (c)
                    {
                        case '\u0009':
                            stringBuilder.Append("&#x09;");
                            break;
                        case '\u000A':
                            stringBuilder.Append("&#x0A;");
                            break;
                        case '\u000D':
                            stringBuilder.Append("&#x0D;");
                            break;
                        case '&':
                            stringBuilder.Append("&amp;");
                            break;
                        case '\'':
                            stringBuilder.Append("&apos;");
                            break;
                        case '"':
                            stringBuilder.Append("&quot;");
                            break;
                        case '<':
                            stringBuilder.Append("&lt;");
                            break;
                        case '>':
                            stringBuilder.Append("&gt;");
                            break;
                        default:
                            stringBuilder.Append(c);
                            break;
                    }
                }
                return stringBuilder.ToString();
            }
  5. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 24 Oct 2012 Link to this post

    Hello,

     Thanks for the feedback.
    It seems this case is different, because we have fixed the previous one and this is still shown as an error.
    I made a PITS item where you can track its progress and also added 600 Telerik points to your account as a reward for your efforts.
    I would recommend you to ignore the error until we fix it.
    Thanks.

    All the best,
    Zdravko
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top