Merge
authorlana
Thu, 04 May 2017 17:55:07 +0000
changeset 45043 12f05bc91ecd
parent 44977 01b4a58561f6 (current diff)
parent 45042 23c0d9bcaa53 (diff)
child 45044 7c50549b7744
Merge
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu May 04 16:38:10 2017 +0000
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu May 04 17:55:07 2017 +0000
@@ -616,8 +616,7 @@
 
         @Override
         public Void visitModuleTarget(ModuleTarget_attribute attr, ClassOutputStream out) {
-            out.writeShort(attr.os_name_index);
-            out.writeShort(attr.os_arch_index);
+            out.writeShort(attr.target_platform_index);
             return null;
         }
 
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java	Thu May 04 16:38:10 2017 +0000
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java	Thu May 04 17:55:07 2017 +0000
@@ -38,8 +38,7 @@
 public class ModuleTarget_attribute extends Attribute {
     ModuleTarget_attribute(ClassReader cr, int name_index, int length) throws IOException {
         super(name_index, length);
-        os_name_index = cr.readUnsignedShort();
-        os_arch_index = cr.readUnsignedShort();
+        target_platform_index = cr.readUnsignedShort();
     }
 
     @Override
@@ -47,6 +46,5 @@
         return visitor.visitModuleTarget(this, data);
     }
 
-    public final int os_name_index;
-    public final int os_arch_index;
+    public final int target_platform_index;
 }
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu May 04 16:38:10 2017 +0000
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu May 04 17:55:07 2017 +0000
@@ -668,33 +668,19 @@
     public Void visitModuleTarget(ModuleTarget_attribute attr, Void ignore) {
         println("ModuleTarget:");
         indent(+1);
-        print("os_name: #" + attr.os_name_index);
-        if (attr.os_name_index != 0) {
+        print("target_platform: #" + attr.target_platform_index);
+        if (attr.target_platform_index != 0) {
             tab();
-            print("// " + getOSName(attr));
-        }
-        println();
-        print("os_arch: #" + attr.os_arch_index);
-        if (attr.os_arch_index != 0) {
-            tab();
-            print("// " + getOSArch(attr));
+            print("// " + getTargetPlatform(attr));
         }
         println();
         indent(-1);
         return null;
     }
 
-    private String getOSName(ModuleTarget_attribute attr) {
+    private String getTargetPlatform(ModuleTarget_attribute attr) {
         try {
-            return constant_pool.getUTF8Value(attr.os_name_index);
-        } catch (ConstantPoolException e) {
-            return report(e);
-        }
-    }
-
-    private String getOSArch(ModuleTarget_attribute attr) {
-        try {
-            return constant_pool.getUTF8Value(attr.os_arch_index);
+            return constant_pool.getUTF8Value(attr.target_platform_index);
         } catch (ConstantPoolException e) {
             return report(e);
         }