Sean,
Sorry for the delay on this, and thanks for showing the impact with a
simple test. I'm ok with this change being backpored to 7u-dev.
-Chris.
On 26/10/2012 04:48, Sean Chou wrote:
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.hega...@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.