This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 129919

Summary: MIME type of XML file with illegal encoding not detected correctly
Product: platform Reporter: Andrei Badea <abadea>
Component: -- Other --Assignee: Jaroslav Tulach <jtulach>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 129454    
Attachments: Unit test

Description Andrei Badea 2008-03-12 15:14:48 UTC
There is an assumption in data systems that a template is recognizable with the same data loader that is used to
recognize files created from that template. I have a case where this assumption doesn't hold.

In the Spring support I need to create an XML file with a given encoding, so my template looks starts with:

<?xml version="1.0" encoding="${encoding}"?>
<beans xmlns="http://www.springframework.org/schema/beans">

I have a MIME resolved installed which recognizes files with such a beans element as text/x-springconfig+xml. However,
the MIME type of the template is not text/x-springconfig+xml, but text/xml. Thus the file generated from the template is
recognized with XMLDataLoader instead of the loader for Spring files.

The template has the correct MIME type if I change "${encoding}" to e.g. "UTF-8".
Comment 1 Andrei Badea 2008-03-12 15:15:34 UTC
Created attachment 58238 [details]
Unit test
Comment 2 Jaroslav Tulach 2008-03-12 20:39:20 UTC
The fix will propagate by tomorrow, I guess.

changeset:   72560:54c073dde43e
tag:         tip
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Wed Mar 12 20:37:36 2008 +0100
summary:     #129919: Surviving malformed encoding in the XML header
Comment 3 Andrei Badea 2008-03-13 15:45:18 UTC
Verified.