Versions: eclipse-platform-3.1.0_fc-0.M7.3 gcc-java-4.0.0-8 Steps To Reproduce: * go to "Window -> Preferences -> Java -> Code Style -> Code Templates" * notice the Code Templates window does not display * the attached stack trace will be in your log file This is not a miscompilation because I had the same error when I moved classmap.db out of the way.
Created attachment 114759 [details] stack trace
Created attachment 114787 [details] log file from when I try to create a new java class
Created attachment 114813 [details] xml that causes errors I printed out the URL to the xml before the call to TemplateReaderWriter.read(java.io.InputStream, java.util.ResourceBundle): URL bundleentry://98/templates/default-templates.xml Using the osgi console I was able to determine that bundle 98 is cdt.ui so the xml that is causes the problem is org.eclipse.cdt.ui_3.0.0/templates/default-templates.xml. I attached it for convenience.
Moving org.eclipse.cdt.ui_3.0.0/templates/default-templates.xml out of the way is a temporary solution: pushd /usr/share/eclipse/plugins/org.eclipse.cdt.ui_3.0.0/templates/ mv default-templates.xml{,.bak} popd
This does indeed fix the problem for me. If we can't figure out what's causing the failure with GNU XML, we can always disable the CDT code templates.
I'm confused as to why the CDT template xml fails when the JDT one does not: /usr/share/eclipse/plugins/org.eclipse.cdt.ui_3.0.0/templates/default-templates.xml: =================================================================================== <template name="for" description="for loop" context="org.eclipse.cdt.ui.text.templates.c" id="org.eclipse.cdt.ui.text.templates.c.for" enabled="true">for (${var} = 0; ${var} < ${max}; ++${var}) { ${cursor} }</template> unzip /usr/share/eclipse/plugins/org.eclipse.jdt.ui_3.1.0.jar \ templates/default-templates.xml templates/default-templates.xml: =============================== <template name="for" description="%Templates.for_array" id="org.eclipse.jdt.ui.templates.for_array" context="java" enabled="true">for (int ${index} = 0; ${index} < ${array}.length; ${index}++) { ${line_selection}${cursor} }</template> What's different that causes the failure when the CDT one is enabled?
I have a simple test program to parse this xml using dom. I got it here: http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/dom/work/DomEcho01.java This works with the jdk but fails with gij. One workaround is to replace the failing entity references with hex equivalents " => " > => > < => < However, there is code in aelfred2 that looks like this is intended to work as-is. I'm going to poke at it a bit more. If I can't make it work I will forward to Chris Burdess for consideration.
Both of the files in comment #6 work fine with my test program. The one in the attachment does not however.
This was fixed in classpath by this patch: 2005-05-14 Chris Burdess <dog> [...] * gnu/xml/dom/ls/SAXEventSink.java: Ignore XML entities in start/ end entity callbacks. I am checking this in to gcc 4.0 and trunk. This patch makes my test program work on the data with which it failed earlier.
This has been fixed in gcc*4.0.0-9.