Bug 24168 [Dialogs] XML dialog settings cannot start with a comment
I created a dialog_settings.xml for my plugin, and entered on the very first line a comment: the settings then fail to load with ClassCastException. An easy workaround is to push the comment down into the XML tree. org.eclipse.jface.dialogs.DialogSettings line 181: Element root = (Element) document.getFirstChild(); If the first child is not an element (e.g. a comment), ClassCastException is thrown.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.java
private void save(Document document,Node parent) {
	Element root = document.createElement(TAG_SECTION);
	parent.appendChild(root);
	root.setAttribute(TAG_NAME, name);
	
	for(Iterator i = items.keySet().iterator();i.hasNext();) {
		String key = (String)i.next();
		Element child = document.createElement(TAG_ITEM);
		root.appendChild(child);
		child.setAttribute(TAG_KEY, key);
		child.setAttribute(TAG_VALUE, (String)items.get(key));	
	}
	for(Iterator i = arrayItems.keySet().iterator();i.hasNext();) {
		String key = (String)i.next();
		Element child = document.createElement(TAG_LIST);
		root.appendChild(child);
		child.setAttribute(TAG_KEY, key);
		String[] value = (String[])arrayItems.get(key);
		for (int index = 0; index < value.length; index++){
			Element c = document.createElement(TAG_ITEM);
			child.appendChild(c);
			c.setAttribute(TAG_VALUE, value[index]);
		}	
	}
	for(Iterator i = sections.values().iterator();i.hasNext();) {
		((DialogSettings)i.next()).save(document,root);
	}	
}
}