From 667d968e28fd000abc542b9277562f9146d46f3a Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Fri, 25 Jun 2010 08:44:20 -0700 Subject: [PATCH 1/4] 6964311: Build regression due to rt.jar contents change The fix for 6933622 regressed control builds, this is a workaround fix, filed 6964313 to find the right answer to why it happened and how to fix it correctly. Reviewed-by: alanb, darcy --- jdk/make/common/Release.gmk | 2 -- 1 file changed, 2 deletions(-) diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index ab9f557eef2..cf16ea8dd3a 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -549,7 +549,6 @@ DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.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 @@ -572,7 +571,6 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@ $(ECHO) "com/sun/tools/" >> $@ $(ECHO) "sun/jvmstat/" >> $@ - $(ECHO) "sun/nio/cs/ext/" >> $@ $(ECHO) "sun/rmi/rmic/" >> $@ $(ECHO) "sun/tools/asm/" >> $@ $(ECHO) "sun/tools/java/" >> $@ From efa88ff48b77bc4b4d23127f60a24ea92bfa853a Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Fri, 25 Jun 2010 18:31:41 +0100 Subject: [PATCH 2/4] 6963828: TEST_BUG: java/nio/channels/FileTransfer.java takes too long (win) Reviewed-by: chegar --- .../nio/channels/FileChannel/Transfer.java | 58 +++++++++++-------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/jdk/test/java/nio/channels/FileChannel/Transfer.java b/jdk/test/java/nio/channels/FileChannel/Transfer.java index bee8401a1e5..a6f96b83e87 100644 --- a/jdk/test/java/nio/channels/FileChannel/Transfer.java +++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java @@ -25,7 +25,6 @@ * @bug 4434723 4482726 4559072 4638365 4795550 5081340 5103988 6253145 * @summary Test FileChannel.transferFrom and transferTo * @library .. - * @run main/timeout=240 Transfer */ import java.io.*; @@ -33,6 +32,8 @@ import java.net.*; import java.nio.*; import java.nio.channels.*; import java.nio.channels.spi.SelectorProvider; +import java.nio.file.StandardOpenOption; +import java.nio.file.FileAlreadyExistsException; import java.util.Random; @@ -262,23 +263,30 @@ public class Transfer { // Test transferFrom with large file 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 File source = File.createTempFile("blech", null); source.deleteOnExit(); 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(); long testSize = ((long)Integer.MAX_VALUE) * 2; - RandomAccessFile raf = new RandomAccessFile(sink, "rw"); - FileChannel fc = raf.getChannel(); try { fc.write(ByteBuffer.wrap("Use the source!".getBytes()), testSize - 40); @@ -288,24 +296,26 @@ public class Transfer { return; } finally { fc.close(); - raf.close(); } // Get new channels for the source and sink and attempt transfer - FileInputStream fis = new FileInputStream(source); - FileChannel sourceChannel = fis.getChannel(); - - raf = new RandomAccessFile(sink, "rw"); - FileChannel sinkChannel = raf.getChannel(); - - long bytesWritten = sinkChannel.transferFrom(sourceChannel, - testSize - 40, 10); - if (bytesWritten != 10) { - throw new RuntimeException("Transfer test 5 failed " + - bytesWritten); + FileChannel sourceChannel = new FileInputStream(source).getChannel(); + try { + FileChannel sinkChannel = new RandomAccessFile(sink, "rw").getChannel(); + try { + long bytesWritten = sinkChannel.transferFrom(sourceChannel, + testSize - 40, 10); + if (bytesWritten != 10) { + throw new RuntimeException("Transfer test 5 failed " + + bytesWritten); + } + } finally { + sinkChannel.close(); + } + } finally { + sourceChannel.close(); } - sourceChannel.close(); - sinkChannel.close(); + source.delete(); sink.delete(); } From 85a8187c52f6bb8095167d9e978791e8d44a497b Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Mon, 28 Jun 2010 14:55:25 +0100 Subject: [PATCH 3/4] 6954525: Testcase failure java/net/Authenticator/B4769350.java Reviewed-by: michaelm, weijun --- .../classes/sun/net/www/protocol/http/HttpURLConnection.java | 2 +- jdk/test/java/net/Authenticator/B4769350.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 1421c737d39..713c7d85c21 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -2331,7 +2331,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * closed the connection to the web server. */ private void disconnectWeb() throws IOException { - if (usingProxy()) { + if (usingProxy() && http.isKeepingAlive()) { responseCode = -1; // clean up, particularly, skip the content part // of a 401 error response diff --git a/jdk/test/java/net/Authenticator/B4769350.java b/jdk/test/java/net/Authenticator/B4769350.java index b51ac7b3b68..b80e1c70e01 100644 --- a/jdk/test/java/net/Authenticator/B4769350.java +++ b/jdk/test/java/net/Authenticator/B4769350.java @@ -54,6 +54,7 @@ public class B4769350 { boolean allowerror; Client (String authority, String path, boolean allowerror) { + super("Thread-" + path); this.authority = authority; this.path = path; this.allowerror = allowerror; @@ -72,7 +73,8 @@ public class B4769350 { error = true; } catch (IOException e) { if (!allowerror) { - System.out.println (e); + System.out.println (Thread.currentThread().getName() + " " + e); + e.printStackTrace(); error = true; } } @@ -94,6 +96,7 @@ public class B4769350 { } void okReply (HttpTransaction req) throws IOException { + req.addResponseHeader ("Connection", "close"); req.setResponseEntityBody ("Hello ."); req.sendResponse (200, "Ok"); req.orderlyClose(); From 8dd995ca0d99e41ae93fff66af086f199cd4d6cd Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Mon, 28 Jun 2010 20:52:37 +0100 Subject: [PATCH 4/4] 6961029: java/net/BindException/Test.java should not use wildcard address Reviewed-by: michaelm, alanb --- jdk/test/ProblemList.txt | 3 --- jdk/test/java/net/BindException/Test.java | 2 +- jdk/test/java/net/ipv6tests/Tests.java | 3 ++- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index a4d90b6da08..748bcd86810 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -379,9 +379,6 @@ sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java # Interrupted or IO exception, maybe writing to non-unique named file? 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 java/net/MulticastSocket/SetOutgoingIf.java generic-all diff --git a/jdk/test/java/net/BindException/Test.java b/jdk/test/java/net/BindException/Test.java index dbb9b55425d..15871b76464 100644 --- a/jdk/test/java/net/BindException/Test.java +++ b/jdk/test/java/net/BindException/Test.java @@ -180,7 +180,7 @@ public class Test { while (addrs.hasMoreElements()) { InetAddress ia = (InetAddress)addrs.nextElement(); - if (ia.isLoopbackAddress()) { + if (ia.isLoopbackAddress() || ia.isAnyLocalAddress()) { continue; } diff --git a/jdk/test/java/net/ipv6tests/Tests.java b/jdk/test/java/net/ipv6tests/Tests.java index 10f5cf197b0..cba85a945e9 100644 --- a/jdk/test/java/net/ipv6tests/Tests.java +++ b/jdk/test/java/net/ipv6tests/Tests.java @@ -248,7 +248,8 @@ public class Tests { } while (addrs.hasMoreElements()) { 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)) { continue; }