Request for approval: 7025938: Add bitmap mime type to content-types.properties

Sean Chou zhouyx at linux.vnet.ibm.com
Thu Oct 25 20:48:33 PDT 2012


Hi Chris,

Attachment is the testcase and the image files.

///////////////////// testcase //////////////////////////
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class TestBMP {
    public static void main(String[] args) throws
MalformedURLException, IOException {
        URLConnection conn = new
URL("http://cr.openjdk.java.net/~zhouyx/7025938/test.bmp").openConnection();
        URLConnection conn2 = new
URL("http://cr.openjdk.java.net/~zhouyx/7025938/test.png").openConnection();
        URLConnection conn3 = new URL("file://" +
System.getProperty("user.dir") + "/test.png").openConnection();
        URLConnection conn4 = new URL("file://" +
System.getProperty("user.dir") + "/test.bmp").openConnection();

        System.out.println(conn.getContentType());
        System.out.println(conn2.getContentType());
        System.out.println(conn3.getContentType());
        System.out.println(conn4.getContentType());
    }
}

/////////////// results ///////////////////////
/modified-j2sdk-image/bin/java TestBMP
text/plain
image/png
image/png
image/bmp

/jdk1.7.0_05/bin/java TestBMP
text/plain
image/png
image/png
content/unknown


On Wed, Oct 24, 2012 at 5:51 PM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> Yes, there is a small change in behavior here. getContent is not all that
> widely used, and I'm not sure if this change in behavior should surprise
> anyone.
>
> Sean, could you write a simple test that demonstrates this change in
> behavior? I'd like to get a better feel for what how this would impact
> existing code.
>
> -Chris.
>
>
> On 24/10/2012 10:10, Sean Chou wrote:
>>
>> Hello,
>>
>>      This is request for approval to push the fix of 7025938 to jdk7u,
>> please take a look.
>>
>> Link to the bug:
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7025938
>>
>> Changeset in jdk8: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/46b53f80ab0a
>>
>> The webrev for jdk7u is the same with changeset of jdk8 without any
>> change.
>> Building on windows and linux passes.
>>
>> Review thread start:
>> http://mail.openjdk.java.net/pipermail/net-dev/2011-March/002780.html
>> http://mail.openjdk.java.net/pipermail/net-dev/2011-August/003416.html
>>
>>
>> However, this seems a behavior change. cc reviewers.
>>
>



-- 
Best Regards,
Sean Chou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7025938.zip
Type: application/zip
Size: 9253 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/jdk7u-dev/attachments/20121026/a3670cbc/7025938.zip 


More information about the jdk7u-dev mailing list