Skip to content
This repository has been archived by the owner. It is now read-only.

Wrong fix on RECS0063 with StartsWith #382

Open
Thieum opened this issue Nov 13, 2018 · 0 comments
Open

Wrong fix on RECS0063 with StartsWith #382

Thieum opened this issue Nov 13, 2018 · 0 comments

Comments

@Thieum
Copy link

Thieum commented Nov 13, 2018

Having this code:

query.StartsWith("select", true, CultureInfo.InvariantCulture)

RefactoringEssentials will pop a RECS0063, despite the fact that we are using Invariant Culture.

When using the fix provided, the code be will be changed to

query.StartsWith("select", true, CultureInfo.InvariantCulture, StringComparison.Ordinal)

which is not a valid call of StartsWith:

        public bool StartsWith(String value, StringComparison comparisonType);

        public bool StartsWith(String value, bool ignoreCase, CultureInfo culture);

        public bool StartsWith(String value);

We should either detect that we don't need the refactoring as we are already using InvariantCulture or switch to the String comparison version of the method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant