changeset 4918:c4129e2ec84f

8178380: Module system implementation refresh (5/2017) Reviewed-by: jjg, mchung
author alanb
date Thu, 04 May 2017 07:28:00 +0000
parents f260f1a2acf6
children b22dee7cea7d
files src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
diffstat 3 files changed, 8 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Mon Apr 24 14:59:43 2017 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Thu May 04 07:28:00 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/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java	Mon Apr 24 14:59:43 2017 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ModuleTarget_attribute.java	Thu May 04 07:28:00 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/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Mon Apr 24 14:59:43 2017 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu May 04 07:28:00 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);
         }