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

Bug 344759

Summary: Avoid using Display.getDefault()
Product: [Eclipse Project] PDE Reporter: Curtis Windatt <curtis.windatt.public>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Curtis Windatt CLA 2011-05-04 15:55:30 EDT
Several places in PDE UI we are still using Display.getDefault().  We should avoid using it wherever possible.
Comment 1 Curtis Windatt CLA 2011-05-04 15:57:31 EDT
Most of the usage has been around for some time.  Marking as 3.8 for now.  Dani, is this something you feel needs to be changed for 3.7?
Comment 2 Dani Megert CLA 2011-05-05 09:22:42 EDT
> Dani, is this something you feel needs to be changed for 3.7?
Nope.
Comment 3 Eric Moffatt CLA 2011-05-05 11:14:18 EDT
Why would Display.getCurrent() be an ant-pattern ? I ask because I've been trying to standardize the e4 code by using this pattern...;-). Am I going the wrong way?
Comment 4 Dani Megert CLA 2011-05-05 12:21:54 EDT
>Why would Display.getCurrent() be an ant-pattern ?
This bug says Display.getDefault() is evil ;-)

It always depends what you try to do. If you are on a multi-display environment and want the display for widget X, then Display.getCurrent() might not give you that.
Comment 5 Eclipse Genie CLA 2019-08-20 17:41:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.