Closed laeubi closed 5 months ago
Can't proceed without a test case, but I will look into adding some instrumentation that would log which file and which method is being worked on when the error happened. That should help a bit.
reoccurrence of #1514, #1420
Similar symptoms and problem spots perhaps, but those are fixed with a reproducer. So this must be an at least slightly different cause.
As said I can't reproduce it directly it just "happened" while coding, maybe because there are some compile errors at the moment, for me the code looks like it should not perform an array copy without validate the node is of the correct type and just skip nodes that are not a statement (comments? don't know).
I think I got a reproducer now, clone the repository:
https://github.com/eclipse-tycho/tycho
then import tycho/tycho-core
project and go to SourceCodeAnalyzerPlugin.java
line 117 and place the cursor over getContained()
method:
analyzer.getContained().put(packageRef);
^
then press F3
and you will get an error popup
I think I got a reproducer now, clone the repository:
Perfect, thanks! I will try to get a fix in for M3, failing that certainly for RC1
For M3 it is too late, that schould be the build from last night.
Smaller test case:
public class X {
public static void main(String[] args) {
for (String sourcePath : args) {
new X() {
public void foo(String file) {
file.hashCode();
}
};
}
}
}
Placing the cursor on file
in the statement file.hashCode()
and pressing F3 triggers java.lang.ArrayStoreException: arraycopy: element type mismatch: can not cast one of the elements of org.eclipse.jdt.internal.compiler.ast.ASTNode[] to the type of the destination array, org.eclipse.jdt.internal.compiler.ast.Statement
Working on it ...
@srikanth-sankaran great you found a smaller reproducer :+1: a fix for RC1 would be great as it greatly degrades functionality.
@srikanth-sankaran great you found a smaller reproducer 👍 a fix for RC1 would be great as it greatly degrades functionality.
On the case. RC1 is very much the goal.
I'm not sure how to reproduce that but on some of my code getting the following exception when pressing
F3
:Exception
Eclipse Version