0

I having the next problem, I have a class that extends another class and implements and interface. The interface defines a method which is implemented in the extended class, with exactly the same parameters name. The thing is that Gendarme rise a violation for rule ParameterNamesShouldMatchOverriddenMethodRule, saying that the implementation hasn't the same parameters name as the interface, it is happening for all the implemented methods from the interface.

internal class classA : classB, InterfaceA
{
    //other business logic
}

public classB
{
   public bool getMethod(string param1, string param2)
   {
        //get some data and return it
   }
}

public interface InterfaceA: InterfaceB
{

}

public interface InterfaceB
{
     bool getMethod(string param1, string param2)
}

I think that maybe the hierarchy is a bit complicated and Gendarme is becoming crazy.

Thanks for your help.

Iskariote
  • 11
  • 4
  • Edit you question and add the interfaces and the classes definitions – Cleptus Mar 08 '17 at 14:45
  • Hello, sorry but they are long and complicated (core business logic) and the method is just a method which receive two strings to perform a simple get, so I think that it doesn't bring in any relevant information. – Iskariote Mar 08 '17 at 14:55
  • A reproducible sample, omiting the extra unnecesary code – Cleptus Mar 08 '17 at 14:56
  • Not sure if that's there reason behind the error or typo but method `getMethod` needs to be public in `classB`. – Chetan Mar 08 '17 at 15:41

0 Answers0