< prev index next >

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

Print this page




  25  * @test
  26  * @bug 7157626 8001112 8188870 8173382 8193290 8205619
  27  * @summary Test major version for all legal combinations for -source and -target
  28  * @author sgoel
  29  *
  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         SIX("6", 50),
  46         SEVEN("7", 51),
  47         EIGHT("8", 52),
  48         NINE("9", 53),
  49         TEN("10", 54),
  50         ELEVEN("11", 55),
  51         TWELVE("12", 56);
  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 {




  25  * @test
  26  * @bug 7157626 8001112 8188870 8173382 8193290 8205619
  27  * @summary Test major version for all legal combinations for -source and -target
  28  * @author sgoel
  29  *
  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 {


< prev index next >