Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inner Classes Attribute Causes Compilation Errors #589

Closed
volodya-lombrozo opened this issue May 13, 2024 · 1 comment · Fixed by #590
Closed

Inner Classes Attribute Causes Compilation Errors #589

volodya-lombrozo opened this issue May 13, 2024 · 1 comment · Fixed by #590
Assignees
Labels
bug Something isn't working

Comments

@volodya-lombrozo
Copy link
Member

Despite that bytecode attributes are optional for bytecode execution, the absence of InnerClasses attributes causes compilation errors. I run spring-fat integration test in opeo-manen-plugin and faced with the following exception:

[INFO] --- compiler:3.10.1:testCompile (default-cli) @ opeo-spring-fat-it ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/lombrozo/Workspace/EOlang/opeo-maven-plugin/target/it/spring-fat/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/lombrozo/Workspace/EOlang/opeo-maven-plugin/target/it/spring-fat/src/test/java/org/eolang/jeo/spring/FactorialApplicationTest.java:[39,48] cannot find symbol
  symbol:   variable WebEnvironment
  location: @interface org.springframework.boot.test.context.SpringBootTest
[ERROR] /Users/lombrozo/Workspace/EOlang/opeo-maven-plugin/target/it/spring-fat/src/test/java/org/eolang/jeo/spring/FactorialApplicationTest.java:[39,63] an enum annotation value must be an enum constant
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

The content of FactorialApplicationTest.java is following:

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class FactorialApplicationTest {
// some code here
}

As you can see it uses SpringBootTest.WebEnvironment.RANDOM_PORT class. Actually it is the SpringBootTest class with the inner enum WebEnvironment. If I replace SpringBootTest which we disassembled/assembled with the original one (from jar), the compilation works correctly without any errors.

So I apply bytecode representation of failed SpringBootTest class and an original one:
failed.txt
working.txt

As you can see, the main difference in InnerClasses attributes. So most probably it is a cause of the bug.

@volodya-lombrozo volodya-lombrozo added the bug Something isn't working label May 13, 2024
@volodya-lombrozo volodya-lombrozo self-assigned this May 13, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
volodya-lombrozo added a commit to volodya-lombrozo/jeo-maven-plugin that referenced this issue May 14, 2024
@0pdd
Copy link

0pdd commented May 14, 2024

@volodya-lombrozo 5 puzzles #591, #592, #593, #594, #595 are still not solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants