Bug 30941 Preferences default initialization. Can not do a syncExec
20030204 The initialization of the preference default currently contains a final Display display= Display.getDefault(); display.syncExec(new Runnable() { public void run() { Color c= display.getSystemColor(SWT.COLOR_GRAY); rgbs[0]= c.getRGB(); c= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND); rgbs[1]= c.getRGB(); c= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND); rgbs[2]= c.getRGB(); } }); We should avoid and remove this as this is a candidate for a deadlock.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/PreferenceConstants.java
}
		}
		
		store.setDefault(PreferenceConstants.CODEGEN_ADD_COMMENTS, true);
		
		store.setDefault(PreferenceConstants.APPEARANCE_MEMBER_SORT_ORDER, "T,SI,SF,SM,I,F,C,M"); 
		
		store.addPropertyChangeListener(JavaPlugin.getDefault().getMemberOrderPreferenceCache());
		
		/*
		 * Ensure that the display is accessed only in the UI thread.
		 * Ensure that there are no side effects of switching the thread.
		 */
		final RGB[] rgbs= new RGB[3];
		final Display display= Display.getDefault();
		display.syncExec(new Runnable() {
			public void run() {
				Color c= display.getSystemColor(SWT.COLOR_GRAY);
				rgbs[0]= c.getRGB();
				c= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
				rgbs[1]= c.getRGB();
				c= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
				rgbs[2]= c.getRGB();
			}
		});
		store.setDefault(PreferenceConstants.EDITOR_MATCHING_BRACKETS, true);
		PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR,  rgbs[0]);
		store.setDefault(PreferenceConstants.EDITOR_CURRENT_LINE, true);
		PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_CURRENT_LINE_COLOR, new RGB(225, 235, 224));
		store.setDefault(PreferenceConstants.EDITOR_PRINT_MARGIN, false);