list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

W082 Conflicting Method Modifiers

Umple semantic warning when declaring state-dependent methods with different method modifiers.

This warning is shown when conflicting method modifiers are provided for state-dependent methods. The example below illustrates this scenario by marking the method 'printState' as both public and private.

Example

// The following shows how to generate the warning

class ConflictingModifiers {
  status{
    on{
      turnoff -> off;
      public void printState() {
          System.out.println("on");
      }
    }
    
    off{
      private void printState() {
          System.out.println("off");
      }
    }
  }
}

      

Load the above code into UmpleOnline