Weird invalid Java error [message #1859703] |
Thu, 22 June 2023 18:28  |
Eclipse User |
|
|
|
Recently, some of our code suddenly started reporting errors. Code that hasn't changed in a long time.
Example: This line of code:
return new ArrayList<>(otherComponents.stream().filter(aComponent::isCutAndStack).toList());
Is getting this error:
The method toList() is undefined for the type Stream<aComponent>
I've cleaned all projects, exited eclipse, cleaned all projects, and it's still happening. I've also rebooted and cleaned again. There are 7 different lines of code that use toList() that are getting this error. We use toList() 115 times total.
Any suggestions on how to fix this?
|
|
|
|
|
|
|
Re: Weird invalid Java error [message #1859734 is a reply to message #1859721] |
Fri, 23 June 2023 12:23   |
Eclipse User |
|
|
|
Ok, now it's getting REALLY REALLY annoying.
I pulled the latest code and started Eclipse this morning. (the 1 line of code change was NOT in any of the relevant files.)
Eclipse came up, refreshed - and the error was gone.
I've been having Eclipse complaining about perfectly valid code, clean, shutdown, clean - and the problem is gone, happening at least once a week.
This is the first time it took being shutdown overnight to fix it.
Note that my system did NOT reboot last night.
Also, note that I did a ctrl-shift-T, and while "Stream" is defined by several different jars, there was only 1 from a JVM. (17)
I'm starting to wonder if all this is related to the "Eclipse can't guess/find the import" issue that I've seen. (and I see has been mentioned by other people.)
|
|
|
Re: Weird invalid Java error [message #1859759 is a reply to message #1859734] |
Mon, 26 June 2023 03:33  |
Eclipse User |
|
|
|
It's strange that a simple restart (especially after an overnight shutdown) would clear the error. This makes me suspect that there could be an issue with the Eclipse workspace's internal state getting corrupt, leading to these bizarre errors.
Here are a few things you might want to try:
1. Try running Eclipse with the '-clean' command line argument. This instructs Eclipse to clean its cached data used for quick startup, among other things.
2. You might want to try creating a new workspace and importing your projects into it. I know it's a bit of a hassle, but it could help if the issue is related to workspace corruption.
3. Check if there are any updates available for Eclipse that might address this issue. They usually fix such problems in new versions.
Regarding the "Eclipse can't guess/find the import" issue, it could be related, but without more specific details, it's hard to say for sure.
|
|
|
Powered by
FUDForum. Page generated in 0.07775 seconds