This is an automated email from the ASF dual-hosted git repository. sdedic pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push: new 7eb2c43 [NETBEANS-3346] -Upgrade asm-all-5.0.1 version to asm-7.2 -Add constructor parameter to use ASMv7 API -Visit @ConstructorDelegate parameters as array. (by sdedic) -Use only one license file for both jars new ef55a1a Merge pull request #1620 from pepness/asm72v3 7eb2c43 is described below commit 7eb2c431c259e1b5eb37cc6061e8d23c2329778a Author: Jose Contreras <pepnes...@gmail.com> AuthorDate: Thu Nov 7 18:50:53 2019 -0600 [NETBEANS-3346] -Upgrade asm-all-5.0.1 version to asm-7.2 -Add constructor parameter to use ASMv7 API -Visit @ConstructorDelegate parameters as array. (by sdedic) -Use only one license file for both jars --- .../javaee/wildfly/WildflyDeploymentFactory.java | 2 +- harness/apisupport.harness/build.xml | 4 +- .../netbeans/lib/jshell/agent/NbJShellAgent.java | 4 +- java/lib.jshell.agent/nbproject/project.properties | 2 +- nbbuild/templates/common.xml | 6 +- .../src/org/netbeans/core/startup/Asm.java | 67 ++++++++++++++++++---- ...m-all-5.0.1-license.txt => asm-7.2-license.txt} | 16 +++--- platform/libs.asm/external/binaries-list | 3 +- platform/libs.asm/nbproject/project.properties | 7 ++- platform/libs.asm/nbproject/project.xml | 16 ++---- 10 files changed, 83 insertions(+), 44 deletions(-) diff --git a/contrib/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentFactory.java b/contrib/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentFactory.java index 01e3246..4068b8c 100644 --- a/contrib/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentFactory.java +++ b/contrib/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/WildflyDeploymentFactory.java @@ -153,7 +153,7 @@ public class WildflyDeploymentFactory implements DeploymentFactory { return super.getCommonSuperClass(string, string1); } }; - ClassNode node = new ClassNode(); + ClassNode node = new ClassNode(Opcodes.ASM7); cr.accept(node, 0); for (MethodNode m : (Collection<MethodNode>) node.methods) { diff --git a/harness/apisupport.harness/build.xml b/harness/apisupport.harness/build.xml index 548620f..d97a498 100644 --- a/harness/apisupport.harness/build.xml +++ b/harness/apisupport.harness/build.xml @@ -39,13 +39,13 @@ <pathelement location="${cluster}/tasks.jar"></pathelement> </classpath> </taskdef> - <echo file="build/binaries-list">2F7553F50B0D14ED811B849C282DA8C1FFC32AAE org.ow2.asm:asm-all:5.0.1</echo> + <echo file="build/binaries-list">FA637EB67EB7628C915D73762B681AE7FF0B9731 org.ow2.asm:asm:7.2</echo> <TestDownload> <manifest dir="build"> <include name="binaries-list"/> </manifest> </TestDownload> - <delete file="build/asm-all-5.0.1.jar"/> + <delete file="build/asm-7.2.jar"/> </target> <target name="compile-jnlp-launcher" depends="init,compile"> diff --git a/java/lib.jshell.agent/agentsrc/org/netbeans/lib/jshell/agent/NbJShellAgent.java b/java/lib.jshell.agent/agentsrc/org/netbeans/lib/jshell/agent/NbJShellAgent.java index 7282ae2..8fd0ee3 100644 --- a/java/lib.jshell.agent/agentsrc/org/netbeans/lib/jshell/agent/NbJShellAgent.java +++ b/java/lib.jshell.agent/agentsrc/org/netbeans/lib/jshell/agent/NbJShellAgent.java @@ -377,7 +377,7 @@ public class NbJShellAgent implements Runnable, ClassFileTransformer { */ private void insertClassInit(String className, ClassNode target) { // method void static clinit() - MethodNode clinit = new MethodNode(Opcodes.ASM5, + MethodNode clinit = new MethodNode(Opcodes.ASM7, Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC, CLASS_INIT_NAME, CLASS_INIT_DESC, @@ -400,7 +400,7 @@ public class NbJShellAgent implements Runnable, ClassFileTransformer { istm = new ByteArrayInputStream(classfileBuffer); ClassReader reader = new ClassReader(istm); ClassWriter wr = new ClassWriter(reader, 0); - ClassNode clazz = new ClassNode(); + ClassNode clazz = new ClassNode(Opcodes.ASM7); reader.accept(clazz, 0); boolean found = false; diff --git a/java/lib.jshell.agent/nbproject/project.properties b/java/lib.jshell.agent/nbproject/project.properties index 6641c35..0020ac6 100644 --- a/java/lib.jshell.agent/nbproject/project.properties +++ b/java/lib.jshell.agent/nbproject/project.properties @@ -21,5 +21,5 @@ javac.compilerargs=-Xlint -Xlint:-serial extra.module.files=modules/ext/nb-custom-jshell-probe.jar,modules/ext/nb-mod-jshell-probe.jar jnlp.indirect.jars=modules/ext/nb-custom-jshell-probe.jar,modules/ext/nb-mod-jshell-probe.jar -agentsrc.asm.cp=${libs.asm.dir}/core/asm-all-5.0.1.jar +agentsrc.asm.cp=${libs.asm.dir}/core/asm-7.2.jar agentsrc.jshell.cp=${nb_all}/java/libs.jshell.compile/external/jshell-9.jar diff --git a/nbbuild/templates/common.xml b/nbbuild/templates/common.xml index e917424..8983eee 100644 --- a/nbbuild/templates/common.xml +++ b/nbbuild/templates/common.xml @@ -78,10 +78,10 @@ <tstamp> <format property="module.build.started.time" pattern="yyyy-MM-dd'T'HH:mm:ss.SSSZ"/> </tstamp> - <condition property="asm.jar" value="${nbplatform.active.dir}/platform/core/asm-all-5.0.1.jar"> - <available file="${nbplatform.active.dir}/platform/core/asm-all-5.0.1.jar"/> + <condition property="asm.jar" value="${nbplatform.active.dir}/platform/core/asm-7.2.jar"> + <available file="${nbplatform.active.dir}/platform/core/asm-7.2.jar"/> </condition> - <property name="asm.jar" location="${platform/libs.asm.dir}/core/asm-all-5.0.1.jar"/> + <property name="asm.jar" location="${platform/libs.asm.dir}/core/asm-7.2.jar"/> </target> <target name="-release.dir"> diff --git a/platform/core.startup/src/org/netbeans/core/startup/Asm.java b/platform/core.startup/src/org/netbeans/core/startup/Asm.java index 6bc6af9..e752bdb 100644 --- a/platform/core.startup/src/org/netbeans/core/startup/Asm.java +++ b/platform/core.startup/src/org/netbeans/core/startup/Asm.java @@ -57,7 +57,7 @@ final class Asm { // must analyze the extender class, as some annotations there may trigger ClassReader clr = new ClassReader(data); ClassWriter wr = new ClassWriter(clr, 0); - ClassNode theClass = new ClassNode(); + ClassNode theClass = new ClassNode(Opcodes.ASM7); clr.accept(theClass, 0); @@ -74,7 +74,7 @@ final class Asm { throw new IOException("Could not find classfile for extender class"); // NOI18N } ClassReader extenderReader = new ClassReader(istm); - ClassNode extenderClass = new ClassNode(); + ClassNode extenderClass = new ClassNode(Opcodes.ASM7); extenderReader.accept(extenderClass, ClassReader.SKIP_FRAMES); // search for a no-arg ctor, replace all invokespecial calls in ctors @@ -145,7 +145,7 @@ final class Asm { */ private static class NullSignVisitor extends SignatureVisitor { public NullSignVisitor() { - super(Opcodes.ASM5); + super(Opcodes.ASM7); } } @@ -168,13 +168,13 @@ final class Asm { * @param firstSelf if true, assumes the first parameter is reference to self and will generate aload_0 */ public CallParametersWriter(MethodNode mn, boolean firstSelf) { - super(Opcodes.ASM5); + super(Opcodes.ASM7); this.mn = mn; this.paramIndex = firstSelf ? 0 : 1; } public CallParametersWriter(MethodNode mn, int[] indices) { - super(Opcodes.ASM5); + super(Opcodes.ASM7); this.mn = mn; this.paramIndices = indices; } @@ -291,20 +291,65 @@ final class Asm { } + /** + * @@author Svatopluk Dedic + */ private static class CtorDelVisitor extends AnnotationVisitor { - int[] indices; - - public CtorDelVisitor(int i) { - super(i); + + int[] indices; + int pos; + int level; + + /** + * Constructs a new {@link AnnotationVisitor}. + * + * @param api the ASM API version implemented by this visitor. Must be one of {@link + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + */ + public CtorDelVisitor(int api) { + super(api); } @Override public void visit(String string, Object o) { + if (level > 0) { + if (pos >= indices.length) { + indices = Arrays.copyOf(indices, indices.length * 2); + } + indices[pos++] = (Integer)o; + super.visit(string, o); + return; + } if ("delegateParams".equals(string)) { // NOI18N indices = (int[])o; } super.visit(string, o); } + + @Override + public void visitEnd() { + if (level > 0) { + if (--level == 0) { + if (pos < indices.length) { + indices = Arrays.copyOf(indices, pos); + } + } + } + super.visitEnd(); + } + + @Override + public AnnotationVisitor visitArray(String string) { + if ("delegateParams".equals(string)) { // NOI18N + indices = new int[4]; + pos = 0; + level++; + return this; + } else { + return super.visitArray(string); + } + } + } private static String[] splitDescriptor(String desc) { @@ -342,11 +387,11 @@ final class Asm { MethodNode noArgCtor ) { String desc = targetMethod.desc; - CtorDelVisitor v = new CtorDelVisitor(Opcodes.ASM5); + CtorDelVisitor v = new CtorDelVisitor(Opcodes.ASM7); an.accept(v); int nextPos = desc.indexOf(';', 2); // NOI18N desc = "(" + desc.substring(nextPos + 1); // NOI18N - MethodNode mn = new MethodNode(Opcodes.ASM5, + MethodNode mn = new MethodNode(Opcodes.ASM7, targetMethod.access & (~Opcodes.ACC_STATIC), CONSTRUCTOR_NAME, desc, targetMethod.signature, diff --git a/platform/libs.asm/external/asm-all-5.0.1-license.txt b/platform/libs.asm/external/asm-7.2-license.txt old mode 100644 new mode 100755 similarity index 76% rename from platform/libs.asm/external/asm-all-5.0.1-license.txt rename to platform/libs.asm/external/asm-7.2-license.txt index bbcb7bc..c764c92 --- a/platform/libs.asm/external/asm-all-5.0.1-license.txt +++ b/platform/libs.asm/external/asm-7.2-license.txt @@ -1,8 +1,9 @@ Name: OW2 ASM -Version: 5.0.1 +Version: 7.2 +Files: asm-tree-7.2.jar asm-7.2.jar License: BSD-INRIA Origin: OW2 Consortium -URL: http://forge.ow2.org/project/download.php?group_id=23&file_id=19789 +URL: https://repository.ow2.org/nexus/content/repositories/releases/org/ow2/asm/ Description: Bytecode manipulation library ******************************************************************************* @@ -14,13 +15,13 @@ Description: Bytecode manipulation library * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. +* notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its -* contributors may be used to endorse or promote products derived from -* this software without specific prior written permission. +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -34,4 +35,3 @@ Description: Bytecode manipulation library * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* - diff --git a/platform/libs.asm/external/binaries-list b/platform/libs.asm/external/binaries-list old mode 100644 new mode 100755 index 5986385..e0daa6f --- a/platform/libs.asm/external/binaries-list +++ b/platform/libs.asm/external/binaries-list @@ -14,4 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -2F7553F50B0D14ED811B849C282DA8C1FFC32AAE org.ow2.asm:asm-all:5.0.1 +FA637EB67EB7628C915D73762B681AE7FF0B9731 org.ow2.asm:asm:7.2 +3A23CC36EDAF8FC5A89CB100182758CCB5991487 org.ow2.asm:asm-tree:7.2 diff --git a/platform/libs.asm/nbproject/project.properties b/platform/libs.asm/nbproject/project.properties index 807b7c4..d822881 100644 --- a/platform/libs.asm/nbproject/project.properties +++ b/platform/libs.asm/nbproject/project.properties @@ -16,8 +16,9 @@ # under the License. javac.compilerargs=-Xlint -Xlint:-serial -javac.source=1.7 +javac.source=1.8 module.jar.dir=core -release.external/asm-all-5.0.1.jar=core/asm-all-5.0.1.jar -license.file=../external/asm-all-5.0.1-license.txt +release.external/asm-7.2.jar=core/asm-7.2.jar +release.external/asm-tree-7.2.jar=core/asm-tree-7.2.jar +license.file=../external/asm-7.2-license.txt diff --git a/platform/libs.asm/nbproject/project.xml b/platform/libs.asm/nbproject/project.xml index fd3a372..a4aa509 100644 --- a/platform/libs.asm/nbproject/project.xml +++ b/platform/libs.asm/nbproject/project.xml @@ -29,21 +29,13 @@ <subpackages>org</subpackages> </public-packages> <class-path-extension> - <runtime-relative-path>asm-all-5.0.1.jar</runtime-relative-path> - <binary-origin>external/asm-all-5.0.1.jar</binary-origin> - </class-path-extension> -<!-- <class-path-extension> - <runtime-relative-path>ext/asm-5.0.1/asm-5.0.1.jar</runtime-relative-path> - <binary-origin>external/asm-5.0.1.jar</binary-origin> + <runtime-relative-path>asm-7.2.jar</runtime-relative-path> + <binary-origin>external/asm-7.2.jar</binary-origin> </class-path-extension> <class-path-extension> - <runtime-relative-path>ext/asm-5.0.1/asm-commons-5.0.1.jar</runtime-relative-path> - <binary-origin>external/asm-commons-5.0.1.jar</binary-origin> + <runtime-relative-path>asm-tree-7.2.jar</runtime-relative-path> + <binary-origin>external/asm-tree-7.2.jar</binary-origin> </class-path-extension> - <class-path-extension> - <runtime-relative-path>ext/asm-5.0.1/asm-util-5.0.1.jar</runtime-relative-path> - <binary-origin>external/asm-util-5.0.1.jar</binary-origin> - </class-path-extension>--> </data> </configuration> </project> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists