objectionary / jeo-maven-plugin

This Maven plugin converts Java Bytecode binary files to EOLANG programs that use the "opcode" atom
https://www.objectionary.com/jeo-maven-plugin/
MIT License
11 stars 4 forks source link

broken `<meta>` in the output XMIR #912

Closed yegor256 closed 4 days ago

yegor256 commented 5 days ago

I'm using jeo:disassemble 0.6.22 and I'm getting this XMIR:

<meta>
  <head>package</head>
  <tail/>
  <part/>
</meta>

This is not a valid XMIR, since part can't be empty. Moreover, why tail is empty? Full story is here: https://github.com/objectionary/hone-maven-plugin/pull/127

yegor256 commented 5 days ago

@volodya-lombrozo please, help

volodya-lombrozo commented 5 days ago

@yegor256 Does your class have the package declaration?

volodya-lombrozo commented 5 days ago

@yegor256 I've checked the test and you don't have a package declaration:

.write("class Hello { double foo() { return Math.sin(42); } }".getBytes());

I guess you can add it and everything will work just fine:

.write("package org.eolang.hone;\n class Hello { double foo() { return Math.sin(42); } }".getBytes());
yegor256 commented 5 days ago

@volodya-lombrozo when package is not declared, don't put package meta in the XMIR. Very often we don't have packages, it's legal.

volodya-lombrozo commented 5 days ago

@rultor release, tag is 0.6.23, title is 0.6.23

rultor commented 5 days ago

@rultor release, tag is 0.6.23, title is 0.6.23

@volodya-lombrozo OK, I will release it now. Please check the progress here.

rultor commented 5 days ago

@rultor release, tag is 0.6.23, title is 0.6.23

@volodya-lombrozo Done! FYI, the full log is here (took me 16min).

volodya-lombrozo commented 5 days ago

@yegor256 Could you check the new version, please?

yegor256 commented 4 days ago

@volodya-lombrozo this problem is gone, thanks!