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
* settings.addSection(section);
 * section.put("Int2",200);
 * section.put("Float2",1.1);
 * section.put("Array2",new String[]{"aaaa2","bbbb2","cccc2"});
 * settings.save("c:\\temp\\test\\dialog.xml");
 * </code>
 */
 
public class DialogSettings implements IDialogSettings {
	
	private String name;
	/* A Map of DialogSettings representing each sections in a DialogSettings.
	   It maps the DialogSettings' name to the DialogSettings */
	private Map sections;
	/* A Map with all the keys and values of this sections.
	   Either the keys an values are restricted to strings. */
	private Map items;
	
	private Map arrayItems;
	private final String TAG_SECTION = "section";
	private final String TAG_NAME = "name";
	private final String TAG_KEY = "key";
	private final String TAG_VALUE = "value";
	private final String TAG_LIST = "list";
	private final String TAG_ITEM = "item";
/**
 * Create an empty dialog settings which loads and saves its
 * content to a file.
 * Use the methods <code>load(String)</code> and <code>store(String)</code>
 * to load and store this dialog settings.