2

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

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
Tadeusz Kopec for Ukraine
  • 12,283
  • 6
  • 56
  • 83

2 Answers2

2

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

McDowell
  • 107,573
  • 31
  • 204
  • 267
0

You should try setting the source and target jdk versions to pre-1.5 to get rid of those warnings. Setting source version

e.g.

          <configuration>
               <source>1.4</source>
               <target>1.4</target>
           </configuration>
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165