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

Bug 563158

Summary: JpaCompletionProposalComputer and JpaJpqlCompletionProposalComputer require UI Thread
Product: [WebTools] Dali JPA Tools Reporter: Vaclav Kadlcik <vkadlcik>
Component: JPAAssignee: Mickael Istria <mistria>
Status: CLOSED FIXED QA Contact: Nick Boldt <nboldt>
Severity: normal    
Priority: P3 CC: eclipse, Lars.Vogel, mat.booth, mcoufal, mistria, narayana.nekkanti, thatnitind, vrubezhny
Version: unspecified   
Target Milestone: 3.21   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/164508
https://git.eclipse.org/r/c/dali/webtools.dali/+/164508
https://git.eclipse.org/c/dali/webtools.dali.git/commit/?id=9a02ed70b75c126655fe862230b13e518ce8ff36
https://git.eclipse.org/r/c/dali/webtools.dali/+/176220
https://git.eclipse.org/c/dali/webtools.dali.git/commit/?id=fb7afb65e2dbc50df943b8cd5d19927b483dae97
Whiteboard:
Bug Depends on:    
Bug Blocks: 564526    
Attachments:
Description Flags
screenshot
none
Eclipse configuration (from About)
none
my Eclipse setup script (destructive!) none

Description Vaclav Kadlcik CLA 2020-05-14 04:32:30 EDT
Created attachment 282834 [details]
screenshot

Eclipse SimRel 2020-06 brings this new feature:

  Non-blocking Java code completion
  https://www.eclipse.org/eclipse/news/4.16/jdt.php#default-non-blocking-completion

However the feature is blocked by Dali Java Persistence Tools
JPA Support, see the attached screenshot.

My environment:
  * Fedora 32 (x84_64)
  * java-11-openjdk-devel-11.0.6.10-0.fc32.x86_64
  * Eclipse development builds:
    * Platform 4.16
    * JDT 3.18
    * org.eclipse.jpt.jpa.feature 3.6.0.v202002052252
I'll attach my full configuration and setup script.

Steps to reproduce
  1. Run Eclipse
  2. Windows > Preferences > Java > Editor > Content Assist
     > Advanced
  3. See the "Enable non-blocking completion"
Comment 1 Vaclav Kadlcik CLA 2020-05-14 04:33:29 EDT
Created attachment 282836 [details]
Eclipse configuration (from About)
Comment 2 Vaclav Kadlcik CLA 2020-05-14 04:34:29 EDT
Created attachment 282838 [details]
my Eclipse setup script (destructive!)
Comment 4 Mickael Istria CLA 2020-07-09 15:17:18 EDT
Thanks a lot for the review Nick!
Comment 5 Holger Voormann CLA 2020-09-04 04:45:49 EDT
Computing the JPA JPQL proposals is still blocking because of:
requiresUIThread="true"

https://git.eclipse.org/c/dali/webtools.dali.git/tree/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml?id=9a02ed70b75c126655fe862230b13e518ce8ff36#n175

The reason is given in the comment bellow:
"requires UI Thread because it dereferences getViewer() to utlimately ask StyledText.getData()"
Comment 6 Mickael Istria CLA 2020-09-07 05:04:41 EDT
Unfortunately, I see some risk that the usage of Image/ResourceManager in JpaJpqlCompletionProposalComputer can require UI Thread to load some images; and this may fail when running out of the UI Threads.
Some more refactorings may be required, like adding to the constructors or to the plugin some code to pre-load the images so we know they're not tried to be loaded at runtime.
Not that maybe createImageDescritpr(...)/createImage(...) methods can work out of the UI Thread, but I'm not certain about that. If there is some guarantee they do work, then we can probably proceed without further consideration.
Comment 7 Eclipse Genie CLA 2021-02-13 03:28:18 EST
New Gerrit change created: https://git.eclipse.org/r/c/dali/webtools.dali/+/176220
Comment 8 Lakshminarayana CLA 2021-02-13 03:40:19 EST
(In reply to Eclipse Genie from comment #7)
> New Gerrit change created:
> https://git.eclipse.org/r/c/dali/webtools.dali/+/176220

@Holger Voormann  I have submitted my changes within my knowledge. I welcome  your comments and suggestions
Comment 10 Lars Vogel CLA 2022-05-19 02:27:56 EDT
Is this bug still open or has it been fixed in the meantime? I see new commits.
Comment 11 Lakshminarayana CLA 2022-05-19 02:48:16 EDT
(In reply to Lars Vogel from comment #10)
> Is this bug still open or has it been fixed in the meantime? I see new
> commits.

It has been fixed already and part of the R3_21 release. @Holger may know about the current bug status.
Comment 12 Holger Voormann CLA 2022-05-19 03:11:27 EDT
(In reply to Lakshminarayana from comment #11)
> (In reply to Lars Vogel from comment #10)
> > Is this bug still open or has it been fixed in the meantime? I see new
> > commits.
> 
> It has been fixed already and part of the R3_21 release. @Holger may know
> about the current bug status.

Yes, I can confirm that the bug has been fixed.

Could someone with the appropriate permissions please add "3.21" as a value to target milestone and set target milestone to it?
Comment 13 Nitin Dahyabhai CLA 2022-05-19 09:53:57 EDT
(In reply to Holger Voormann from comment #12)
> (In reply to Lakshminarayana from comment #11)
> > (In reply to Lars Vogel from comment #10)
> > > Is this bug still open or has it been fixed in the meantime? I see new
> > > commits.
> > 
> > It has been fixed already and part of the R3_21 release. @Holger may know
> > about the current bug status.
> 
> Yes, I can confirm that the bug has been fixed.
> 
> Could someone with the appropriate permissions please add "3.21" as a value
> to target milestone and set target milestone to it?

Lakshminarayana, I've granted you the ability to do this for Dali, and gone ahead and added 3.21 as a target. You can do so in the future through the "Bugzilla Manager: components, targets, milestones" link under the Committer Tools on https://accounts.eclipse.org/.
Comment 14 Lakshminarayana CLA 2022-05-19 10:38:36 EDT
(In reply to Nitin Dahyabhai from comment #13)
> (In reply to Holger Voormann from comment #12)
> > (In reply to Lakshminarayana from comment #11)
> > > (In reply to Lars Vogel from comment #10)
> > > > Is this bug still open or has it been fixed in the meantime? I see new
> > > > commits.
> > > 
> > > It has been fixed already and part of the R3_21 release. @Holger may know
> > > about the current bug status.
> > 
> > Yes, I can confirm that the bug has been fixed.
> > 
> > Could someone with the appropriate permissions please add "3.21" as a value
> > to target milestone and set target milestone to it?
> 
> Lakshminarayana, I've granted you the ability to do this for Dali, and gone
> ahead and added 3.21 as a target. You can do so in the future through the
> "Bugzilla Manager: components, targets, milestones" link under the Committer
> Tools on https://accounts.eclipse.org/.

okay, Nitin. Thanks you for the access.