Search code examples
javagenericsmaven-2xmlbeans

How to get rid of generics warnings in code generated from xmlbeans-maven-plugin?


I have some code generated from xsd files by xmlbeans-maven-plugin. Unfortunately generated code uses raw collection types, like:

java.util.List targetList = new java.util.ArrayList();
get_store().find_all_element_users(CURRENCY$0, targetList);
Currency[] result = new Currency[targetList.size()];
targetList.toArray(result);

which causes lots of warnings.
Is there a way to force the plugin to generate generic types or generate @SupressWarnings annotations? I use maven v 2.0.9, xmlbeans-maven-plugin v 2.3.3


Solution

  • You can probably just generate generified code using a javaSource parameter of 1.5.