Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 238451 Details for
Bug 342711
[JFace] PreferenceConverter is not thread-safe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch to fix the issue
bug342711-preferenceConverter.patch (text/plain), 1.71 KB, created by
Camille Letavernier
on 2013-12-18 12:15:51 EST
(
hide
)
Description:
Proposed patch to fix the issue
Filename:
MIME Type:
Creator:
Camille Letavernier
Created:
2013-12-18 12:15:51 EST
Size:
1.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >diff --git src/org/eclipse/jface/preference/PreferenceConverter.java src/org/eclipse/jface/preference/PreferenceConverter.java >index c630716..60e352f 100644 >--- src/org/eclipse/jface/preference/PreferenceConverter.java >+++ src/org/eclipse/jface/preference/PreferenceConverter.java >@@ -12,6 +12,7 @@ > > import java.util.Arrays; > import java.util.StringTokenizer; >+import java.util.concurrent.atomic.AtomicReference; > > import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.resource.StringConverter; >@@ -76,12 +77,8 @@ > */ > public static final FontData FONTDATA_DEFAULT_DEFAULT; > static { >- Display display = Display.getCurrent(); >- if (display == null) { >- display = Display.getDefault (); >- } >- >- FONTDATA_ARRAY_DEFAULT_DEFAULT = display.getSystemFont().getFontData(); >+ >+ FONTDATA_ARRAY_DEFAULT_DEFAULT = readDefaultFontData(); > /** > * The default-default value for <code>FontData</code> preferences. > * This is left in for compatibility purposes. It is recommended that >@@ -90,6 +87,21 @@ > > FONTDATA_DEFAULT_DEFAULT = FONTDATA_ARRAY_DEFAULT_DEFAULT[0]; > } >+ >+ private static FontData[] readDefaultFontData() { >+ final Display display = Display.getCurrent() == null ? Display.getDefault() : Display.getCurrent(); >+ >+ final AtomicReference<FontData[]> result = new AtomicReference<FontData[]>(); >+ >+ display.syncExec(new Runnable() { >+ >+ public void run() { >+ result.set(display.getSystemFont().getFontData()); >+ } >+ }); >+ >+ return result.get(); >+ } > > /* (non-Javadoc) > * private constructor to prevent instantiation.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 342711
: 238451