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

Error while compiling modular application #921

Closed
roman-kitko opened this issue Mar 28, 2023 · 6 comments
Closed

Error while compiling modular application #921

roman-kitko opened this issue Mar 28, 2023 · 6 comments

Comments

@roman-kitko
Copy link

Hello,
I am facing strange error while trying to compiler modularized project (module-info) in eclipse.
I have pushed the code to reproduce with into github repo : https://github.com/roman-kitko/vpda-eclipse-bug

How to reproduce :

  1. git clone https://github.com/roman-kitko/vpda-eclipse-bug.git
  2. In eclipse new workspace import all projects as existing maven project
  3. Press Alt + F5 (select all)to refresh and reload
  4. Go to class org.vpda.common.launcher.jetty.JettyLauncher
  5. Here you can see strange compiler errors
    Description Resource Path Location Type

The method execute(CommandExecutor, CommandExecutionEnv, CommandEvent) of type new Command(){} must override or implement a supertype method JettyLauncher.java /vpda-common-launcher-jetty/src/main/java/org/vpda/common/launcher/jetty line 177 Java Problem

  1. When you are in class and you just add few empty spaces and press CTRL+S for compile(repeat more times), now the error disappears.
  2. Can Again do full maven reload and the error will be there again

In maven command line, all can compile well

My eclipse detail :

Eclipse IDE for Java Developers (includes Incubating components)
Version: 2023-03 (4.27.0)
Build id: 20230309-1520
OS: Linux, v.5.10.0-21-amd64, x86_64 / gtk 3.24.24, WebKit 2.38.5
Java vendor: Debian
Java runtime version: 17.0.6+10-Debian-1deb11u1
Java version: 17.0.6

Thx for help
Roman

@iloveeclipse
Copy link
Member

Could you please try to reduce your problem to a small self contained project?
This would greatly speedup bug analysis.

Common approach to do so is to start removing all the unneeded dependencies and code around as long as error remains.

@roman-kitko
Copy link
Author

The repository I have created is only subset of the project.
I can try to remove unneeded modules.
But still do not expect like 2 modules.
Will do that Tomorrow, push changes and let you know

@iloveeclipse
Copy link
Member

Thanks. Reduce as much as you can, if that means two modules it's OK, it will be better than current state.

@roman-kitko
Copy link
Author

I reduced number of modules to 16.
What I also found, the problem is only in
JettyLauncher.registerShutdown method. If I clean its body (and java imports), the the error is gone.
Also when you do full maven reload and then you do several CTRL+S with dummy changes, you can get different compiler errors.

@roman-kitko
Copy link
Author

Screenshot from 2023-03-29 21-44-31

@roman-kitko
Copy link
Author

I am closing the issue.
I found workaround here.
The error occurs when using inner class or lamda expression, then type is not accessible. When using normal class, it works.

There is still some bug in compiler and 'build process is in-deterministic here, but it is pretty hard to simulate on smaller project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants