You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2018/05/04 01:58:00 UTC
[jira] [Commented] (ARIES-1797) ensure proxy-impl can work with ASM
6.1 plus
[ https://issues.apache.org/jira/browse/ARIES-1797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16463282#comment-16463282 ]
Freeman Fang commented on ARIES-1797:
-------------------------------------
attached a suggested patch
> ensure proxy-impl can work with ASM 6.1 plus
> --------------------------------------------
>
> Key: ARIES-1797
> URL: https://issues.apache.org/jira/browse/ARIES-1797
> Project: Aries
> Issue Type: Improvement
> Reporter: Freeman Fang
> Priority: Major
> Attachments: ARIES-1797.patch
>
>
> In asm 6.1, the GeneratorAdapter.case method changed to
> {code:java}
> public void cast(final Type from, final Type to) {
> if (from != to) {
> if (from == Type.DOUBLE_TYPE) {
> if (to == Type.FLOAT_TYPE) {
> mv.visitInsn(Opcodes.D2F);
> } else if (to == Type.LONG_TYPE) {
> mv.visitInsn(Opcodes.D2L);
> } else {
> mv.visitInsn(Opcodes.D2I);
> cast(Type.INT_TYPE, to);
> }
> } else if (from == Type.FLOAT_TYPE) {
> if (to == Type.DOUBLE_TYPE) {
> mv.visitInsn(Opcodes.F2D);
> } else if (to == Type.LONG_TYPE) {
> mv.visitInsn(Opcodes.F2L);
> } else {
> mv.visitInsn(Opcodes.F2I);
> cast(Type.INT_TYPE, to);
> }
> } else if (from == Type.LONG_TYPE) {
> if (to == Type.DOUBLE_TYPE) {
> mv.visitInsn(Opcodes.L2D);
> } else if (to == Type.FLOAT_TYPE) {
> mv.visitInsn(Opcodes.L2F);
> } else {
> mv.visitInsn(Opcodes.L2I);
> cast(Type.INT_TYPE, to);
> }
> } else {
> if (to == Type.BYTE_TYPE) {
> mv.visitInsn(Opcodes.I2B);
> } else if (to == Type.CHAR_TYPE) {
> mv.visitInsn(Opcodes.I2C);
> } else if (to == Type.DOUBLE_TYPE) {
> mv.visitInsn(Opcodes.I2D);
> } else if (to == Type.FLOAT_TYPE) {
> mv.visitInsn(Opcodes.I2F);
> } else if (to == Type.LONG_TYPE) {
> mv.visitInsn(Opcodes.I2L);
> } else if (to == Type.SHORT_TYPE) {
> mv.visitInsn(Opcodes.I2S);
> } else {
> throw new IllegalArgumentException();
> }
> }
> }
> }
> {code}
>
> Compared with previous version, it added a
> {code:java}
> } else {
> throw new IllegalArgumentException();
> }
> {code}
> at the end, however, this break the current logic in proxy-impl, which if "cast" not take effect, can still go with "unbox", we should revise proxy-impl a bit to honor the change in ASM 6.1. Ensure proxy-impl can work with ASM 6.1 on the classpath or in the OSGi container
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)