Re: [NETBEANS-3346] Upgrade asm to 5.2+
On Thu, 7 Nov 2019 at 22:28, Laszlo Kishalmi wrote: > When you create your PR for 7.2, please close this one in favor of that: > PR#1620 has been merged now, which is great news! Is everyone happy that no changes are needed to the processjsannotations ant task - this was discussed in the comments[1] to the PR but I wasn't clear if the matter had been concluded. Thanks Pete [1]: https://github.com/apache/netbeans/pull/1620#discussion_r345766432
Re: [NETBEANS-3346] Upgrade asm to 5.2+
I do not have privileges to close the PR https://github.com/apache/netbeans/pull/1108 Jose Contreras El jue., 7 nov. 2019 a las 17:20, Jose Ch () escribió: > I will, thanks for bringing it to my attention. > > Jose Contreras > > El jue., 7 nov. 2019 a las 16:28, Laszlo Kishalmi (< > laszlo.kisha...@gmail.com>) escribió: > >> When you create your PR for 7.2, please close this one in favor of that: >> https://github.com/apache/netbeans/pull/1108 >> >> >> On 11/7/19 1:41 PM, Jose Ch wrote: >> > Thanks for your help Peter. >> > >> > I tested the PR and it works for both the asm5.2 and the asm7.2 >> branches. I >> > also compare the output from the original asm5.0.1 with the new ones >> > (ams5.2-asm7.2) and it was the same. >> > >> > I also tested using ASM API v6 & v7, the output was the same and I >> worked >> > without problems my daily projects. I will prepare the PR today. >> > >> > Jose Contreras >> > >> > El jue., 7 nov. 2019 a las 3:58, Peter Hull () >> > escribió: >> > >> >> On Wed, 6 Nov 2019 at 22:24, Jose Ch wrote: >> >>> I will test the PR and do as you suggest Pete. >> >> For what it's worth my implementation was a bit different: >> >> private static class CtorDelVisitor extends AnnotationVisitor { >> >> int[] indices; >> >> /** >> >> * 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 AnnotationVisitor visitArray(String name) { >> >> if ("delegateParams".equals(name)) { // NOI18N >> >> return new AnnotationVisitor(api) { >> >> List list = new ArrayList<>(); >> >> @Override >> >> public void visit(String name, Object value) { >> >> list.add((Integer) value); >> >> } >> >> @Override >> >> public void visitEnd() { >> >> int[] indices = new int[list.size()]; >> >> for (int i = 0; i < indices.length; ++i) { >> >> indices[i] = list.get(i); >> >> } >> >> CtorDelVisitor.this.indices = indices; >> >> } >> >> }; >> >> } else { >> >> return super.visitArray(name); // Not interested >> >> } >> >> } >> >> } >> >> I guess Svata's will be more efficient. >> >> >> >> It's a bit frustrating that the AnnotationNode forces us to visit each >> >> array element in turn when all we need is the complete list, but I >> think >> >> there's no way around that. Visitor pattern makes my head spin, it >> always >> >> seems inside-out to me. >> >> >> >> Pete >> >> >> >> - >> To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org >> For additional commands, e-mail: dev-h...@netbeans.apache.org >> >> For further information about the NetBeans mailing lists, visit: >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists >> >> >> >>
Re: [NETBEANS-3346] Upgrade asm to 5.2+
I will, thanks for bringing it to my attention. Jose Contreras El jue., 7 nov. 2019 a las 16:28, Laszlo Kishalmi (< laszlo.kisha...@gmail.com>) escribió: > When you create your PR for 7.2, please close this one in favor of that: > https://github.com/apache/netbeans/pull/1108 > > > On 11/7/19 1:41 PM, Jose Ch wrote: > > Thanks for your help Peter. > > > > I tested the PR and it works for both the asm5.2 and the asm7.2 > branches. I > > also compare the output from the original asm5.0.1 with the new ones > > (ams5.2-asm7.2) and it was the same. > > > > I also tested using ASM API v6 & v7, the output was the same and I worked > > without problems my daily projects. I will prepare the PR today. > > > > Jose Contreras > > > > El jue., 7 nov. 2019 a las 3:58, Peter Hull () > > escribió: > > > >> On Wed, 6 Nov 2019 at 22:24, Jose Ch wrote: > >>> I will test the PR and do as you suggest Pete. > >> For what it's worth my implementation was a bit different: > >> private static class CtorDelVisitor extends AnnotationVisitor { > >> int[] indices; > >> /** > >> * 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 AnnotationVisitor visitArray(String name) { > >> if ("delegateParams".equals(name)) { // NOI18N > >> return new AnnotationVisitor(api) { > >> List list = new ArrayList<>(); > >> @Override > >> public void visit(String name, Object value) { > >> list.add((Integer) value); > >> } > >> @Override > >> public void visitEnd() { > >> int[] indices = new int[list.size()]; > >> for (int i = 0; i < indices.length; ++i) { > >> indices[i] = list.get(i); > >> } > >> CtorDelVisitor.this.indices = indices; > >> } > >> }; > >> } else { > >> return super.visitArray(name); // Not interested > >> } > >> } > >> } > >> I guess Svata's will be more efficient. > >> > >> It's a bit frustrating that the AnnotationNode forces us to visit each > >> array element in turn when all we need is the complete list, but I think > >> there's no way around that. Visitor pattern makes my head spin, it > always > >> seems inside-out to me. > >> > >> Pete > >> > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
Re: [NETBEANS-3346] Upgrade asm to 5.2+
When you create your PR for 7.2, please close this one in favor of that: https://github.com/apache/netbeans/pull/1108 On 11/7/19 1:41 PM, Jose Ch wrote: Thanks for your help Peter. I tested the PR and it works for both the asm5.2 and the asm7.2 branches. I also compare the output from the original asm5.0.1 with the new ones (ams5.2-asm7.2) and it was the same. I also tested using ASM API v6 & v7, the output was the same and I worked without problems my daily projects. I will prepare the PR today. Jose Contreras El jue., 7 nov. 2019 a las 3:58, Peter Hull () escribió: On Wed, 6 Nov 2019 at 22:24, Jose Ch wrote: I will test the PR and do as you suggest Pete. For what it's worth my implementation was a bit different: private static class CtorDelVisitor extends AnnotationVisitor { int[] indices; /** * 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 AnnotationVisitor visitArray(String name) { if ("delegateParams".equals(name)) { // NOI18N return new AnnotationVisitor(api) { List list = new ArrayList<>(); @Override public void visit(String name, Object value) { list.add((Integer) value); } @Override public void visitEnd() { int[] indices = new int[list.size()]; for (int i = 0; i < indices.length; ++i) { indices[i] = list.get(i); } CtorDelVisitor.this.indices = indices; } }; } else { return super.visitArray(name); // Not interested } } } I guess Svata's will be more efficient. It's a bit frustrating that the AnnotationNode forces us to visit each array element in turn when all we need is the complete list, but I think there's no way around that. Visitor pattern makes my head spin, it always seems inside-out to me. Pete - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [NETBEANS-3346] Upgrade asm to 5.2+
Thanks for your help Peter. I tested the PR and it works for both the asm5.2 and the asm7.2 branches. I also compare the output from the original asm5.0.1 with the new ones (ams5.2-asm7.2) and it was the same. I also tested using ASM API v6 & v7, the output was the same and I worked without problems my daily projects. I will prepare the PR today. Jose Contreras El jue., 7 nov. 2019 a las 3:58, Peter Hull () escribió: > On Wed, 6 Nov 2019 at 22:24, Jose Ch wrote: > > > > I will test the PR and do as you suggest Pete. > For what it's worth my implementation was a bit different: > private static class CtorDelVisitor extends AnnotationVisitor { > int[] indices; > /** > * 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 AnnotationVisitor visitArray(String name) { > if ("delegateParams".equals(name)) { // NOI18N > return new AnnotationVisitor(api) { > List list = new ArrayList<>(); > @Override > public void visit(String name, Object value) { > list.add((Integer) value); > } > @Override > public void visitEnd() { > int[] indices = new int[list.size()]; > for (int i = 0; i < indices.length; ++i) { > indices[i] = list.get(i); > } > CtorDelVisitor.this.indices = indices; > } > }; > } else { > return super.visitArray(name); // Not interested > } > } > } > I guess Svata's will be more efficient. > > It's a bit frustrating that the AnnotationNode forces us to visit each > array element in turn when all we need is the complete list, but I think > there's no way around that. Visitor pattern makes my head spin, it always > seems inside-out to me. > > Pete >
Re: [NETBEANS-3346] Upgrade asm to 5.2+
On Wed, 6 Nov 2019 at 22:24, Jose Ch wrote: > > I will test the PR and do as you suggest Pete. For what it's worth my implementation was a bit different: private static class CtorDelVisitor extends AnnotationVisitor { int[] indices; /** * 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 AnnotationVisitor visitArray(String name) { if ("delegateParams".equals(name)) { // NOI18N return new AnnotationVisitor(api) { List list = new ArrayList<>(); @Override public void visit(String name, Object value) { list.add((Integer) value); } @Override public void visitEnd() { int[] indices = new int[list.size()]; for (int i = 0; i < indices.length; ++i) { indices[i] = list.get(i); } CtorDelVisitor.this.indices = indices; } }; } else { return super.visitArray(name); // Not interested } } } I guess Svata's will be more efficient. It's a bit frustrating that the AnnotationNode forces us to visit each array element in turn when all we need is the complete list, but I think there's no way around that. Visitor pattern makes my head spin, it always seems inside-out to me. Pete
Re: [NETBEANS-3346] Upgrade asm to 5.2+
I will test the PR and do as you suggest Pete. El mié., 6 nov. 2019 a las 14:56, Peter Hull () escribió: > On Wed, 6 Nov 2019 at 20:38, Svata Dedic > wrote: > > Yes, that was it. You probably didn't do "ant clean" (neither did I). > Right. > > The NPE should be fixed by > > https://github.com/pepness/incubator-netbeans/pull/2 > Right again! > > I just opened up my mail to post my progress, great to see you'd > already solved it! > > However: > 1. Would it be better to jump straight to the latest Asm (7.2) - i.e. > put in a PR against Jose's asm72 branch > 2. There is a also a commit titled "Add logging" on that branch, and > the asm72 branch, which is certainly not wanted. > > So maybe Jose can pull yours, rebase and then put in a PR against > apache/netbeans? > > Pete > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
Re: [NETBEANS-3346] Upgrade asm to 5.2+
On Wed, 6 Nov 2019 at 20:38, Svata Dedic wrote: > Yes, that was it. You probably didn't do "ant clean" (neither did I). Right. > The NPE should be fixed by > https://github.com/pepness/incubator-netbeans/pull/2 Right again! I just opened up my mail to post my progress, great to see you'd already solved it! However: 1. Would it be better to jump straight to the latest Asm (7.2) - i.e. put in a PR against Jose's asm72 branch 2. There is a also a commit titled "Add logging" on that branch, and the asm72 branch, which is certainly not wanted. So maybe Jose can pull yours, rebase and then put in a PR against apache/netbeans? Pete - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [NETBEANS-3346] Upgrade asm to 5.2+
Dne 06. 11. 19 v 16:17 Peter Hull napsal(a): On Wed, 6 Nov 2019 at 15:13, Jose Ch wrote: For some reason I've got both 7.2 and 5.0.1 on the startup classpath - Yes, that was it. You probably didn't do "ant clean" (neither did I). The NPE should be fixed by https://github.com/pepness/incubator-netbeans/pull/2 -S. - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [NETBEANS-3346] Upgrade asm to 5.2+
On Wed, 6 Nov 2019 at 15:13, Jose Ch wrote: > Could you verify that in the line 300 (Startup Classpath) it is using the asm > version 5.2 or above? For some reason I've got both 7.2 and 5.0.1 on the startup classpath - I will do a clean & rebuild then report back to you. Pete Startup Classpath = D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\asm-7.2.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\asm-all-5.0.1.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\asm-tree-7.2.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\core-base.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\core.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\org-netbeans-libs-asm.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\org-openide-filesystems-compat8.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\platform\core\org-openide-filesystems.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\nb\core\org-netbeans-upgrader.jar;D:\Libraries\Documents\NetBeansProjects\netbeans\nbbuild\netbeans\nb\core\locale\core_nb.jar - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [NETBEANS-3346] Upgrade asm to 5.2+
Hi Peter, Could you verify that in the line 300 (Startup Classpath) it is using the asm version 5.2 or above? Besides adding logging to the Asm.java class it is needed to upgrade the asm library: For asm version 5.2: https://github.com/pepness/incubator-netbeans/commit/d021ead0db491b74eee7c680c240da4649f62275 For asm version 7.2: https://github.com/pepness/incubator-netbeans/commit/c69a4e55c8bd683b76ff334b054583eba2209364 https://github.com/pepness/incubator-netbeans/commit/52dd473138cc8d1c43861008ea95f4287d29eddc (Fixed a typo in a config file) I am using Fedora 31 with JDK Zulu 11.0.5. Regards. Jose Contreras El mié., 6 nov. 2019 a las 7:01, Peter Hull () escribió: > On Wed, 6 Nov 2019 at 00:42, Jose Ch wrote: > > I tried to upgrade the asm-all-5.0.1 library to the latest version 7.2 > and received a nullPointerException (line 774 of asm-52 & asm-72 files). I > already successfully upgrade it to version 5.1 ( > https://issues.apache.org/jira/browse/NETBEANS-3341). > I tried to reproduce this but couldn't; I took the current NB source > and pulled the asm72 branch of your fork. When I started up the IDE in > debug mode I didn't get any null pointer exceptions and in the log I > saw something different from your asm-72.log file at the point you > mentioned (line 752 in your log). > You had > > INFO [org.netbeans.core.startup.Asm]: patch(128) AnnotationNode > an.values: [delegateParams, [1, 2, 3]] > I got > > INFO [org.netbeans.core.startup.Asm]: patch(128) AnnotationNode > an.values: [delegateParams, [I@2fac9730] > > Have you any more info on how to reproduce? > > Peter > > - > To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org > For additional commands, e-mail: dev-h...@netbeans.apache.org > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [NETBEANS-3346] Upgrade asm to 5.2+
On Wed, 6 Nov 2019 at 00:42, Jose Ch wrote: > I tried to upgrade the asm-all-5.0.1 library to the latest version 7.2 and > received a nullPointerException (line 774 of asm-52 & asm-72 files). I > already successfully upgrade it to version 5.1 > (https://issues.apache.org/jira/browse/NETBEANS-3341). I tried to reproduce this but couldn't; I took the current NB source and pulled the asm72 branch of your fork. When I started up the IDE in debug mode I didn't get any null pointer exceptions and in the log I saw something different from your asm-72.log file at the point you mentioned (line 752 in your log). You had > INFO [org.netbeans.core.startup.Asm]: patch(128) AnnotationNode > an.values: [delegateParams, [1, 2, 3]] I got > INFO [org.netbeans.core.startup.Asm]: patch(128) AnnotationNode > an.values: [delegateParams, [I@2fac9730] Have you any more info on how to reproduce? Peter - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists