src/share/native/com/sun/java/util/jar/pack/unpack.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -646,30 +646,32 @@
   hdr.init(rp, rplimit, UNSIGNED5_spec);
   minver = hdr.getInt();
   majver = hdr.getInt();
   hdrVals += 2;
 
-  int majmin[3][2] = {
+  int majmin[4][2] = {
       {JAVA5_PACKAGE_MAJOR_VERSION, JAVA5_PACKAGE_MINOR_VERSION},
       {JAVA6_PACKAGE_MAJOR_VERSION, JAVA6_PACKAGE_MINOR_VERSION},
-      {JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION}
+      {JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION},
+      {JAVA8_PACKAGE_MAJOR_VERSION, JAVA8_PACKAGE_MINOR_VERSION}
   };
   int majminfound = false;
-  for (int i = 0 ; i < 3 ; i++) {
+  for (int i = 0 ; i < 4 ; i++) {
       if (majver == majmin[i][0] && minver == majmin[i][1]) {
           majminfound = true;
           break;
       }
   }
   if (majminfound == null) {
     char message[200];
     sprintf(message, "@" ERROR_FORMAT ": magic/ver = "
-            "%08X/%d.%d should be %08X/%d.%d OR %08X/%d.%d OR %08X/%d.%d\n",
+            "%08X/%d.%d should be %08X/%d.%d OR %08X/%d.%d OR %08X/%d.%d OR %08X/%d.%d\n",
             magic, majver, minver,
             JAVA_PACKAGE_MAGIC, JAVA5_PACKAGE_MAJOR_VERSION, JAVA5_PACKAGE_MINOR_VERSION,
             JAVA_PACKAGE_MAGIC, JAVA6_PACKAGE_MAJOR_VERSION, JAVA6_PACKAGE_MINOR_VERSION,
-            JAVA_PACKAGE_MAGIC, JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION);
+            JAVA_PACKAGE_MAGIC, JAVA7_PACKAGE_MAJOR_VERSION, JAVA7_PACKAGE_MINOR_VERSION,
+            JAVA_PACKAGE_MAGIC, JAVA8_PACKAGE_MAJOR_VERSION, JAVA8_PACKAGE_MINOR_VERSION);
     abort(message);
   }
   CHECK;
 
   archive_options = hdr.getInt();

@@ -2479,10 +2481,17 @@
     ad.readBandData(X_ATTR_RuntimeInvisibleAnnotations);
     ad.readBandData(METHOD_ATTR_RuntimeVisibleParameterAnnotations);
     ad.readBandData(METHOD_ATTR_RuntimeInvisibleParameterAnnotations);
     ad.readBandData(METHOD_ATTR_AnnotationDefault);
     CHECK;
+
+    count = ad.predefCount(METHOD_ATTR_MethodParameters);
+    method_MethodParameters_NB.readData(count);
+    count = method_MethodParameters_NB.getIntTotal();
+    method_MethodParameters_name_RUN.readData(count);
+    method_MethodParameters_flag_I.readData(count);
+    CHECK;
     break;
 
   case ATTR_CONTEXT_CODE:
     // (keep this code aligned with its brother in unpacker::write_attrs)
     count = ad.predefCount(CODE_ATTR_StackMapTable);

@@ -4414,10 +4423,19 @@
         putu2(count = method_Exceptions_N.getInt());
         for (j = 0; j < count; j++) {
           putref(method_Exceptions_RC.getRefN());
         }
         break;
+
+      case ADH_BYTE(ATTR_CONTEXT_METHOD, METHOD_ATTR_MethodParameters):
+        aname = cp.sym[cpool::s_MethodParameters];
+        putu1(count = method_MethodParameters_NB.getByte());
+        for (j = 0; j < count; j++) {
+          putref(method_MethodParameters_name_RUN.getRefN());
+          putu4(method_MethodParameters_flag_I.getInt());
+        }
+        break;
 
       case ADH_BYTE(ATTR_CONTEXT_CODE, CODE_ATTR_StackMapTable):
         aname = cp.sym[cpool::s_StackMapTable];
         // (keep this code aligned with its brother in unpacker::read_attrs)
         putu2(count = code_StackMapTable_N.getInt());