< prev index next >

src/java.base/share/classes/com/sun/java/util/jar/pack/Constants.java

Print this page
rev 48343 : imported patch JDK-8173382-classfile-version


  31 /**
  32  * Shared constants
  33  * @author John Rose
  34  */
  35 class Constants {
  36 
  37     private Constants(){}
  38 
  39     public static final int JAVA_MAGIC = 0xCAFEBABE;
  40 
  41     /*
  42         Java Class Version numbers history
  43         1.0 to 1.3.X 45,3
  44         1.4 to 1.4.X 46,0
  45         1.5 to 1.5.X 49,0
  46         1.6 to 1.6.X 50,0
  47         1.7 to 1.7.X 51,0
  48         1.8 to 1.8.X 52,0
  49         1.9 to 1.9.X 53,0
  50         1.10 to 1.10.X 54,0

  51     */
  52 
  53     public static final Package.Version JAVA_MIN_CLASS_VERSION =
  54             Package.Version.of(45, 03);
  55 
  56     public static final Package.Version JAVA5_MAX_CLASS_VERSION =
  57             Package.Version.of(49, 00);
  58 
  59     public static final Package.Version JAVA6_MAX_CLASS_VERSION =
  60             Package.Version.of(50, 00);
  61 
  62     public static final Package.Version JAVA7_MAX_CLASS_VERSION =
  63             Package.Version.of(51, 00);
  64 
  65     public static final Package.Version JAVA8_MAX_CLASS_VERSION =
  66             Package.Version.of(52, 00);
  67 
  68     public static final Package.Version JAVA9_MAX_CLASS_VERSION =
  69             Package.Version.of(53, 00);
  70 
  71     public static final Package.Version JAVA10_MAX_CLASS_VERSION =
  72             Package.Version.of(54, 00);
  73 



  74     public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
  75 
  76     public static final Package.Version JAVA5_PACKAGE_VERSION =
  77             Package.Version.of(150, 7);
  78 
  79     public static final Package.Version JAVA6_PACKAGE_VERSION =
  80             Package.Version.of(160, 1);
  81 
  82     public static final Package.Version JAVA7_PACKAGE_VERSION =
  83             Package.Version.of(170, 1);
  84 
  85     public static final Package.Version JAVA8_PACKAGE_VERSION =
  86             Package.Version.of(171, 0);
  87 
  88     // upper limit, should point to the latest class version
  89     public static final Package.Version JAVA_MAX_CLASS_VERSION =
  90             JAVA10_MAX_CLASS_VERSION;
  91 
  92     // upper limit should point to the latest package version, for version info!.
  93     public static final Package.Version MAX_PACKAGE_VERSION =
  94             JAVA7_PACKAGE_VERSION;
  95 
  96     public static final int CONSTANT_POOL_INDEX_LIMIT  = 0x10000;
  97     public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
  98 
  99     public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
 100 
 101     public static final byte CONSTANT_Utf8 = 1;
 102     public static final byte CONSTANT_unused2 = 2;  // unused, was Unicode
 103     public static final byte CONSTANT_Integer = 3;
 104     public static final byte CONSTANT_Float = 4;
 105     public static final byte CONSTANT_Long = 5;
 106     public static final byte CONSTANT_Double = 6;
 107     public static final byte CONSTANT_Class = 7;
 108     public static final byte CONSTANT_String = 8;
 109     public static final byte CONSTANT_Fieldref = 9;
 110     public static final byte CONSTANT_Methodref = 10;




  31 /**
  32  * Shared constants
  33  * @author John Rose
  34  */
  35 class Constants {
  36 
  37     private Constants(){}
  38 
  39     public static final int JAVA_MAGIC = 0xCAFEBABE;
  40 
  41     /*
  42         Java Class Version numbers history
  43         1.0 to 1.3.X 45,3
  44         1.4 to 1.4.X 46,0
  45         1.5 to 1.5.X 49,0
  46         1.6 to 1.6.X 50,0
  47         1.7 to 1.7.X 51,0
  48         1.8 to 1.8.X 52,0
  49         1.9 to 1.9.X 53,0
  50         1.10 to 1.10.X 54,0
  51         1.11 to 1.11.X 55,0
  52     */
  53 
  54     public static final Package.Version JAVA_MIN_CLASS_VERSION =
  55             Package.Version.of(45, 03);
  56 
  57     public static final Package.Version JAVA5_MAX_CLASS_VERSION =
  58             Package.Version.of(49, 00);
  59 
  60     public static final Package.Version JAVA6_MAX_CLASS_VERSION =
  61             Package.Version.of(50, 00);
  62 
  63     public static final Package.Version JAVA7_MAX_CLASS_VERSION =
  64             Package.Version.of(51, 00);
  65 
  66     public static final Package.Version JAVA8_MAX_CLASS_VERSION =
  67             Package.Version.of(52, 00);
  68 
  69     public static final Package.Version JAVA9_MAX_CLASS_VERSION =
  70             Package.Version.of(53, 00);
  71 
  72     public static final Package.Version JAVA10_MAX_CLASS_VERSION =
  73             Package.Version.of(54, 00);
  74 
  75     public static final Package.Version JAVA11_MAX_CLASS_VERSION =
  76             Package.Version.of(55, 00);
  77 
  78     public static final int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
  79 
  80     public static final Package.Version JAVA5_PACKAGE_VERSION =
  81             Package.Version.of(150, 7);
  82 
  83     public static final Package.Version JAVA6_PACKAGE_VERSION =
  84             Package.Version.of(160, 1);
  85 
  86     public static final Package.Version JAVA7_PACKAGE_VERSION =
  87             Package.Version.of(170, 1);
  88 
  89     public static final Package.Version JAVA8_PACKAGE_VERSION =
  90             Package.Version.of(171, 0);
  91 
  92     // upper limit, should point to the latest class version
  93     public static final Package.Version JAVA_MAX_CLASS_VERSION =
  94             JAVA11_MAX_CLASS_VERSION;
  95 
  96     // upper limit should point to the latest package version, for version info!.
  97     public static final Package.Version MAX_PACKAGE_VERSION =
  98             JAVA7_PACKAGE_VERSION;
  99 
 100     public static final int CONSTANT_POOL_INDEX_LIMIT  = 0x10000;
 101     public static final int CONSTANT_POOL_NARROW_LIMIT = 0x00100;
 102 
 103     public static final String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV([";
 104 
 105     public static final byte CONSTANT_Utf8 = 1;
 106     public static final byte CONSTANT_unused2 = 2;  // unused, was Unicode
 107     public static final byte CONSTANT_Integer = 3;
 108     public static final byte CONSTANT_Float = 4;
 109     public static final byte CONSTANT_Long = 5;
 110     public static final byte CONSTANT_Double = 6;
 111     public static final byte CONSTANT_Class = 7;
 112     public static final byte CONSTANT_String = 8;
 113     public static final byte CONSTANT_Fieldref = 9;
 114     public static final byte CONSTANT_Methodref = 10;


< prev index next >