Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 540950

Summary: [codemining] Setting new code mining providers can lead former ones to exception
Product: [Eclipse Project] Platform Reporter: Angelo ZERR <azerr>
Component: TextAssignee: Angelo ZERR <azerr>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mistria
Version: 4.8   
Target Milestone: 4.10 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/132166
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=f5e429604d63d8b053effc10503065c3eb00923c
Whiteboard:
Bug Depends on:    
Bug Blocks: 529127    

Description Angelo ZERR CLA 2018-11-09 03:18:57 EST
Today when code mining manager when new codemining provider are set (ex: when user changed some codemining preferences in JDT CodeMining), the old code mining manager is not uninstalled and sometimes old code mining provider are processes although there were disposed.

It causes 

To clean this behviour, we need to uninstall the old code mining manager before creating a new code mining manager.

And we can have some trouble like:

------------------------------------------------------
java.util.concurrent.CompletionException: org.eclipse.core.runtime.AssertionFailedException: null argument:
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:283)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1603)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Caused by: org.eclipse.core.runtime.AssertionFailedException: null argument:
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:88)
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:76)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.getEditorInputJavaElement(EditorUtility.java:450)
	at org.eclipse.jdt.internal.ui.javaeditor.codemining.JavaElementCodeMiningProvider.lambda$0(JavaElementCodeMiningProvider.java:78)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	... 4 more
------------------------------------------------------

See https://git.eclipse.org/r/#/c/126847/
Comment 1 Eclipse Genie CLA 2018-11-09 03:21:26 EST
New Gerrit change created: https://git.eclipse.org/r/132166
Comment 3 Mickael Istria CLA 2018-11-16 10:03:11 EST
This patch should fix it. Thanks Angelo!
Comment 4 Angelo ZERR CLA 2018-11-16 10:03:44 EST
Thanks a lot @Mickael!