Community
Participate
Working Groups
XMLContentDesriber#isCharsetValid is throwing a StringIndexOutOfBoundsException when the charset is an empty string. This is invalidating the content type org.eclipse.core.runtime.xml, resulting in other XML files picking up the incorrect content type once an XML file with encoding="" is encountered. Here's the Event Log: Could not create content describer for org.eclipse.core.runtime.xml. Content type has been disabled. java.lang.StringIndexOutOfBoundsException at java.lang.String.charAt(String.java:415) at org.eclipse.core.runtime.content.XMLContentDescriber.isCharsetValid(XMLContentDescriber.java:159) at org.eclipse.core.runtime.content.XMLContentDescriber.internalDescribe(XMLContentDescriber.java:86) at org.eclipse.core.runtime.content.XMLContentDescriber.describe(XMLContentDescriber.java:67) at org.eclipse.core.internal.content.ContentType.describe(ContentType.java:161) at org.eclipse.core.internal.content.ContentType.internalGetDescriptionFor(ContentType.java:458) at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:314) at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:318) at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:86) at org.eclipse.core.internal.resources.ContentDescriptionManager.readDescription(ContentDescriptionManager.java:416) at org.eclipse.core.internal.resources.ContentDescriptionManager.getDescriptionFor(ContentDescriptionManager.java:342) at org.eclipse.core.internal.resources.File.getContentDescription(File.java:280) at org.eclipse.ui.internal.ide.ContentTypeDecorator.decorate(ContentTypeDecorator.java:42) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:72) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:356) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:338) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:374) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:334) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Thanks. There is a bug indeed.
Created attachment 120008 [details] Fix v01
I'm upping the severity to Major as this can wreak havoc on a workspace with just one poorly-written XML file causing others to be misidentified. This is causing a series of our junits to fail since the org.eclipse.core.runtime.xml content type is disabled after one of our malformed XML tests. Can this be retargeted to 3.5M4?
Released to HEAD.