From owner-svn-ports-all@FreeBSD.ORG Wed Dec 4 23:20:36 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE54F5D6; Wed, 4 Dec 2013 23:20:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7D2D1936; Wed, 4 Dec 2013 23:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB4NKaZB034812; Wed, 4 Dec 2013 23:20:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB4NKZlV034806; Wed, 4 Dec 2013 23:20:35 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201312042320.rB4NKZlV034806@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 4 Dec 2013 23:20:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r335646 - in head/java: openjdk6 openjdk6-jre openjdk6/files/icedtea/openjdk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Dec 2013 23:20:36 -0000 Author: jkim Date: Wed Dec 4 23:20:35 2013 New Revision: 335646 URL: http://svnweb.freebsd.org/changeset/ports/335646 Log: Add multiple security patches and improvements from IcedTea6. http://icedtea.classpath.org/hg/icedtea6/rev/e98b0ef70b26 Obtained from: IcedTea Project Added: head/java/openjdk6/files/icedtea/openjdk/ head/java/openjdk6/files/icedtea/openjdk/4075303-javap_update.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/4111861-static_fields.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/4501661-disallow_mixing.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/4884240-javap_additional_option.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6708729-javap_makefile_update.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6715767-javap_crash.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6819246-javap_instruction_decoding.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6824493-experimental.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6841419-classfile_iterator.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6841420-classfile_methods.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6843013-missing_experimental.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6852856-javap_subclasses.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6867671-javap_whitespace.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6868539-constant_pool_tags.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6902264-fix_indentation.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/6954275-big_xml_signatures.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/7146431-java.security_files.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/7196533-timezone_bottleneck.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8000450-restrict_access.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8002070-remove_logger_stack_search.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8003992-embedded_nulls.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8004188-rename_java.security.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8006882-jmockit.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8006900-new_date_time.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8008589-better_mbean_permission_validation.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8010118-caller_sensitive.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8010727-empty_logger_name.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8010939-logmanager_deadlock.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011071-better_crypto_provider_handling.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011081-improve_jhat.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011139-revise_checking_getenclosingclass.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011157-improve_corba_portability-jdk.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011157-improve_corba_portability.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8011990-logger_test_urls.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012071-better_bean_building.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012147-improve_tool.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012243-serial_regression.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012277-improve_dataflavour.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012425-transform_transformfactory.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012453-runtime.exec.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013380-logger_stack_walk_glassfish.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013503-improve_stream_factories.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013506-better_pack200.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013510-augment_image_writing.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013514-improve_cmap_stability.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013739-better_ldap_resource_management.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013744-better_tabling.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8013827-createtempfile_hang.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014085-better_serialization.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014093-improve_image_parsing.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014102-improve_image_conversion.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014341-better_kerberos_service.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014349-getdeclaredclass_fix.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014530-better_dsp.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014534-better_profiling.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014718-remove_logging_suntoolkit.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014745-logger_stack_walk_switch.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8014987-augment_serialization.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015144-performance_regression.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015614-update_build.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015731-auth_improvements.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015743-address_internet_addresses.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015965-typo_in_property_name.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8015978-incorrect_transformation.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8016256-finalization_final.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8016357-update_hs_diagnostic_class.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8016653-ignoreable_characters.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8016675-robust_javadoc.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017196-ensure_proxies_are_handled_appropriately-jdk.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017196-ensure_proxies_are_handled_appropriately.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017287-better_resource_disposal.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017291-cast_proxies_aside.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017298-better_xml_support.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017300-improve_interface_implementation.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017505-better_client_service.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8017566-backout_part_of_8000450.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8019292-better_attribute_value_exceptions.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8019584-invalid_notification_fix.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8019617-better_view_of_objects.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8019969-inet6_test_case_fix.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8019979-better_access_test.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8020293-jvm_crash.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8020943-memory_leak.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021290-signature_validation.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021355-splashscreen_regression.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021366-jaxp_test_fix-01.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021577-bean_serialization_fix.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021933-jaxp_test_fix-02.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8021969-jnlp_load_failure.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8022661-writeobject_flush.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8022682-supporting_xom.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8022940-enhance_corba_translations.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8023457-tracing_mutex.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8023478-hs_crash.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8023683-enhance_class_file_parsing.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8023964-ignore_test.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8024914-swapped_usage.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/8025128-createtempfile_absolute_prefix.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/oj6-19-fix_8010118_test_cases.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/oj6-20-merge.patch (contents, props changed) head/java/openjdk6/files/icedtea/openjdk/oj6-21-overrides.patch (contents, props changed) Modified: head/java/openjdk6-jre/Makefile head/java/openjdk6/Makefile head/java/openjdk6/Makefile.icedtea Modified: head/java/openjdk6-jre/Makefile ============================================================================== --- head/java/openjdk6-jre/Makefile Wed Dec 4 22:31:40 2013 (r335645) +++ head/java/openjdk6-jre/Makefile Wed Dec 4 23:20:35 2013 (r335646) @@ -1,6 +1,6 @@ # $FreeBSD$ -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= java devel PKGNAMESUFFIX= -jre Modified: head/java/openjdk6/Makefile ============================================================================== --- head/java/openjdk6/Makefile Wed Dec 4 22:31:40 2013 (r335645) +++ head/java/openjdk6/Makefile Wed Dec 4 23:20:35 2013 (r335646) @@ -3,7 +3,7 @@ PORTNAME= openjdk6 PORTVERSION= b28 -PORTREVISION?= 5 +PORTREVISION?= 6 CATEGORIES= java devel MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \ http://download.java.net/openjdk/jtreg/promoted/4.1/b05/:jtreg \ Modified: head/java/openjdk6/Makefile.icedtea ============================================================================== --- head/java/openjdk6/Makefile.icedtea Wed Dec 4 22:31:40 2013 (r335645) +++ head/java/openjdk6/Makefile.icedtea Wed Dec 4 23:20:35 2013 (r335646) @@ -1,6 +1,108 @@ # $FreeBSD$ -_PATCHES= +_PATCHES= \ + openjdk/8017196-ensure_proxies_are_handled_appropriately.patch \ + openjdk/8011157-improve_corba_portability.patch \ + openjdk/8022940-enhance_corba_translations.patch \ + openjdk/8013503-improve_stream_factories.patch \ + openjdk/8012425-transform_transformfactory.patch \ + openjdk/8017298-better_xml_support.patch \ + openjdk/8014530-better_dsp.patch \ + openjdk/8021366-jaxp_test_fix-01.patch \ + openjdk/8021933-jaxp_test_fix-02.patch \ + openjdk/8022682-supporting_xom.patch \ + openjdk/8015978-incorrect_transformation.patch \ + openjdk/oj6-20-merge.patch \ + openjdk/8024914-swapped_usage.patch \ + openjdk/8017505-better_client_service.patch \ + openjdk/8015614-update_build.patch \ + openjdk/8016256-finalization_final.patch \ + openjdk/8023683-enhance_class_file_parsing.patch \ + openjdk/8023457-tracing_mutex.patch \ + openjdk/8020943-memory_leak.patch \ + openjdk/8023478-hs_crash.patch \ + openjdk/4075303-javap_update.patch \ + openjdk/6819246-javap_instruction_decoding.patch \ + openjdk/6715767-javap_crash.patch \ + openjdk/6841420-classfile_methods.patch \ + openjdk/6841419-classfile_iterator.patch \ + openjdk/4111861-static_fields.patch \ + openjdk/4884240-javap_additional_option.patch \ + openjdk/6852856-javap_subclasses.patch \ + openjdk/6867671-javap_whitespace.patch \ + openjdk/6868539-constant_pool_tags.patch \ + openjdk/4501661-disallow_mixing.patch \ + openjdk/6824493-experimental.patch \ + openjdk/6843013-missing_experimental.patch \ + openjdk/6902264-fix_indentation.patch \ + openjdk/8016675-robust_javadoc.patch \ + openjdk/8016653-ignoreable_characters.patch \ + openjdk/7196533-timezone_bottleneck.patch \ + openjdk/8006900-new_date_time.patch \ + openjdk/8008589-better_mbean_permission_validation.patch \ + openjdk/8011071-better_crypto_provider_handling.patch \ + openjdk/8011081-improve_jhat.patch \ + openjdk/8011157-improve_corba_portability-jdk.patch \ + openjdk/8012071-better_bean_building.patch \ + openjdk/8012147-improve_tool.patch \ + openjdk/8012277-improve_dataflavour.patch \ + openjdk/8013506-better_pack200.patch \ + openjdk/8013510-augment_image_writing.patch \ + openjdk/8013514-improve_cmap_stability.patch \ + openjdk/8013744-better_tabling.patch \ + openjdk/8014085-better_serialization.patch \ + openjdk/8014093-improve_image_parsing.patch \ + openjdk/8014102-improve_image_conversion.patch \ + openjdk/8014341-better_kerberos_service.patch \ + openjdk/8014534-better_profiling.patch \ + openjdk/8014987-augment_serialization.patch \ + openjdk/8015731-auth_improvements.patch \ + openjdk/8015743-address_internet_addresses.patch \ + openjdk/8016357-update_hs_diagnostic_class.patch \ + openjdk/8002070-remove_logger_stack_search.patch \ + openjdk/6708729-javap_makefile_update.patch \ + openjdk/8010118-caller_sensitive.patch \ + openjdk/oj6-19-fix_8010118_test_cases.patch \ + openjdk/8010727-empty_logger_name.patch \ + openjdk/8010939-logmanager_deadlock.patch \ + openjdk/8011990-logger_test_urls.patch \ + openjdk/8013380-logger_stack_walk_glassfish.patch \ + openjdk/8014745-logger_stack_walk_switch.patch \ + openjdk/8012243-serial_regression.patch \ + openjdk/8014718-remove_logging_suntoolkit.patch \ + openjdk/8011139-revise_checking_getenclosingclass.patch \ + openjdk/8017196-ensure_proxies_are_handled_appropriately-jdk.patch \ + openjdk/8017287-better_resource_disposal.patch \ + openjdk/8017291-cast_proxies_aside.patch \ + openjdk/7146431-java.security_files.patch \ + openjdk/8006882-jmockit.patch \ + openjdk/8000450-restrict_access.patch \ + openjdk/8019979-better_access_test.patch \ + openjdk/8004188-rename_java.security.patch \ + openjdk/8017566-backout_part_of_8000450.patch \ + openjdk/8017300-improve_interface_implementation.patch \ + openjdk/8019292-better_attribute_value_exceptions.patch \ + openjdk/8019617-better_view_of_objects.patch \ + openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch \ + openjdk/8020293-jvm_crash.patch \ + openjdk/8013739-better_ldap_resource_management.patch \ + openjdk/8014349-getdeclaredclass_fix.patch \ + openjdk/6954275-big_xml_signatures.patch \ + openjdk/8021290-signature_validation.patch \ + openjdk/8012453-runtime.exec.patch \ + openjdk/8015965-typo_in_property_name.patch \ + openjdk/8015144-performance_regression.patch \ + openjdk/8019969-inet6_test_case_fix.patch \ + openjdk/8019584-invalid_notification_fix.patch \ + openjdk/8021577-bean_serialization_fix.patch \ + openjdk/8021969-jnlp_load_failure.patch \ + openjdk/8021355-splashscreen_regression.patch \ + openjdk/8022661-writeobject_flush.patch \ + openjdk/8023964-ignore_test.patch \ + openjdk/8003992-embedded_nulls.patch \ + openjdk/8013827-createtempfile_hang.patch \ + openjdk/8025128-createtempfile_absolute_prefix.patch \ + openjdk/oj6-21-overrides.patch .if ${PORT_OPTIONS:MICEDTEA} _PATCHES+= \ Added: head/java/openjdk6/files/icedtea/openjdk/4075303-javap_update.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk6/files/icedtea/openjdk/4075303-javap_update.patch Wed Dec 4 23:20:35 2013 (r335646) @@ -0,0 +1,12081 @@ +# HG changeset patch +# User jjg +# Date 1382400229 -3600 +# Tue Oct 22 01:03:49 2013 +0100 +# Node ID bfd7bb4218253bac4f57abbc90b987f16e4b7f6c +# Parent 8e38c8fe0a0beaef943e754071be0358c34e76dd +4075303: Use javap to enquire about a specific inner class +4348375: Javap is not internationalized +4459541: "javap -l" shows line numbers as signed short; they should be unsigned +4501660: change diagnostic of -help as 'print this help message and exit' +4776241: unused source file in javap... +4870651: javap should recognize generics, varargs, enum +4876942: javap invoked without args does not print help screen +4880663: javap could output whitespace between class name and opening brace +4975569: javap doesn't print new flag bits +6271787: javap dumps LocalVariableTypeTable attribute in hex, needs to print a table +6305779: javap: support annotations +6439940: Clean up javap implementation +6469569: wrong check of searchpath in JavapEnvironment +6474890: javap does not open .zip files in -classpath +6587786: Javap throws error : "ERROR:Could not find " for JRE classes +6622215: javap ignores certain relevant access flags +6622216: javap names some attributes incorrectly +6622232: javap gets whitespace confused +6622260: javap prints negative bytes incorrectly in hex +Reviewed-by: ksrini + +diff -r 8e38c8fe0a0b -r bfd7bb421825 make/build.properties +--- langtools/make/build.properties Fri Oct 04 12:22:34 2013 -0400 ++++ langtools/make/build.properties Tue Oct 22 01:03:49 2013 +0100 +@@ -130,6 +130,8 @@ + # + + javap.includes = \ ++ com/sun/tools/classfile/ \ ++ com/sun/tools/javap/ \ + sun/tools/javap/ + + javap.tests = \ +diff -r 8e38c8fe0a0b -r bfd7bb421825 make/build.xml +--- langtools/make/build.xml Fri Oct 04 12:22:34 2013 -0400 ++++ langtools/make/build.xml Tue Oct 22 01:03:49 2013 +0100 +@@ -316,14 +316,15 @@ + jarmainclass="sun.tools.javap.Main"/> + + +- ++ + + + +- ++ + ++ jarmainclass="sun.tools.javap.Main" ++ jarclasspath="javac.jar"/> + + + +diff -r 8e38c8fe0a0b -r bfd7bb421825 src/share/classes/com/sun/tools/classfile/AccessFlags.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ langtools/src/share/classes/com/sun/tools/classfile/AccessFlags.java Tue Oct 22 01:03:49 2013 +0100 +@@ -0,0 +1,254 @@ ++/* ++ * Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package com.sun.tools.classfile; ++ ++import java.io.IOException; ++import java.util.LinkedHashSet; ++import java.util.Set; ++ ++/** ++ * See JVMS3, sections 4.2, 4.6, 4.7. ++ * ++ *

