Your code works perfectly with SWT 3.6.1. There is a bug report here stating that this was a problem in SWT versions <= 3.3 and was fixed in 3.4.
So, the solution would be to install a never version (ideally the current version).
Since you mentioned that you use a Maven repository, there is one for SWT 3.8 here:
maven project: SWT 3.5 dependency: any official public repo?