Tue, 17 Nov 2009 10:35:52 -0800
Merge
src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/classfile/Module_attribute.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/classes/com/sun/tools/classfile/Attribute.java Thu Nov 12 15:36:01 2009 -0800 1.2 +++ b/src/share/classes/com/sun/tools/classfile/Attribute.java Tue Nov 17 10:35:52 2009 -0800 1.3 @@ -64,11 +64,6 @@ 1.4 public static final String StackMapTable = "StackMapTable"; 1.5 public static final String Synthetic = "Synthetic"; 1.6 1.7 - // JSR 277/294 1.8 - public static final String Module = "Module"; 1.9 - public static final String ModuleExportTable = "ModuleExportTable"; 1.10 - public static final String ModuleMemberTable = "ModuleMemberTable"; 1.11 - 1.12 public static class Factory { 1.13 public Factory() { 1.14 // defer init of standardAttributeClasses until after options set up 1.15 @@ -78,10 +73,6 @@ 1.16 this.compat = compat; 1.17 } 1.18 1.19 - public void setJSR277(boolean jsr277) { 1.20 - this.jsr277 = jsr277; 1.21 - } 1.22 - 1.23 public Attribute createAttribute(ClassReader cr, int name_index, byte[] data) 1.24 throws IOException { 1.25 if (standardAttributes == null) 1.26 @@ -121,12 +112,6 @@ 1.27 standardAttributes.put(LocalVariableTable, LocalVariableTable_attribute.class); 1.28 standardAttributes.put(LocalVariableTypeTable, LocalVariableTypeTable_attribute.class); 1.29 1.30 - if (jsr277) { 1.31 - standardAttributes.put(Module, Module_attribute.class); 1.32 - standardAttributes.put(ModuleExportTable, ModuleExportTable_attribute.class); 1.33 - standardAttributes.put(ModuleMemberTable, ModuleMemberTable_attribute.class); 1.34 - } 1.35 - 1.36 if (!compat) { // old javap does not recognize recent attributes 1.37 standardAttributes.put(CompilationID, CompilationID_attribute.class); 1.38 standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class); 1.39 @@ -148,7 +133,6 @@ 1.40 1.41 private Map<String,Class<? extends Attribute>> standardAttributes; 1.42 private boolean compat; // don't support recent attrs in compatibility mode 1.43 - private boolean jsr277; // support new jsr277 attrs 1.44 } 1.45 1.46 public static Attribute read(ClassReader cr) throws IOException { 1.47 @@ -201,9 +185,5 @@ 1.48 R visitStackMap(StackMap_attribute attr, P p); 1.49 R visitStackMapTable(StackMapTable_attribute attr, P p); 1.50 R visitSynthetic(Synthetic_attribute attr, P p); 1.51 - 1.52 - R visitModule(Module_attribute attr, P p); 1.53 - R visitModuleExportTable(ModuleExportTable_attribute attr, P p); 1.54 - R visitModuleMemberTable(ModuleMemberTable_attribute attr, P p); 1.55 } 1.56 }
2.1 --- a/src/share/classes/com/sun/tools/classfile/ClassWriter.java Thu Nov 12 15:36:01 2009 -0800 2.2 +++ b/src/share/classes/com/sun/tools/classfile/ClassWriter.java Tue Nov 17 10:35:52 2009 -0800 2.3 @@ -449,25 +449,6 @@ 2.4 out.writeShort(entry.index); 2.5 } 2.6 2.7 - public Void visitModule(Module_attribute attr, ClassOutputStream out) { 2.8 - out.writeShort(attr.module_name); 2.9 - return null; 2.10 - } 2.11 - 2.12 - public Void visitModuleExportTable(ModuleExportTable_attribute attr, ClassOutputStream out) { 2.13 - out.writeShort(attr.export_type_table.length); 2.14 - for (int i: attr.export_type_table) 2.15 - out.writeShort(i); 2.16 - return null; 2.17 - } 2.18 - 2.19 - public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, ClassOutputStream out) { 2.20 - out.writeShort(attr.package_member_table.length); 2.21 - for (int i: attr.package_member_table) 2.22 - out.writeShort(i); 2.23 - return null; 2.24 - } 2.25 - 2.26 public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, ClassOutputStream out) { 2.27 annotationWriter.write(attr.annotations, out); 2.28 return null;
3.1 --- a/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java Thu Nov 12 15:36:01 2009 -0800 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,70 +0,0 @@ 3.4 -/* 3.5 - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 3.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 - * 3.8 - * This code is free software; you can redistribute it and/or modify it 3.9 - * under the terms of the GNU General Public License version 2 only, as 3.10 - * published by the Free Software Foundation. Sun designates this 3.11 - * particular file as subject to the "Classpath" exception as provided 3.12 - * by Sun in the LICENSE file that accompanied this code. 3.13 - * 3.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 3.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.17 - * version 2 for more details (a copy is included in the LICENSE file that 3.18 - * accompanied this code). 3.19 - * 3.20 - * You should have received a copy of the GNU General Public License version 3.21 - * 2 along with this work; if not, write to the Free Software Foundation, 3.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.23 - * 3.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 3.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 3.26 - * have any questions. 3.27 - */ 3.28 - 3.29 -package com.sun.tools.classfile; 3.30 - 3.31 -import java.io.IOException; 3.32 - 3.33 -/** 3.34 - * See JSR 277. 3.35 - * 3.36 - * <p><b>This is NOT part of any API supported by Sun Microsystems. If 3.37 - * you write code that depends on this, you do so at your own risk. 3.38 - * This code and its internal interfaces are subject to change or 3.39 - * deletion without notice.</b> 3.40 - */ 3.41 -public class ModuleExportTable_attribute extends Attribute { 3.42 - ModuleExportTable_attribute(ClassReader cr, int name_index, int length) throws IOException { 3.43 - super(name_index, length); 3.44 - int export_type_length = cr.readUnsignedShort(); 3.45 - export_type_table = new int[export_type_length]; 3.46 - for (int i = 0; i < export_type_table.length; i++) 3.47 - export_type_table[i] = cr.readUnsignedShort(); 3.48 - } 3.49 - 3.50 - public ModuleExportTable_attribute(ConstantPool cp, int[] export_type_table) 3.51 - throws ConstantPoolException { 3.52 - this(cp.getUTF8Index(Attribute.ModuleExportTable), export_type_table); 3.53 - } 3.54 - 3.55 - public ModuleExportTable_attribute(int name_index, int[] export_type_table) { 3.56 - super(name_index, 2 + 2 * export_type_table.length); 3.57 - this.export_type_table = export_type_table; 3.58 - } 3.59 - 3.60 - public int getExportTypeCount() { 3.61 - return export_type_table.length; 3.62 - } 3.63 - 3.64 - public String getExportTypeName(int index, ConstantPool constant_pool) throws ConstantPoolException { 3.65 - return constant_pool.getUTF8Value(export_type_table[index]); 3.66 - } 3.67 - 3.68 - public <R, P> R accept(Visitor<R, P> visitor, P p) { 3.69 - return visitor.visitModuleExportTable(this, p); 3.70 - } 3.71 - 3.72 - public final int[] export_type_table; 3.73 -}
4.1 --- a/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java Thu Nov 12 15:36:01 2009 -0800 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,69 +0,0 @@ 4.4 -/* 4.5 - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 4.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.7 - * 4.8 - * This code is free software; you can redistribute it and/or modify it 4.9 - * under the terms of the GNU General Public License version 2 only, as 4.10 - * published by the Free Software Foundation. Sun designates this 4.11 - * particular file as subject to the "Classpath" exception as provided 4.12 - * by Sun in the LICENSE file that accompanied this code. 4.13 - * 4.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 4.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4.17 - * version 2 for more details (a copy is included in the LICENSE file that 4.18 - * accompanied this code). 4.19 - * 4.20 - * You should have received a copy of the GNU General Public License version 4.21 - * 2 along with this work; if not, write to the Free Software Foundation, 4.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4.23 - * 4.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 4.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 4.26 - * have any questions. 4.27 - */ 4.28 -package com.sun.tools.classfile; 4.29 - 4.30 -import java.io.IOException; 4.31 - 4.32 -/** 4.33 - * See JSR 277. 4.34 - * 4.35 - * <p><b>This is NOT part of any API supported by Sun Microsystems. If 4.36 - * you write code that depends on this, you do so at your own risk. 4.37 - * This code and its internal interfaces are subject to change or 4.38 - * deletion without notice.</b> 4.39 - */ 4.40 -public class ModuleMemberTable_attribute extends Attribute { 4.41 - ModuleMemberTable_attribute(ClassReader cr, int name_index, int length) throws IOException { 4.42 - super(name_index, length); 4.43 - int package_member_length = cr.readUnsignedShort(); 4.44 - package_member_table = new int[package_member_length]; 4.45 - for (int i = 0; i < package_member_table.length; i++) 4.46 - package_member_table[i] = cr.readUnsignedShort(); 4.47 - } 4.48 - 4.49 - public ModuleMemberTable_attribute(ConstantPool cp, int[] package_member_table) 4.50 - throws ConstantPoolException { 4.51 - this(cp.getUTF8Index(Attribute.ModuleMemberTable), package_member_table); 4.52 - } 4.53 - 4.54 - public ModuleMemberTable_attribute(int name_index, int[] package_member_table) { 4.55 - super(name_index, 2 + 2 * package_member_table.length); 4.56 - this.package_member_table = package_member_table; 4.57 - } 4.58 - 4.59 - public int getPackageMemberCount() { 4.60 - return package_member_table.length; 4.61 - } 4.62 - 4.63 - public String getPackageMemberName(int index, ConstantPool constant_pool) throws ConstantPoolException { 4.64 - return constant_pool.getUTF8Value(package_member_table[index]); 4.65 - } 4.66 - 4.67 - public <R, P> R accept(Visitor<R, P> visitor, P p) { 4.68 - return visitor.visitModuleMemberTable(this, p); 4.69 - } 4.70 - 4.71 - public final int[] package_member_table; 4.72 -}
5.1 --- a/src/share/classes/com/sun/tools/classfile/Module_attribute.java Thu Nov 12 15:36:01 2009 -0800 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,64 +0,0 @@ 5.4 -/* 5.5 - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 5.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.7 - * 5.8 - * This code is free software; you can redistribute it and/or modify it 5.9 - * under the terms of the GNU General Public License version 2 only, as 5.10 - * published by the Free Software Foundation. Sun designates this 5.11 - * particular file as subject to the "Classpath" exception as provided 5.12 - * by Sun in the LICENSE file that accompanied this code. 5.13 - * 5.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 5.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5.17 - * version 2 for more details (a copy is included in the LICENSE file that 5.18 - * accompanied this code). 5.19 - * 5.20 - * You should have received a copy of the GNU General Public License version 5.21 - * 2 along with this work; if not, write to the Free Software Foundation, 5.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.23 - * 5.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 5.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 5.26 - * have any questions. 5.27 - */ 5.28 - 5.29 -package com.sun.tools.classfile; 5.30 - 5.31 -import java.io.IOException; 5.32 - 5.33 -/** 5.34 - * See JSR 277. 5.35 - * 5.36 - * <p><b>This is NOT part of any API supported by Sun Microsystems. If 5.37 - * you write code that depends on this, you do so at your own risk. 5.38 - * This code and its internal interfaces are subject to change or 5.39 - * deletion without notice.</b> 5.40 - */ 5.41 -public class Module_attribute extends Attribute { 5.42 - Module_attribute(ClassReader cr, int name_index, int length) throws IOException { 5.43 - super(name_index, length); 5.44 - module_name = cr.readUnsignedShort(); 5.45 - } 5.46 - 5.47 - public Module_attribute(ConstantPool constant_pool, int module_name) 5.48 - throws ConstantPoolException { 5.49 - this(constant_pool.getUTF8Index(Attribute.Module), module_name); 5.50 - } 5.51 - 5.52 - public Module_attribute(int name_index, int module_name) { 5.53 - super(name_index, 2); 5.54 - this.module_name = module_name; 5.55 - } 5.56 - 5.57 - public String getModuleName(ConstantPool constant_pool) throws ConstantPoolException { 5.58 - return constant_pool.getUTF8Value(module_name); 5.59 - } 5.60 - 5.61 - public <R, D> R accept(Visitor<R, D> visitor, D data) { 5.62 - return visitor.visitModule(this, data); 5.63 - } 5.64 - 5.65 - public final int module_name; 5.66 - 5.67 -}
6.1 --- a/src/share/classes/com/sun/tools/javap/AttributeWriter.java Thu Nov 12 15:36:01 2009 -0800 6.2 +++ b/src/share/classes/com/sun/tools/javap/AttributeWriter.java Tue Nov 17 10:35:52 2009 -0800 6.3 @@ -45,9 +45,6 @@ 6.4 import com.sun.tools.classfile.LineNumberTable_attribute; 6.5 import com.sun.tools.classfile.LocalVariableTable_attribute; 6.6 import com.sun.tools.classfile.LocalVariableTypeTable_attribute; 6.7 -import com.sun.tools.classfile.ModuleExportTable_attribute; 6.8 -import com.sun.tools.classfile.ModuleMemberTable_attribute; 6.9 -import com.sun.tools.classfile.Module_attribute; 6.10 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute; 6.11 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute; 6.12 import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute; 6.13 @@ -372,63 +369,6 @@ 6.14 return null; 6.15 } 6.16 6.17 - public Void visitModule(Module_attribute attr, Void ignore) { 6.18 - print("Module: #" + attr.module_name); 6.19 - tab(); 6.20 - println("// " + getModuleName(attr)); 6.21 - return null; 6.22 - } 6.23 - 6.24 - String getModuleName(Module_attribute attr) { 6.25 - try { 6.26 - return attr.getModuleName(constant_pool); 6.27 - } catch (ConstantPoolException e) { 6.28 - return report(e); 6.29 - } 6.30 - } 6.31 - 6.32 - public Void visitModuleExportTable(ModuleExportTable_attribute attr, Void ignore) { 6.33 - println("ModuleExportTable:"); 6.34 - indent(+1); 6.35 - println("Types: (" + attr.export_type_table.length + ")"); 6.36 - for (int i = 0; i < attr.export_type_table.length; i++) { 6.37 - print("#" + attr.export_type_table[i]); 6.38 - tab(); 6.39 - println("// " + getExportTypeName(attr, i)); 6.40 - } 6.41 - indent(-1); 6.42 - return null; 6.43 - } 6.44 - 6.45 - String getExportTypeName(ModuleExportTable_attribute attr, int index) { 6.46 - try { 6.47 - return attr.getExportTypeName(index, constant_pool); 6.48 - } catch (ConstantPoolException e) { 6.49 - return report(e); 6.50 - } 6.51 - } 6.52 - 6.53 - public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, Void ignore) { 6.54 - println("ModuleMemberTable:"); 6.55 - indent(+1); 6.56 - println("Packages: (" + attr.package_member_table.length + ")"); 6.57 - for (int i = 0; i < attr.package_member_table.length; i++) { 6.58 - print("#" + attr.package_member_table[i]); 6.59 - tab(); 6.60 - println("// " + getPackageMemberName(attr, i)); 6.61 - } 6.62 - indent(-1); 6.63 - return null; 6.64 - } 6.65 - 6.66 - String getPackageMemberName(ModuleMemberTable_attribute attr, int index) { 6.67 - try { 6.68 - return attr.getPackageMemberName(index, constant_pool); 6.69 - } catch (ConstantPoolException e) { 6.70 - return report(e); 6.71 - } 6.72 - } 6.73 - 6.74 public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) { 6.75 println("RuntimeVisibleAnnotations:"); 6.76 indent(+1);
7.1 --- a/src/share/classes/com/sun/tools/javap/JavapTask.java Thu Nov 12 15:36:01 2009 -0800 7.2 +++ b/src/share/classes/com/sun/tools/javap/JavapTask.java Tue Nov 17 10:35:52 2009 -0800 7.3 @@ -236,12 +236,6 @@ 7.4 } 7.5 }, 7.6 7.7 - new Option(false, "-XDjsr277") { 7.8 - void process(JavapTask task, String opt, String arg) { 7.9 - task.options.jsr277 = true; 7.10 - } 7.11 - }, 7.12 - 7.13 new Option(false, "-XDdetails") { 7.14 void process(JavapTask task, String opt, String arg) { 7.15 task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class); 7.16 @@ -586,7 +580,6 @@ 7.17 sourceWriter.setFileManager(fileManager); 7.18 7.19 attributeFactory.setCompat(options.compat); 7.20 - attributeFactory.setJSR277(options.jsr277); 7.21 7.22 boolean ok = true; 7.23
8.1 --- a/src/share/classes/com/sun/tools/javap/Options.java Thu Nov 12 15:36:01 2009 -0800 8.2 +++ b/src/share/classes/com/sun/tools/javap/Options.java Tue Nov 17 10:35:52 2009 -0800 8.3 @@ -90,5 +90,4 @@ 8.4 public int tabColumn = 40; // column number for comments 8.5 8.6 public boolean compat; // bug-for-bug compatibility mode with old javap 8.7 - public boolean jsr277; 8.8 }