提交 73c6f8a0 编写于 作者: A asaha

Merge

...@@ -549,7 +549,6 @@ DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar ...@@ -549,7 +549,6 @@ DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar
###################################################### ######################################################
# List of directories in classes directory that should NOT be in rt.jar # List of directories in classes directory that should NOT be in rt.jar
# sun/nio/cs/ext/ will go into charsets.jar
###################################################### ######################################################
NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list
...@@ -572,7 +571,6 @@ $(NOT_RT_JAR_LIST): FRC ...@@ -572,7 +571,6 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@ $(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
$(ECHO) "com/sun/tools/" >> $@ $(ECHO) "com/sun/tools/" >> $@
$(ECHO) "sun/jvmstat/" >> $@ $(ECHO) "sun/jvmstat/" >> $@
$(ECHO) "sun/nio/cs/ext/" >> $@
$(ECHO) "sun/rmi/rmic/" >> $@ $(ECHO) "sun/rmi/rmic/" >> $@
$(ECHO) "sun/tools/asm/" >> $@ $(ECHO) "sun/tools/asm/" >> $@
$(ECHO) "sun/tools/java/" >> $@ $(ECHO) "sun/tools/java/" >> $@
......
...@@ -2331,7 +2331,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { ...@@ -2331,7 +2331,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
* closed the connection to the web server. * closed the connection to the web server.
*/ */
private void disconnectWeb() throws IOException { private void disconnectWeb() throws IOException {
if (usingProxy()) { if (usingProxy() && http.isKeepingAlive()) {
responseCode = -1; responseCode = -1;
// clean up, particularly, skip the content part // clean up, particularly, skip the content part
// of a 401 error response // of a 401 error response
......
...@@ -379,9 +379,6 @@ sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java ...@@ -379,9 +379,6 @@ sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java
# Interrupted or IO exception, maybe writing to non-unique named file? # Interrupted or IO exception, maybe writing to non-unique named file?
com/sun/net/httpserver/bugs/B6373555.java generic-all com/sun/net/httpserver/bugs/B6373555.java generic-all
# Fails on OpenSolaris, BindException unexpected
java/net/BindException/Test.java generic-all
# Fails on OpenSolaris, times out # Fails on OpenSolaris, times out
java/net/MulticastSocket/SetOutgoingIf.java generic-all java/net/MulticastSocket/SetOutgoingIf.java generic-all
......
...@@ -54,6 +54,7 @@ public class B4769350 { ...@@ -54,6 +54,7 @@ public class B4769350 {
boolean allowerror; boolean allowerror;
Client (String authority, String path, boolean allowerror) { Client (String authority, String path, boolean allowerror) {
super("Thread-" + path);
this.authority = authority; this.authority = authority;
this.path = path; this.path = path;
this.allowerror = allowerror; this.allowerror = allowerror;
...@@ -72,7 +73,8 @@ public class B4769350 { ...@@ -72,7 +73,8 @@ public class B4769350 {
error = true; error = true;
} catch (IOException e) { } catch (IOException e) {
if (!allowerror) { if (!allowerror) {
System.out.println (e); System.out.println (Thread.currentThread().getName() + " " + e);
e.printStackTrace();
error = true; error = true;
} }
} }
...@@ -94,6 +96,7 @@ public class B4769350 { ...@@ -94,6 +96,7 @@ public class B4769350 {
} }
void okReply (HttpTransaction req) throws IOException { void okReply (HttpTransaction req) throws IOException {
req.addResponseHeader ("Connection", "close");
req.setResponseEntityBody ("Hello ."); req.setResponseEntityBody ("Hello .");
req.sendResponse (200, "Ok"); req.sendResponse (200, "Ok");
req.orderlyClose(); req.orderlyClose();
......
...@@ -180,7 +180,7 @@ public class Test { ...@@ -180,7 +180,7 @@ public class Test {
while (addrs.hasMoreElements()) { while (addrs.hasMoreElements()) {
InetAddress ia = (InetAddress)addrs.nextElement(); InetAddress ia = (InetAddress)addrs.nextElement();
if (ia.isLoopbackAddress()) { if (ia.isLoopbackAddress() || ia.isAnyLocalAddress()) {
continue; continue;
} }
......
...@@ -248,7 +248,8 @@ public class Tests { ...@@ -248,7 +248,8 @@ public class Tests {
} }
while (addrs.hasMoreElements()) { while (addrs.hasMoreElements()) {
InetAddress addr = (InetAddress) addrs.nextElement(); InetAddress addr = (InetAddress) addrs.nextElement();
if (filter.isInstance (addr) && !addr.isLoopbackAddress()) { if (filter.isInstance (addr) && !addr.isLoopbackAddress()
&& !addr.isAnyLocalAddress()) {
if (Arrays.equals (addr.getAddress(), fe80_loopback)) { if (Arrays.equals (addr.getAddress(), fe80_loopback)) {
continue; continue;
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
* @bug 4434723 4482726 4559072 4638365 4795550 5081340 5103988 6253145 * @bug 4434723 4482726 4559072 4638365 4795550 5081340 5103988 6253145
* @summary Test FileChannel.transferFrom and transferTo * @summary Test FileChannel.transferFrom and transferTo
* @library .. * @library ..
* @run main/timeout=240 Transfer
*/ */
import java.io.*; import java.io.*;
...@@ -33,6 +32,8 @@ import java.net.*; ...@@ -33,6 +32,8 @@ import java.net.*;
import java.nio.*; import java.nio.*;
import java.nio.channels.*; import java.nio.channels.*;
import java.nio.channels.spi.SelectorProvider; import java.nio.channels.spi.SelectorProvider;
import java.nio.file.StandardOpenOption;
import java.nio.file.FileAlreadyExistsException;
import java.util.Random; import java.util.Random;
...@@ -262,23 +263,30 @@ public class Transfer { ...@@ -262,23 +263,30 @@ public class Transfer {
// Test transferFrom with large file // Test transferFrom with large file
public static void xferTest05() throws Exception { public static void xferTest05() throws Exception {
// Linux can't handle the really large file sizes for a
// truncate or a positional write
String osName = System.getProperty("os.name");
if (osName.startsWith("Linux"))
return;
// Create a source file & large sink file for the test // Create a source file & large sink file for the test
File source = File.createTempFile("blech", null); File source = File.createTempFile("blech", null);
source.deleteOnExit(); source.deleteOnExit();
initTestFile(source, 100); initTestFile(source, 100);
File sink = File.createTempFile("sink", null); // Create the sink file as a sparse file if possible
File sink = null;
FileChannel fc = null;
while (fc == null) {
sink = File.createTempFile("sink", null);
// re-create as a sparse file
sink.toPath().delete();
try {
fc = FileChannel.open(sink.toPath(),
StandardOpenOption.CREATE_NEW,
StandardOpenOption.WRITE,
StandardOpenOption.SPARSE);
} catch (FileAlreadyExistsException ignore) {
// someone else got it
}
}
sink.deleteOnExit(); sink.deleteOnExit();
long testSize = ((long)Integer.MAX_VALUE) * 2; long testSize = ((long)Integer.MAX_VALUE) * 2;
RandomAccessFile raf = new RandomAccessFile(sink, "rw");
FileChannel fc = raf.getChannel();
try { try {
fc.write(ByteBuffer.wrap("Use the source!".getBytes()), fc.write(ByteBuffer.wrap("Use the source!".getBytes()),
testSize - 40); testSize - 40);
...@@ -288,24 +296,26 @@ public class Transfer { ...@@ -288,24 +296,26 @@ public class Transfer {
return; return;
} finally { } finally {
fc.close(); fc.close();
raf.close();
} }
// Get new channels for the source and sink and attempt transfer // Get new channels for the source and sink and attempt transfer
FileInputStream fis = new FileInputStream(source); FileChannel sourceChannel = new FileInputStream(source).getChannel();
FileChannel sourceChannel = fis.getChannel(); try {
FileChannel sinkChannel = new RandomAccessFile(sink, "rw").getChannel();
raf = new RandomAccessFile(sink, "rw"); try {
FileChannel sinkChannel = raf.getChannel(); long bytesWritten = sinkChannel.transferFrom(sourceChannel,
testSize - 40, 10);
long bytesWritten = sinkChannel.transferFrom(sourceChannel, if (bytesWritten != 10) {
testSize - 40, 10); throw new RuntimeException("Transfer test 5 failed " +
if (bytesWritten != 10) { bytesWritten);
throw new RuntimeException("Transfer test 5 failed " + }
bytesWritten); } finally {
sinkChannel.close();
}
} finally {
sourceChannel.close();
} }
sourceChannel.close();
sinkChannel.close();
source.delete(); source.delete();
sink.delete(); sink.delete();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册