Re: ASM 8.0 released

Vicente Romero <[email protected]> Mon, 30 Mar 2020 21:14:35 -0400
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1585620873-26399-26
Content-Type: multipart/alternative;
 boundary="------------558D7AF247ACE7ACBBF63B28"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------558D7AF247ACE7ACBBF63B28
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Thanks for publishing this version, it is great to see it supporting 
records, yay! I was testing it to include it in JDK 15 and I think I 
found a bug which is related to records with no record components as in:

$ cat R.java
record R() {}

if we compile this record with javac we will see in javap's output an 
empty `Record` attribute but lets say we use the simplest ASM client as in:

import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;

public class ASMRecordTest {
     public static void main(final String args[]) throws Exception {
         FileInputStream is = new FileInputStream(args[0]);

         ClassReader cr = new ClassReader(is);
         ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
         cr.accept(cw, 0);

         FileOutputStream fos = new FileOutputStream(args[1]);
         fos.write(cw.toByteArray());
         fos.close();
     }
}

if this program is invoked with arguments: /path/to/R.class 
/path/to/R2.class we will see that R2.class is missing the `Record` 
attribute. The issue in the current code in ASM is that no record 
attribute will be written unless there is at least one record component.

Thanks,
Vicente

On 3/28/20 8:07 AM, [email protected] wrote:
> Release notes:
> - Java 14 support (RecordComponent)
> - bug fixes
>    * 317896: Performance degradation when using dynamic constants as a static parameter to another InDy/ConDy
>
> The ASM team
>


--------------558D7AF247ACE7ACBBF63B28
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    Thanks for publishing this version, it is great to see it supporting
    records, yay! I was testing it to include it in JDK 15 and I think I
    found a bug which is related to records with no record components as
    in:<br>
    <br>
    $ cat R.java<br>
    record R() {}<br>
    <br>
    if we compile this record with javac we will see in javap's output
    an empty `Record` attribute but lets say we use the simplest ASM
    client as in:<br>
    <br>
    import java.io.FileInputStream;<br>
    import java.io.FileOutputStream;<br>
    <br>
    import org.objectweb.asm.ClassReader;<br>
    import org.objectweb.asm.ClassWriter;<br>
    <br>
    public class ASMRecordTest {<br>
        public static void main(final String args[]) throws Exception {<br>
            FileInputStream is = new FileInputStream(args[0]);<br>
    <br>
            ClassReader cr = new ClassReader(is);<br>
            ClassWriter cw = new
    ClassWriter(ClassWriter.COMPUTE_FRAMES);<br>
            cr.accept(cw, 0);<br>
    <br>
            FileOutputStream fos = new FileOutputStream(args[1]);<br>
            fos.write(cw.toByteArray());<br>
            fos.close();<br>
        }<br>
    }<br>
    <br>
    if this program is invoked with arguments: /path/to/R.class
    /path/to/R2.class we will see that R2.class is missing the `Record`
    attribute. The issue in the current code in ASM is that no record
    attribute will be written unless there is at least one record
    component.<br>
    <br>
    Thanks,<br>
    Vicente<br>
    <br>
    <div class="moz-cite-prefix">On 3/28/20 8:07 AM, <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:1661375377.158900451.1585397255081.JavaMail.root@zimbra73-e12.priv.proxad.net">
      <pre class="moz-quote-pre" wrap="">Release notes:
- Java 14 support (RecordComponent)
- bug fixes
  * 317896: Performance degradation when using dynamic constants as a static parameter to another InDy/ConDy

The ASM team
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------558D7AF247ACE7ACBBF63B28--

------------=_1585620873-26399-26
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit


-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

------------=_1585620873-26399-26--