@Override
 public SourceVersion getSupportedSourceVersion() {
   // support version 6 or 7
   // we can't compile against RELEASE_6 and maintain Java 7 compatibility, but the
   // processor is Java 7-compatible. We have not tested against Java 8, however.
   SourceVersion[] versions = SourceVersion.values();
   SourceVersion v6 = SourceVersion.RELEASE_6;
   if (versions.length > v6.ordinal() + 1) {
     // the runtime supports release 7, let's use it
     return versions[v6.ordinal() + 1];
   } else {
     return v6;
   }
 }
Ejemplo n.º 2
0
 /**
  * We just return the latest version of whatever JDK we run on. Stupid? Yeah, but it's either that
  * or warnings on all versions but 1.
  */
 @Override
 public SourceVersion getSupportedSourceVersion() {
   return SourceVersion.values()[SourceVersion.values().length - 1];
 }