It has been the case for many years, and remains so in Notes 11.0.1, that new Java agents and script libraries have source compatibility set to Java 1.3, which prevents using many newer Java syntax features until the developer changes the project settings for the specific design element.
Some Java features, like enums and parameterized / generic types, were added in Java 1.5, which has been supported in Notes/Domino since version 8.0 released in 2007.
It's high time that the default source compatibility version for new Java agents and script libraries is updated to at least 1.5.
It would be even better if Designer could be configured to set the default source compatibility for Java agents and script libraries at a workspace or application level, allowing each developer to choose a default appropriate to the target environment. Note that Java Compiler options in Designer's workspace settings currently don't have this effect.