Problem with existing rule - C# explicit interface implementation

33 views
Skip to first unread message

Adrian Bystrek

unread,
Sep 22, 2017, 3:41:08 AM9/22/17
to SonarQube
Hi, I've got following piece of code:

public interface IContainerAccessor
{
   
IWindsorContainer Container { get; }
}


public class WebCandidateHttpApplication : IContainerAccessor
{
   
public static IWindsorContainer Container { get; private set; }

   
IWindsorContainer IContainerAccessor.Container => Container;

   
...
}

SonarQube gives an error "Remove this unused private member." about this line:

IWindsorContainer IContainerAccessor.Container => Container;

I think it is not correct, because it is explicit interface implementation, so this property is not really private. What else - I've checked references and it's used somewhere in my project. SonarQube wrong interprets it?

Amaury Leve

unread,
Sep 22, 2017, 6:27:12 AM9/22/17
to Adrian Bystrek, SonarQube
Hi Adrian,

Which version of SonarC# are you using? Or version of SonarLint for VS if relevant.

I have tried locally with the latest version and I can't get any issue through SonarLint on your piece of code.

Cheers,
Amaury

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/6277c184-6c36-452c-a4f7-8ee5c378f85d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 
Reply all
Reply to author
Forward
0 new messages