Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1797

ensure proxy-impl can work with ASM 6.1 plus

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: proxy-impl-1.1.2
    • Component/s: Proxy
    • Labels:
      None

      Description

      In asm 6.1, the GeneratorAdapter.case method changed to

      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(); 
              }          
            }
          }
        }
      
      

       

      Compared with previous version, it added a

      } else {
                throw new IllegalArgumentException(); 
              }          
      
      

      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

        Attachments

        1. ARIES-1797.patch
          4 kB
          Freeman Yue Fang

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              ffang Freeman Yue Fang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: