changeset 4288:58e13c1ee886

Rename ConcealedPackages to Packages
author alanb
date Wed, 07 Sep 2016 17:21:13 +0100
parents d26b4bb63771
children a1502e7ec4f9
files src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConcealedPackages_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/classfile/Packages_attribute.java src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java test/lib/annotations/annotations/classfile/ClassfileInspector.java test/tools/javac/MethodParameters/AttributeVisitor.java
diffstat 7 files changed, 84 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java	Wed Sep 07 15:24:07 2016 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java	Wed Sep 07 17:21:13 2016 +0100
@@ -42,7 +42,6 @@
     public static final String BootstrapMethods         = "BootstrapMethods";
     public static final String CharacterRangeTable      = "CharacterRangeTable";
     public static final String Code                     = "Code";
-    public static final String ConcealedPackages        = "ConcealedPackages";
     public static final String ConstantValue            = "ConstantValue";
     public static final String CompilationID            = "CompilationID";
     public static final String Deprecated               = "Deprecated";
@@ -56,6 +55,7 @@
     public static final String MainClass                = "MainClass";
     public static final String MethodParameters         = "MethodParameters";
     public static final String Module                   = "Module";
+    public static final String Packages                 = "Packages";
     public static final String RuntimeVisibleAnnotations = "RuntimeVisibleAnnotations";
     public static final String RuntimeInvisibleAnnotations = "RuntimeInvisibleAnnotations";
     public static final String RuntimeVisibleParameterAnnotations = "RuntimeVisibleParameterAnnotations";
@@ -115,7 +115,6 @@
             standardAttributes.put(CharacterRangeTable, CharacterRangeTable_attribute.class);
             standardAttributes.put(Code,              Code_attribute.class);
             standardAttributes.put(CompilationID,     CompilationID_attribute.class);
-            standardAttributes.put(ConcealedPackages, ConcealedPackages_attribute.class);
             standardAttributes.put(ConstantValue,     ConstantValue_attribute.class);
             standardAttributes.put(Deprecated,        Deprecated_attribute.class);
             standardAttributes.put(EnclosingMethod,   EnclosingMethod_attribute.class);
@@ -128,6 +127,7 @@
             standardAttributes.put(MainClass,         MainClass_attribute.class);
             standardAttributes.put(MethodParameters,  MethodParameters_attribute.class);
             standardAttributes.put(Module,            Module_attribute.class);
+            standardAttributes.put(Packages,          Packages_attribute.class);
             standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class);
             standardAttributes.put(RuntimeInvisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations_attribute.class);
             standardAttributes.put(RuntimeVisibleAnnotations, RuntimeVisibleAnnotations_attribute.class);
@@ -178,7 +178,6 @@
         R visitCharacterRangeTable(CharacterRangeTable_attribute attr, P p);
         R visitCode(Code_attribute attr, P p);
         R visitCompilationID(CompilationID_attribute attr, P p);
-        R visitConcealedPackages(ConcealedPackages_attribute attr, P p);
         R visitConstantValue(ConstantValue_attribute attr, P p);
         R visitDeprecated(Deprecated_attribute attr, P p);
         R visitEnclosingMethod(EnclosingMethod_attribute attr, P p);
@@ -191,6 +190,7 @@
         R visitMainClass(MainClass_attribute attr, P p);
         R visitMethodParameters(MethodParameters_attribute attr, P p);
         R visitModule(Module_attribute attr, P p);
+        R visitPackages(Packages_attribute attr, P p);
         R visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, P p);
         R visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, P p);
         R visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, P p);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Wed Sep 07 15:24:07 2016 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java	Wed Sep 07 17:21:13 2016 +0100
@@ -419,7 +419,7 @@
         }
 
         @Override
