< prev index next >

test/langtools/tools/javac/classfiles/ClassVersionChecker.java

Print this page




  30  * @modules jdk.compiler
  31  */
  32 
  33 import java.io.*;
  34 import java.nio.*;
  35 import java.util.*;
  36 import java.util.regex.*;
  37 
  38 /*
  39  * If not explicitly specified the latest source and latest target
  40  * values are the defaults. If explicitly specified, the target value
  41  * has to be greater than or equal to the source value.
  42  */
  43 public class ClassVersionChecker {
  44     private static enum Version {
  45         SEVEN("7", 51),
  46         EIGHT("8", 52),
  47         NINE("9", 53),
  48         TEN("10", 54),
  49         ELEVEN("11", 55),
  50         TWELVE("12", 56);

  51 
  52         private Version(String release, int classFileVer) {
  53             this.release = release;
  54             this.classFileVer = classFileVer;
  55         }
  56         private final String release;
  57         private final int classFileVer;
  58 
  59         String release() {return release;}
  60         int classFileVer() {return classFileVer;}
  61     }
  62 
  63     static final Version CURRENT;
  64     static {
  65         Version[] versions = Version.values();
  66         int index = versions.length;
  67         CURRENT = versions[index - 1];
  68     }
  69 
  70     int errors;




  30  * @modules jdk.compiler
  31  */
  32 
  33 import java.io.*;
  34 import java.nio.*;
  35 import java.util.*;
  36 import java.util.regex.*;
  37 
  38 /*
  39  * If not explicitly specified the latest source and latest target
  40  * values are the defaults. If explicitly specified, the target value
  41  * has to be greater than or equal to the source value.
  42  */
  43 public class ClassVersionChecker {
  44     private static enum Version {
  45         SEVEN("7", 51),
  46         EIGHT("8", 52),
  47         NINE("9", 53),
  48         TEN("10", 54),
  49         ELEVEN("11", 55),
  50         TWELVE("12", 56),
  51         THIRTEEN("13", 57);
  52 
  53         private Version(String release, int classFileVer) {
  54             this.release = release;
  55             this.classFileVer = classFileVer;
  56         }
  57         private final String release;
  58         private final int classFileVer;
  59 
  60         String release() {return release;}
  61         int classFileVer() {return classFileVer;}
  62     }
  63 
  64     static final Version CURRENT;
  65     static {
  66         Version[] versions = Version.values();
  67         int index = versions.length;
  68         CURRENT = versions[index - 1];
  69     }
  70 
  71     int errors;


< prev index next >