Bug 541591 - IllegalArgumentException in ASTRewrite on content assist
Summary: IllegalArgumentException in ASTRewrite on content assist
Status: CLOSED DUPLICATE of bug 541586
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.9   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Fabian Pfaff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-27 05:32 EST by Andrey Loskutov CLA
Modified: 2019-02-26 04:10 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2018-11-27 05:32:30 EST
Follow up on bug 541586.

Content assist on the static method call hello2() in the code below throws IAE :

public class X {
	void hello1() {
		hello1();
		hello2();
	}
	
	static void hello2() {
		hello2();
	}
}

The code in question is coming from bug 197850 and tries to compute static imports.

!MESSAGE Exception while processing quick fixes or quick assists
!STACK 0
java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.remove(ASTRewrite.java:378)
	at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getAddStaticImportProposals(QuickAssistProcessor.java:4127)
	at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getAssists(QuickAssistProcessor.java:339)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeAssistCollector.safeRun(JavaCorrectionProcessor.java:412)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:347)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:336)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectAssists(JavaCorrectionProcessor.java:518)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectProposals(JavaCorrectionProcessor.java:294)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeQuickAssistProposals(JavaCorrectionProcessor.java:249)
	at org.eclipse.jface.text.quickassist.QuickAssistAssistant$ContentAssistProcessor.computeCompletionProposals(QuickAssistAssistant.java:71)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2014)
	at java.util.Collections$SingletonSet.forEach(Collections.java:4767)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2013)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2010)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:503)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:498)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1824)
	at org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(QuickAssistAssistant.java:112)
	at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibleQuickAssists(JavaCorrectionAssistant.java:201)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:201)
Comment 1 Fabian Pfaff CLA 2018-11-27 23:03:30 EST
This was fixed with https://git.eclipse.org/r/c/133123/, right?
Comment 2 Fabian Pfaff CLA 2019-02-03 16:47:13 EST
Fixed by https://git.eclipse.org/r/#/c/133123/
Comment 3 Lars Vogel CLA 2019-02-26 04:10:12 EST
Fixed via Bug 541586

*** This bug has been marked as a duplicate of bug 541586 ***