Update CanvasController.java

replaced elsif ladder with switch