-        public Void visitConcealedPackages(ConcealedPackages_attribute attr, ClassOutputStream out) {
+        public Void visitPackages(Packages_attribute attr, ClassOutputStream out) {
             out.writeShort(attr.packages_count);
             for (int i: attr.packages_index)
                 out.writeShort(i);
--- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ConcealedPackages_attribute.java	Wed Sep 07 15:24:07 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2015, 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
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.classfile;
-
-import java.io.IOException;
-
-/**
- * See JVMS, section 4.8.15.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public class ConcealedPackages_attribute extends Attribute {
-    ConcealedPackages_attribute(ClassReader cr, int name_index, int length)
-            throws IOException {
-        super(name_index, length);
-        packages_count = cr.readUnsignedShort();
-        packages_index = new int[packages_count];
-        for (int i = 0; i < packages_count; i++)
-            packages_index[i] = cr.readUnsignedShort();
-    }
-
-    public ConcealedPackages_attribute(ConstantPool constant_pool,
-                                       int[] packages_index)
-            throws ConstantPoolException {
-        this(constant_pool.getUTF8Index(Attribute.ConcealedPackages),
-             packages_index);
-    }
-
-    public ConcealedPackages_attribute(int name_index,
-                                       int[] packages_index) {
-        super(name_index, 2 + packages_index.length * 2);
-        this.packages_count = packages_index.length;
-        this.packages_index = packages_index;
-    }
-
-    public String getPackage(int index, ConstantPool constant_pool) throws ConstantPoolException {
-        int package_index = packages_index[index];
-        return constant_pool.getUTF8Value(package_index);
-    }
-
-    @Override
-    public <R, D> R accept(Visitor<R, D> visitor, D data) {
-        return visitor.visitConcealedPackages(this, data);
-    }
-
-    public final int packages_count;
-    public final int[] packages_index;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Packages_attribute.java	Wed Sep 07 17:21:13 2016 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.classfile;
+
+import java.io.IOException;
+
+/**
+ * See JVMS, section 4.8.15.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class Packages_attribute extends Attribute {
+    Packages_attribute(ClassReader cr, int name_index, int length)
+            throws IOException {
+        super(name_index, length);
+        packages_count = cr.readUnsignedShort();
+        packages_index = new int[packages_count];
+        for (int i = 0; i < packages_count; i++)
+            packages_index[i] = cr.readUnsignedShort();
+    }
+
+    public Packages_attribute(ConstantPool constant_pool,
+                              int[] packages_index)
+            throws ConstantPoolException {
+        this(constant_pool.getUTF8Index(Attribute.Packages),
+             packages_index);
+    }
+
+    public Packages_attribute(int name_index,
+                              int[] packages_index) {
+        super(name_index, 2 + packages_index.length * 2);
+        this.packages_count = packages_index.length;
+        this.packages_index = packages_index;
+    }
+
+    public String getPackage(int index, ConstantPool constant_pool) throws ConstantPoolException {
+        int package_index = packages_index[index];
+        return constant_pool.getUTF8Value(package_index);
+    }
+
+    @Override
+    public <R, D> R accept(Visitor<R, D> visitor, D data) {
+        return visitor.visitPackages(this, data);
+    }
+
+    public final int packages_count;
+    public final int[] packages_index;
+}
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Sep 07 15:24:07 2016 +0200
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Sep 07 17:21:13 2016 +0100
@@ -34,7 +34,6 @@
 import com.sun.tools.classfile.CharacterRangeTable_attribute.Entry;
 import com.sun.tools.classfile.Code_attribute;
 import com.sun.tools.classfile.CompilationID_attribute;
-import com.sun.tools.classfile.ConcealedPackages_attribute;
 import com.sun.tools.classfile.ConstantPool;
 import com.sun.tools.classfile.ConstantPoolException;
 import com.sun.tools.classfile.ConstantValue_attribute;
@@ -51,6 +50,7 @@
 import com.sun.tools.classfile.MainClass_attribute;
 import com.sun.tools.classfile.MethodParameters_attribute;
 import com.sun.tools.classfile.Module_attribute;
+import com.sun.tools.classfile.Packages_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute;
@@ -237,7 +237,7 @@
         return null;
     }
 
-    private String getJavaPackage(ConcealedPackages_attribute attr, int index) {
+    private String getJavaPackage(Packages_attribute attr, int index) {
         try {
             return getJavaName(attr.getPackage(index, constant_pool));
         } catch (ConstantPoolException e) {
@@ -246,8 +246,8 @@
     }
 
     @Override
-    public Void visitConcealedPackages(ConcealedPackages_attribute attr, Void ignore) {
-        println("ConcealedPackages: ");
+    public Void visitPackages(Packages_attribute attr, Void ignore) {
+        println("Packages: ");
         indent(+1);
         for (int i = 0; i < attr.packages_count; i++) {
             print("#" + attr.packages_index[i]);
--- a/test/lib/annotations/annotations/classfile/ClassfileInspector.java	Wed Sep 07 15:24:07 2016 +0200
+++ b/test/lib/annotations/annotations/classfile/ClassfileInspector.java	Wed Sep 07 17:21:13 2016 +0100
@@ -1188,7 +1188,7 @@
         }
 
         @Override
-        public Void visitConcealedPackages(ConcealedPackages_attribute attr, T p) {
+        public Void visitPackages(Packages_attribute attr, T p) {
             return null;
         }
 
--- a/test/tools/javac/MethodParameters/AttributeVisitor.java	Wed Sep 07 15:24:07 2016 +0200
+++ b/test/tools/javac/MethodParameters/AttributeVisitor.java	Wed Sep 07 17:21:13 2016 +0100
@@ -34,7 +34,6 @@
     public R visitCharacterRangeTable(CharacterRangeTable_attribute attr, P p) { return null; }
     public R visitCode(Code_attribute attr, P p) { return null; }
     public R visitCompilationID(CompilationID_attribute attr, P p) { return null; }
-    public R visitConcealedPackages(ConcealedPackages_attribute attr, P p) { return null; }
     public R visitConstantValue(ConstantValue_attribute attr, P p) { return null; }
     public R visitDeprecated(Deprecated_attribute attr, P p) { return null; }
     public R visitEnclosingMethod(EnclosingMethod_attribute attr, P p) { return null; }
@@ -47,6 +46,7 @@
     public R visitMainClass(MainClass_attribute attr, P p) { return null; }
     public R visitMethodParameters(MethodParameters_attribute attr, P p) { return null; }
     public R visitModule(Module_attribute attr, P p) { return null; }
+    public R visitPackages(Packages_attribute attr, P p) { return null; }
     public R visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, P p) { return null; }
     public R visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, P p) { return null; }
     public R visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, P p) { return null; }