I have encountered an error while trying to execute "mvn prepare-package" for my project.
The console says
StageManager.java:[96,30] an enum switch case label must be the unqualified name of an enumeration constant
After some research on the internet, I found threads like these: Java: using switch statement with enum under subclass or Why can't an enum value be fully qualified in a switch statement? Which aren't useful for me, because I don't have the problems, which causes the exceptions in this examples. My Code looks like this:
StageManager (where the error occurs):
for (MessageType item : MessageType.values()) {
switch (item) {
case CSVImport:
//Do some magic
break;
case EOWImport: // <- Line 96 where the error occurse
//Do some magic
break;
}
}
Parts of the Enum "MessageType":
CSVImport("CSV-Import", -1, Void.class),
EOWImport("EOW-Import", -2, Void.class),
private MessageType(final String description, final int id, final Class<?> klasse) {
this.description = description;
this.id = id;
this.klasse = klasse;
}
And I don't understand, why I'm getting this error, because in my opinion, I'm doing it right.