This is NOT part of any API supported by Sun Microsystems. 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. ++ */ ++public class AccessFlags { ++ public static final int ACC_PUBLIC = 0x0001; // class, inner, field, method ++ public static final int ACC_PRIVATE = 0x0002; // inner, field, method ++ public static final int ACC_PROTECTED = 0x0004; // inner, field, method ++ public static final int ACC_STATIC = 0x0008; // inner, field, method ++ public static final int ACC_FINAL = 0x0010; // class, inner, field, method ++ public static final int ACC_SUPER = 0x0020; // class ++ public static final int ACC_SYNCHRONIZED = 0x0020; // method ++ public static final int ACC_VOLATILE = 0x0040; // field ++ public static final int ACC_BRIDGE = 0x0040; // method ++ public static final int ACC_TRANSIENT = 0x0080; // field ++ public static final int ACC_VARARGS = 0x0080; // method ++ public static final int ACC_NATIVE = 0x0100; // method ++ public static final int ACC_INTERFACE = 0x0200; // class, inner ++ public static final int ACC_ABSTRACT = 0x0400; // class, inner, method ++ public static final int ACC_STRICT = 0x0800; // method ++ public static final int ACC_SYNTHETIC = 0x1000; // class, inner, field, method ++ public static final int ACC_ANNOTATION = 0x2000; // class, inner ++ public static final int ACC_ENUM = 0x4000; // class, inner, field ++ public static final int ACC_MODULE = 0x8000; // class, inner, field, method ++ ++ private static enum Type { Class, InnerClass, Field, Method}; ++ ++ AccessFlags(ClassReader cr) throws IOException { ++ this(cr.readUnsignedShort()); ++ } ++ ++ public AccessFlags(int flags) { ++ this.flags = flags; ++ } ++ ++ public AccessFlags ignore(int mask) { ++ return new AccessFlags(flags & ~mask); ++ } ++ ++ public boolean is(int mask) { ++ return (flags & mask) != 0; ++ } ++ ++ private static final int[] classModifiers = { ++ ACC_PUBLIC, ACC_FINAL, ACC_ABSTRACT, ACC_MODULE ++ }; ++ ++ private static final int[] classFlags = { ++ ACC_PUBLIC, ACC_FINAL, ACC_SUPER, ACC_INTERFACE, ACC_ABSTRACT, ++ ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_MODULE ++ }; ++ ++ public Set getClassModifiers() { ++ int f = ((flags & ACC_INTERFACE) != 0 ? flags & ~ACC_ABSTRACT : flags); ++ return getModifiers(f, classModifiers, Type.Class); ++ } ++ ++ public Set getClassFlags() { ++ return getFlags(classFlags, Type.Class); ++ } ++ ++ private static final int[] innerClassModifiers = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ++ ACC_ABSTRACT, ACC_MODULE ++ }; ++ ++ private static final int[] innerClassFlags = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ACC_SUPER, ++ ACC_INTERFACE, ACC_ABSTRACT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM, ACC_MODULE ++ }; ++ ++ public Set getInnerClassModifiers() { ++ int f = ((flags & ACC_INTERFACE) != 0 ? flags & ~ACC_ABSTRACT : flags); ++ return getModifiers(f, innerClassModifiers, Type.InnerClass); ++ } ++ ++ public Set getInnerClassFlags() { ++ return getFlags(innerClassFlags, Type.InnerClass); ++ } ++ ++ private static final int[] fieldModifiers = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ++ ACC_VOLATILE, ACC_TRANSIENT, ACC_MODULE ++ }; ++ ++ private static final int[] fieldFlags = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ++ ACC_VOLATILE, ACC_TRANSIENT, ACC_SYNTHETIC, ACC_ENUM, ACC_MODULE ++ }; ++ ++ public Set getFieldModifiers() { ++ return getModifiers(fieldModifiers, Type.Field); ++ } ++ ++ public Set getFieldFlags() { ++ return getFlags(fieldFlags, Type.Field); ++ } ++ ++ private static final int[] methodModifiers = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ++ ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT, ACC_STRICT, ACC_MODULE ++ }; ++ ++ private static final int[] methodFlags = { ++ ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL, ++ ACC_SYNCHRONIZED, ACC_BRIDGE, ACC_VARARGS, ACC_NATIVE, ACC_ABSTRACT, ++ ACC_STRICT, ACC_SYNTHETIC, ACC_MODULE ++ }; ++ ++ public Set getMethodModifiers() { ++ return getModifiers(methodModifiers, Type.Method); ++ } ++ ++ public Set getMethodFlags() { ++ return getFlags(methodFlags, Type.Method); ++ } ++ ++ private Set getModifiers(int[] modifierFlags, Type t) { ++ return getModifiers(flags, modifierFlags, t); ++ } ++ ++ private static Set getModifiers(int flags, int[] modifierFlags, Type t) { ++ Set s = new LinkedHashSet(); ++ for (int m: modifierFlags) { ++ if ((flags & m) != 0) ++ s.add(flagToModifier(m, t)); ++ } ++ return s; ++ } ++ ++ private Set getFlags(int[] expectedFlags, Type t) { ++ Set s = new LinkedHashSet(); ++ int f = flags; ++ for (int e: expectedFlags) { ++ if ((f & e) != 0) { ++ s.add(flagToName(e, t)); ++ f = f & ~e; ++ } ++ } ++ while (f != 0) { ++ int bit = Integer.highestOneBit(f); ++ s.add("0x" + Integer.toHexString(bit)); ++ f = f & ~bit; ++ } ++ return s; ++ } ++ ++ private static String flagToModifier(int flag, Type t) { ++ switch (flag) { ++ case ACC_PUBLIC: ++ return "public"; ++ case ACC_PRIVATE: ++ return "private"; ++ case ACC_PROTECTED: ++ return "protected"; ++ case ACC_STATIC: ++ return "static"; ++ case ACC_FINAL: ++ return "final"; ++ case ACC_SYNCHRONIZED: ++ return "synchronized"; ++ case 0x80: ++ return (t == Type.Field ? "transient" : null); ++ case ACC_VOLATILE: ++ return "volatile"; ++ case ACC_NATIVE: ++ return "native"; ++ case ACC_ABSTRACT: ++ return "abstract"; ++ case ACC_STRICT: ++ return "strictfp"; ++ case ACC_MODULE: ++ return "module"; ++ default: ++ return null; ++ } ++ } ++ ++ private static String flagToName(int flag, Type t) { ++ switch (flag) { ++ case ACC_PUBLIC: ++ return "ACC_PUBLIC"; ++ case ACC_PRIVATE: ++ return "ACC_PRIVATE"; ++ case ACC_PROTECTED: ++ return "ACC_PROTECTED"; ++ case ACC_STATIC: ++ return "ACC_STATIC"; ++ case ACC_FINAL: ++ return "ACC_FINAL"; ++ case 0x20: ++ return (t == Type.Class ? "ACC_SUPER" : "ACC_SYNCHRONIZED"); ++ case 0x40: ++ return (t == Type.Field ? "ACC_VOLATILE" : "ACC_BRIDGE"); ++ case 0x80: ++ return (t == Type.Field ? "ACC_TRANSIENT" : "ACC_VARARGS"); ++ case ACC_NATIVE: ++ return "ACC_NATIVE"; ++ case ACC_INTERFACE: ++ return "ACC_INTERFACE"; ++ case ACC_ABSTRACT: ++ return "ACC_ABSTRACT"; ++ case ACC_STRICT: ++ return "ACC_STRICT"; ++ case ACC_SYNTHETIC: ++ return "ACC_SYNTHETIC"; ++ case ACC_ANNOTATION: ++ return "ACC_ANNOTATION"; ++ case ACC_ENUM: ++ return "ACC_ENUM"; ++ case ACC_MODULE: ++ return "ACC_MODULE"; ++ default: ++ return null; ++ } ++ } ++ ++ final int flags; ++} +diff -r 8e38c8fe0a0b -r bfd7bb421825 src/share/classes/com/sun/tools/classfile/Annotation.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ langtools/src/share/classes/com/sun/tools/classfile/Annotation.java Tue Oct 22 01:03:49 2013 +0100 +@@ -0,0 +1,243 @@ ++/* ++ * Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package com.sun.tools.classfile; ++ ++import java.io.IOException; ++ ++/** ++ * See JVMS3, section 4.8.16. ++ * ++ *

This is NOT part of any API supported by Sun Microsystems. 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. ++ */ ++public class Annotation { ++ static class InvalidAnnotation extends AttributeException { ++ InvalidAnnotation(String msg) { ++ super(msg); ++ } ++ } ++ ++ Annotation(ClassReader cr) throws IOException, InvalidAnnotation { ++ type_index = cr.readUnsignedShort(); ++ num_element_value_pairs = cr.readUnsignedShort(); ++ element_value_pairs = new element_value_pair[num_element_value_pairs]; ++ for (int i = 0; i < element_value_pairs.length; i++) ++ element_value_pairs[i] = new element_value_pair(cr); ++ } ++ ++ public Annotation(ConstantPool constant_pool, ++ int type_index, ++ element_value_pair[] element_value_pairs) { ++ this.type_index = type_index; ++ num_element_value_pairs = element_value_pairs.length; ++ this.element_value_pairs = element_value_pairs; ++ } ++ ++ public int length() { ++ int n = 2 /*type_index*/ + 2 /*num_element_value_pairs*/; ++ for (element_value_pair pair: element_value_pairs) ++ n += pair.length(); ++ return n; ++ } ++ ++ public final int type_index; ++ public final int num_element_value_pairs; ++ public final element_value_pair element_value_pairs[]; ++ ++ /** ++ * See JVMS3, section 4.8.16.1. ++ */ ++ public static abstract class element_value { ++ public static element_value read(ClassReader cr) ++ throws IOException, InvalidAnnotation { ++ int tag = cr.readUnsignedByte(); ++ switch (tag) { ++ case 'B': ++ case 'C': ++ case 'D': ++ case 'F': ++ case 'I': ++ case 'J': ++ case 'S': ++ case 'Z': ++ case 's': ++ return new Primitive_element_value(cr, tag); ++ ++ case 'e': ++ return new Enum_element_value(cr, tag); ++ ++ case 'c': ++ return new Class_element_value(cr, tag); ++ ++ case '@': ++ return new Annotation_element_value(cr, tag); ++ ++ case '[': ++ return new Array_element_value(cr, tag); ++ ++ default: ++ throw new InvalidAnnotation("unrecognized tag: " + tag); ++ } ++ } ++ ++ protected element_value(int tag) { ++ this.tag = tag; ++ } ++ ++ public abstract int length(); ++ ++ public abstract R accept(Visitor visitor, P p); ++ ++ public interface Visitor { ++ R visitPrimitive(Primitive_element_value ev, P p); ++ R visitEnum(Enum_element_value ev, P p); ++ R visitClass(Class_element_value ev, P p); ++ R visitAnnotation(Annotation_element_value ev, P p); ++ R visitArray(Array_element_value ev, P p); ++ } ++ ++ public final int tag; ++ } ++ ++ public static class Primitive_element_value extends element_value { ++ Primitive_element_value(ClassReader cr, int tag) throws IOException { ++ super(tag); ++ const_value_index = cr.readUnsignedShort(); ++ } ++ ++ @Override ++ public int length() { ++ return 2; ++ } ++ ++ public R accept(Visitor visitor, P p) { ++ return visitor.visitPrimitive(this, p); ++ } ++ ++ public final int const_value_index; ++ ++ } ++ ++ public static class Enum_element_value extends element_value { ++ Enum_element_value(ClassReader cr, int tag) throws IOException { ++ super(tag); ++ type_name_index = cr.readUnsignedShort(); ++ const_name_index = cr.readUnsignedShort(); ++ } ++ ++ @Override ++ public int length() { ++ return 4; ++ } ++ ++ public R accept(Visitor visitor, P p) { ++ return visitor.visitEnum(this, p); ++ } ++ ++ public final int type_name_index; ++ public final int const_name_index; ++ } ++ ++ public static class Class_element_value extends element_value { ++ Class_element_value(ClassReader cr, int tag) throws IOException { ++ super(tag); ++ class_info_index = cr.readUnsignedShort(); ++ } ++ ++ @Override ++ public int length() { ++ return 2; ++ } ++ ++ public R accept(Visitor visitor, P p) { ++ return visitor.visitClass(this, p); ++ } ++ ++ public final int class_info_index; ++ } ++ ++ public static class Annotation_element_value extends element_value { ++ Annotation_element_value(ClassReader cr, int tag) ++ throws IOException, InvalidAnnotation { ++ super(tag); ++ annotation_value = new Annotation(cr); ++ } ++ ++ @Override ++ public int length() { ++ return annotation_value.length(); ++ } ++ ++ public R accept(Visitor visitor, P p) { ++ return visitor.visitAnnotation(this, p); ++ } ++ ++ public final Annotation annotation_value; ++ } ++ ++ public static class Array_element_value extends element_value { ++ Array_element_value(ClassReader cr, int tag) ++ throws IOException, InvalidAnnotation { ++ super(tag); ++ num_values = cr.readUnsignedShort(); ++ values = new element_value[num_values]; ++ for (int i = 0; i < values.length; i++) ++ values[i] = element_value.read(cr); ++ } ++ ++ @Override ++ public int length() { ++ int n = 2; ++ for (int i = 0; i < values.length; i++) ++ n += values[i].length(); ++ return n; ++ } ++ ++ public R accept(Visitor visitor, P p) { ++ return visitor.visitArray(this, p); ++ } ++ ++ public final int num_values; ++ public final element_value[] values; ++ } ++ ++ public static class element_value_pair { ++ element_value_pair(ClassReader cr) ++ throws IOException, InvalidAnnotation { ++ element_name_index = cr.readUnsignedShort(); ++ value = element_value.read(cr); ++ } ++ ++ public int length() { ++ return 2 + value.length(); ++ } ++ ++ public final int element_name_index; ++ public final element_value value; ++ } ++} +diff -r 8e38c8fe0a0b -r bfd7bb421825 src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ langtools/src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java Tue Oct 22 01:03:49 2013 +0100 +@@ -0,0 +1,61 @@ ++/* ++ * Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package com.sun.tools.classfile; ++ ++import java.io.IOException; ++ ++/** ++ * See JVMS3, section 4.8.15. ++ * ++ *

This is NOT part of any API supported by Sun Microsystems. 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. ++ */ ++public class AnnotationDefault_attribute extends Attribute { ++ AnnotationDefault_attribute(ClassReader cr, int name_index, int length) ++ throws IOException, Annotation.InvalidAnnotation { ++ super(name_index, length); ++ default_value = Annotation.element_value.read(cr); ++ } ++ ++ public AnnotationDefault_attribute(ConstantPool constant_pool, Annotation.element_value default_value) ++ throws ConstantPoolException { ++ this(constant_pool.getUTF8Index(Attribute.AnnotationDefault), default_value); ++ } ++ ++ public AnnotationDefault_attribute(int name_index, Annotation.element_value default_value) { ++ super(name_index, default_value.length()); ++ this.default_value = default_value; ++ } ++ ++ public R accept(Visitor visitor, D data) { ++ return visitor.visitAnnotationDefault(this, data); ++ } ++ ++ public final Annotation.element_value default_value; ++} ++ +diff -r 8e38c8fe0a0b -r bfd7bb421825 src/share/classes/com/sun/tools/classfile/Attribute.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ langtools/src/share/classes/com/sun/tools/classfile/Attribute.java Tue Oct 22 01:03:49 2013 +0100 +@@ -0,0 +1,199 @@ ++/* ++ * Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package com.sun.tools.classfile; ++ ++import java.io.IOException; ++import java.lang.reflect.Constructor; ++import java.util.HashMap; ++import java.util.Map; ++ ++/** ++ *

This is NOT part of any API supported by Sun Microsystems. 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. ++ */ ++ ++public abstract class Attribute { ++ public static final String AnnotationDefault = "AnnotationDefault"; ++ public static final String CharacterRangeTable = "CharacterRangeTable"; ++ public static final String Code = "Code"; ++ public static final String ConstantValue = "ConstantValue"; ++ public static final String CompilationID = "CompilationID"; ++ public static final String Deprecated = "Deprecated"; ++ public static final String EnclosingMethod = "EnclosingMethod"; ++ public static final String Exceptions = "Exceptions"; ++ public static final String InnerClasses = "InnerClasses"; ++ public static final String LineNumberTable = "LineNumberTable"; ++ public static final String LocalVariableTable = "LocalVariableTable"; ++ public static final String LocalVariableTypeTable = "LocalVariableTypeTable"; ++ public static final String RuntimeVisibleAnnotations = "RuntimeVisibleAnnotations"; ++ public static final String RuntimeInvisibleAnnotations = "RuntimeInvisibleAnnotations"; ++ public static final String RuntimeVisibleParameterAnnotations = "RuntimeVisibleParameterAnnotations"; ++ public static final String RuntimeInvisibleParameterAnnotations = "RuntimeInvisibleParameterAnnotations"; ++ public static final String Signature = "Signature"; ++ public static final String SourceDebugExtension = "SourceDebugExtension"; ++ public static final String SourceFile = "SourceFile"; ++ public static final String SourceID = "SourceID"; ++ public static final String StackMap = "StackMap"; ++ public static final String StackMapTable = "StackMapTable"; ++ public static final String Synthetic = "Synthetic"; ++ ++ // JSR 277/294 ++ public static final String Module = "Module"; ++ public static final String ModuleExportTable = "ModuleExportTable"; ++ public static final String ModuleMemberTable = "ModuleMemberTable"; ++ ++ public static class Factory { ++ public Factory() { ++ // defer init of standardAttributeClasses until after options set up ++ } ++ ++ public void setCompat(boolean compat) { ++ this.compat = compat; ++ } ++ ++ public void setJSR277(boolean jsr277) { ++ this.jsr277 = jsr277; ++ } ++ ++ public Attribute createAttribute(ClassReader cr, int name_index, byte[] data) ++ throws IOException { ++ if (standardAttributes == null) ++ init(); ++ ++ ConstantPool cp = cr.getConstantPool(); ++ try { ++ String name = cp.getUTF8Value(name_index); ++ Class attrClass = standardAttributes.get(name); ++ if (attrClass != null) { ++ try { ++ Class[] constrArgTypes = {ClassReader.class, int.class, int.class}; ++ Constructor constr = attrClass.getDeclaredConstructor(constrArgTypes); ++ return constr.newInstance(new Object[] { cr, name_index, data.length }); ++ } catch (Throwable t) { ++ // fall through and use DefaultAttribute ++ // t.printStackTrace(); ++ } ++ } ++ } catch (ConstantPoolException e) { ++ // fall through and use DefaultAttribute ++ } ++ return new DefaultAttribute(cr, name_index, data); ++ } ++ ++ protected void init() { ++ standardAttributes = new HashMap>(); ++ standardAttributes.put(AnnotationDefault, AnnotationDefault_attribute.class); ++ standardAttributes.put(CharacterRangeTable, CharacterRangeTable_attribute.class); ++ standardAttributes.put(Code, Code_attribute.class); ++ standardAttributes.put(ConstantValue, ConstantValue_attribute.class); ++ standardAttributes.put(Deprecated, Deprecated_attribute.class); ++ standardAttributes.put(EnclosingMethod, EnclosingMethod_attribute.class); ++ standardAttributes.put(Exceptions, Exceptions_attribute.class); ++ standardAttributes.put(InnerClasses, InnerClasses_attribute.class); ++ standardAttributes.put(LineNumberTable, LineNumberTable_attribute.class); ++ standardAttributes.put(LocalVariableTable, LocalVariableTable_attribute.class); ++ standardAttributes.put(LocalVariableTypeTable, LocalVariableTypeTable_attribute.class); ++ ++ if (jsr277) { ++ standardAttributes.put(Module, Module_attribute.class); ++ standardAttributes.put(ModuleExportTable, ModuleExportTable_attribute.class); ++ standardAttributes.put(ModuleMemberTable, ModuleMemberTable_attribute.class); ++ } ++ ++ if (!compat) { // old javap does not recognize recent attributes ++ standardAttributes.put(CompilationID, CompilationID_attribute.class); ++ standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class); ++ standardAttributes.put(RuntimeInvisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations_attribute.class); ++ standardAttributes.put(RuntimeVisibleAnnotations, RuntimeVisibleAnnotations_attribute.class); ++ standardAttributes.put(RuntimeVisibleParameterAnnotations, RuntimeVisibleParameterAnnotations_attribute.class); ++ standardAttributes.put(Signature, Signature_attribute.class); ++ standardAttributes.put(SourceID, SourceID_attribute.class); ++ } ++ ++ standardAttributes.put(SourceDebugExtension, SourceDebugExtension_attribute.class); ++ standardAttributes.put(SourceFile, SourceFile_attribute.class); ++ standardAttributes.put(StackMap, StackMap_attribute.class); ++ standardAttributes.put(StackMapTable, StackMapTable_attribute.class); ++ standardAttributes.put(Synthetic, Synthetic_attribute.class); ++ } ++ ++ private Map> standardAttributes; ++ private boolean compat; // don't support recent attrs in compatibility mode ++ private boolean jsr277; // support new jsr277 attrs ++ } ++ ++ public static Attribute read(ClassReader cr) throws IOException { ++ return cr.readAttribute(); ++ } ++ ++ protected Attribute(int name_index, int length) { ++ attribute_name_index = name_index; ++ attribute_length = length; ++ } ++ ++ public String getName(ConstantPool constant_pool) throws ConstantPoolException { ++ return constant_pool.getUTF8Value(attribute_name_index); ++ } ++ ++ public abstract R accept(Attribute.Visitor visitor, D data); ++ ++ public final int attribute_name_index; ++ public final int attribute_length; ++ ++ ++ public interface Visitor { ++ R visitDefault(DefaultAttribute attr, P p); ++ R visitAnnotationDefault(AnnotationDefault_attribute attr, P p); ++ R visitCharacterRangeTable(CharacterRangeTable_attribute attr, P p); ++ R visitCode(Code_attribute attr, P p); ++ R visitCompilationID(CompilationID_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); ++ R visitExceptions(Exceptions_attribute attr, P p); ++ R visitInnerClasses(InnerClasses_attribute attr, P p); ++ R visitLineNumberTable(LineNumberTable_attribute attr, P p); ++ R visitLocalVariableTable(LocalVariableTable_attribute attr, P p); ++ R visitLocalVariableTypeTable(LocalVariableTypeTable_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); ++ R visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, P p); ++ R visitSignature(Signature_attribute attr, P p); ++ R visitSourceDebugExtension(SourceDebugExtension_attribute attr, P p); ++ R visitSourceFile(SourceFile_attribute attr, P p); ++ R visitSourceID(SourceID_attribute attr, P p); ++ R visitStackMap(StackMap_attribute attr, P p); ++ R visitStackMapTable(StackMapTable_attribute attr, P p); ++ R visitSynthetic(Synthetic_attribute attr, P p); ++ ++ R visitModule(Module_attribute attr, P p); ++ R visitModuleExportTable(ModuleExportTable_attribute attr, P p); ++ R visitModuleMemberTable(ModuleMemberTable_attribute attr, P p); ++ } ++} +diff -r 8e38c8fe0a0b -r bfd7bb421825 src/share/classes/com/sun/tools/classfile/AttributeException.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ langtools/src/share/classes/com/sun/tools/classfile/AttributeException.java Tue Oct 22 01:03:49 2013 +0100 +@@ -0,0 +1,40 @@ ++/* ++ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, ++ * CA 95054 USA or visit www.sun.com if you need additional information or ++ * have any questions. ++ */ ++ ++package com.sun.tools.classfile; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***