Bug 139298 [ErrorHandling] eclipse will silently fail to launch with invalid colorDefinition value
I had a color value of "30,14, 231", and the erroneous space after the comma caused Eclipse to silently fail to launch without any error messages other than the following from .metadata/.log. Seems that better error tolerance would be good. Note that the launch was a runtime workbench. !ENTRY org.eclipse.ui 4 0 2006-04-28 12:50:32.565 !MESSAGE For input string: " 231" !STACK 0 org.eclipse.jface.resource.DataFormatException: For input string: " 231" at org.eclipse.jface.resource.StringConverter.asRGB(StringConverter.java:560) at org.eclipse.ui.themes.ColorUtil.getColorValue(ColorUtil.java:122) at org.eclipse.ui.internal.themes.ColorDefinition.getValue(ColorDefinition.java:146) at org.eclipse.ui.internal.themes.ThemeElementHelper.installColor(ThemeElementHelper.java:261) at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(ThemeElementHelper.java:156) at org.eclipse.ui.internal.Workbench.initializeApplicationColors(Workbench.java:1123) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1065) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
bundles/org.eclipse.jface/src/org/eclipse/jface/resource/StringConverter.java
} else if (ITALIC.equals(s)) {
                style = SWT.ITALIC;
            } else if (REGULAR.equals(s)) {
                style = SWT.NORMAL;
            } else {
                throw new DataFormatException("Unknown face name \"" + s + "\""); 
            }
            name = value.substring(0, faceIndex);
        } catch (NoSuchElementException e) {
            throw new DataFormatException(e.getMessage());
        }
        return new FontData(name, height, style);
    }
	/**
	 * Returns the result of converting a list of comma-separated tokens into an array
	 * 
	 * @return the array of string tokens
	 * @param prop the initial comma-separated string
	 */
	private static String[] getArrayFromList(String prop, String separator) {
		if (prop == null || prop.trim().equals("")) { 
			return new String[0];
		}
		ArrayList list = new ArrayList();
		StringTokenizer tokens = new StringTokenizer(prop, separator); 
		while (tokens.hasMoreTokens()) {
			String token = tokens.nextToken().trim();
			if (!token.equals("")) { 
				list.add(token);
			}