Open garretwilson opened 1 year ago
@garretwilson : This smells very strongly like https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1195 and its half a dozen cousins listed there. Since the error message mentions
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.ast.IfStatement cannot be cast to class org.eclipse.jdt.internal.compiler.ast.LambdaExpression
I wish you had shared enough of context that mentions the if
and the lambda which are not to be encountered in the test case here or in https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1162
Was there pattern matching with instanceof in use ? Do you recall ? Can you check ? TIA
Do you recall ?
Unfortunately I don't recall much. As so much of my day nowadays is filled filing bugs, for the ones that I know will be hard to reproduce, I simply must move on to actual work or I'll never get anything done. I hope that at least reporting this will help in some way.
If I thought there was any chance of providing reproducible instructions I would have spent some time—I'm not just being lazy—but in many of these cases there are so many variables involved that it would not be realistic.
I'm hoping that perhaps if enough people file tickets like this it will help the Eclipse team start to see some patterns, or at least, as I mentioned, put some checks and logging in for future releases.
Sorry I couldn't be more help on this one.
With some of these autocomplete issues, if I close the file and reopen it, or use the same code in a different file, the bug does not reappear, for example.
@garretwilson : This smells very strongly like #1195 and its half a dozen cousins listed there. Since the error message mentions
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.ast.IfStatement cannot be cast to class org.eclipse.jdt.internal.compiler.ast.LambdaExpression
I wish you had shared enough of context that mentions the
if
and the lambda which are not to be encountered in the test case here or in #1162Was there pattern matching with instanceof in use ? Do you recall ? Can you check ? TIA
Having worked on #1195 which turned out to be a significant reimplementation of the code selection support for pattern matching constructs, I am less sure this is connected to #1195 - that defect has many duplicates - all of them involving a CCE but the node involved is a LocalDeclaration, here it is an IfStatement - so perhaps this is unrelated
I originally filed this ticket as eclipse-platform/eclipse.platform.ui#837.
I ran into a problem where Eclipse was incorrectly indicating that an exception should have a
catch
even though I was using sneaky throws. I filed that problem as #1162.However when I was trying to find a workaround to that problem, I started to add some
catch
es just to try to get the error to go away so I could determine how best to deal with it. Starting with the code in #1162, I did something like this:When I put my cursor after
ioEx
and hitCtrl+Space
to autocomplete to (I had hoped)ioException
, Eclipse threw a fit. (See error below.) Unfortunately I have not yet been able to reproduce the problem. I'm filing this ticket in hopes that looking at the stack trace can give you a clue to where the problem is, or at least put in additional logging to detect the cause in the future. When you're investigating #1162 you might keep your eyes open for something that might cause the problem, as they might (or might not) be related.