On the radiation and diffraction of water waves by a rectangular structure with a sidewall