Community
Participate
Working Groups
I200403161300 + new code to use AST on reconcile I saw this in .log but have no steps to reproduce: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.NumberLiteral.setToken(NumberLiteral.java:184) at org.eclipse.jdt.core.dom.AST.newNumberLiteral(AST.java:2603) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1369) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:873) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2028) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1794) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:758) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:330) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:268) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:146) at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:233) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:77) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:700) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:739) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1043) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:75) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:129) at org.eclipse.jface.text.reconciler.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:111) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:123) at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:104) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:155)
We need a test case for this one. It looks like the DOM/AST is created on a compilation unit that has a number literal that starts with - followed by something else than TerminalTokens.TokenNameDoubleLiteral, TerminalTokens.TokenNameIntegerLiteral, TerminalTokens.TokenNameFloatingPointLiteral, or TerminalTokens.TokenNameLongLiteral. This is not legal and this is why it is failing. I need a test case to find out why we do end up creating the DOM/AST in this case.
As stated in my initial comment I have no steps. I assume that as soon as we release our code to use reconcile(true, ...) we will see more of those.
*** Bug 56228 has been marked as a duplicate of this bug. ***
I added extra logging in HEAD to track this one down. Could it be possible that the working copy contents changes during the conversion?
I think the problem is coming from the ReconcileWorkingCopyOperation. Line 73 a compilation unit is built using the source of the working copy. The source is retrieved again line 77. The problem is that between these two lines the source might have changed. And this could lead to such errors while converting the compilation unit. The same source has to be used for the creation of the compilation unit AND the conversion of the same compilation unit. Jerome, what do you think?
*** Bug 56906 has been marked as a duplicate of this bug. ***
Thanks Olivier. Changed ReconcileWorkingCopyOperation.executeOperation() and Compilation.buildStructure(...) to pass in the same contents to the problem finder and to the AST converter.
Verified for 3.0 M9 with build I200405180816. Note that comment 7 should read: CompilationUnit.buildStructure(...) - in org.eclipse.jdt.internal.core package - instead of Compilation.buildStructure(...)