diff --git a/.hgtags b/.hgtags index 85783d82daebd9442a1c15034c8088b16da63740..e7963e7c7abf663c3cce4ec484987792ce7dc058 100644 --- a/.hgtags +++ b/.hgtags @@ -45,3 +45,4 @@ a952aafd5181af953b0ef3010dbd2fcc28460e8a jdk7-b67 b23d905cb5d3b382295240d28ab0bfb266b4503c jdk7-b68 226b20019b1f020c09ea97d137d98e011ce65d76 jdk7-b69 893bcca951b747ddcf6986362b877f0e1dbb835b jdk7-b70 +b3f3240135f0c10b9f2481c174b81b7fcf0daa60 jdk7-b71 diff --git a/make/common/shared/Defs-java.gmk b/make/common/shared/Defs-java.gmk index 9d918af877dfe6b2c80a932544d01eba86b29abf..f9ed635313135f7d95d0102244c53c1724389337 100644 --- a/make/common/shared/Defs-java.gmk +++ b/make/common/shared/Defs-java.gmk @@ -201,7 +201,10 @@ endif ifeq ($(JAVAC_WARNINGS_FATAL), true) BOOT_JAVACFLAGS += -Werror endif -BOOT_JAVACFLAGS += -encoding ascii + +BOOT_SOURCE_LANGUAGE_VERSION = 6 +BOOT_TARGET_CLASS_VERSION = 6 +BOOT_JAVACFLAGS += -encoding ascii -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) BOOT_JAR_JFLAGS += $(JAR_JFLAGS) BOOT_JAVACFLAGS += $(NO_PROPRIETARY_API_WARNINGS) diff --git a/make/tools/freetypecheck/Makefile b/make/tools/freetypecheck/Makefile index 94c983565aceff1f91dbd4b96834ba0cb0c651c3..23161969558c231326346e20d5a57cbf98820c75 100644 --- a/make/tools/freetypecheck/Makefile +++ b/make/tools/freetypecheck/Makefile @@ -28,16 +28,21 @@ BUILDDIR = ../.. include $(BUILDDIR)/common/Defs.gmk # Default name -FT_TEST = $(BUILDTOOLBINDIR)/freetype_versioncheck$(EXE_SUFFIX) +PROGRAM = freetype_versioncheck +FT_OBJ = $(BUILDTOOLBINDIR)/$(PROGRAM).$(OBJECT_SUFFIX) +FT_TEST = $(BUILDTOOLBINDIR)/$(PROGRAM)$(EXE_SUFFIX) # Used on openjdk only ifeq ($(OPENJDK),true) # Start with CFLAGS (which gets us the required -xarch setting on solaris) ifeq ($(PLATFORM), windows) - FT_OPTIONS = /nologo $(CC_OBJECT_OUTPUT_FLAG)$(TEMPDIR) + FT_OPTIONS = /nologo /c FREETYPE_DLL = $(FREETYPE_LIB_PATH)/freetype.dll FT_LD_OPTIONS = $(FREETYPE_LIB_PATH)/freetype.lib +ifdef MT + FT_LD_OPTIONS += /manifest +endif else FT_OPTIONS = $(CFLAGS) FT_LD_OPTIONS = -L$(FREETYPE_LIB_PATH) @@ -55,15 +60,22 @@ FT_LD_OPTIONS += $(LFLAGS_$(COMPILER_VERSION)) # Create test program all: $(FT_TEST) - @$(FT_TEST) + $(FT_TEST) # On windows we need to copy dll to test dir to ensure it will be found # at runtime $(FT_TEST): freetypecheck.c - @$(prep-target) - @$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FT_LD_OPTIONS) + $(prep-target) ifeq ($(PLATFORM), windows) - @$(CP) $(FREETYPE_DLL) `dirname $@` + $(CC) $(FT_OPTIONS) $(CC_OBJECT_OUTPUT_FLAG)$(FT_OBJ) $< + $(LINK) $(FT_LD_OPTIONS) /OUT:$(FT_TEST) $(FT_OBJ) + $(CP) $(FREETYPE_DLL) $(@D)/ +ifdef MT + $(CP) $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL) $(@D)/ + $(MT) /manifest $(FT_TEST).manifest /outputresource:$(FT_TEST);#1 +endif +else + @$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FT_LD_OPTIONS) endif else diff --git a/make/tools/freetypecheck/freetypecheck.c b/make/tools/freetypecheck/freetypecheck.c index 3f900a840a9afcebd62ab2c8cb271e87eaabdf30..71d32022beecdc2211bc0522980a48e8541216a5 100644 --- a/make/tools/freetypecheck/freetypecheck.c +++ b/make/tools/freetypecheck/freetypecheck.c @@ -32,6 +32,45 @@ #include "ft2build.h" #include FT_FREETYPE_H +#ifdef _MSC_VER +#if _MSC_VER > 1400 + +/* + * When building for Microsoft Windows, your program has a dependency + * on msvcr??.dll. + * + * When using Visual Studio 2005 or later, that must be recorded in + * the .exe.manifest file. + * + * Reference: + * C:/Program Files/Microsoft SDKs/Windows/v6.1/include/crtdefs.h + */ +#include +#ifdef _M_IX86 + +#pragma comment(linker,"/manifestdependency:\"type='win32' " \ + "name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \ + "version='" _CRT_ASSEMBLY_VERSION "' " \ + "processorArchitecture='x86' " \ + "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"") + +#endif /* _M_IX86 */ + +//This may not be necessary yet for the Windows 64-bit build, but it +//will be when that build environment is updated. Need to test to see +//if it is harmless: +#ifdef _M_AMD64 + +#pragma comment(linker,"/manifestdependency:\"type='win32' " \ + "name='" __LIBRARIES_ASSEMBLY_NAME_PREFIX ".CRT' " \ + "version='" _CRT_ASSEMBLY_VERSION "' " \ + "processorArchitecture='amd64' " \ + "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"") + +#endif /* _M_AMD64 */ +#endif /* _MSC_VER > 1400 */ +#endif /* _MSC_VER */ + #define QUOTEMACRO(x) QUOTEME(x) #define QUOTEME(x) #x diff --git a/src/share/classes/java/nio/file/Files.java b/src/share/classes/java/nio/file/Files.java index 00e1014526c617b4335d2514ccd1d3fb8af35915..bf596409e5a5724364e342b9fb35331e262268a7 100644 --- a/src/share/classes/java/nio/file/Files.java +++ b/src/share/classes/java/nio/file/Files.java @@ -133,10 +133,11 @@ public final class Files { *

This method walks a file tree rooted at a given starting file. The * file tree traversal is depth-first with the given {@link * FileVisitor} invoked for each file encountered. File tree traversal - * completes when all accessible files in the tree have been visited, a - * visitor returns a result of {@link FileVisitResult#TERMINATE TERMINATE}, - * or the visitor terminates due to an uncaught {@code Error} or {@code - * RuntimeException}. + * completes when all accessible files in the tree have been visited, or a + * visit method returns a result of {@link FileVisitResult#TERMINATE + * TERMINATE}. Where a visit method terminates due an uncaught error or + * runtime exception then the traversal is terminated and the error or + * exception is propagated to the caller of this method. * *

For each file encountered this method attempts to gets its {@link * java.nio.file.attribute.BasicFileAttributes}. If the file is not a diff --git a/src/share/classes/java/nio/file/SimpleFileVisitor.java b/src/share/classes/java/nio/file/SimpleFileVisitor.java index 761773513ede4781cf42f56bb77384543c48383b..f252ef03eea8e7a8d777381bf251be0dbc11f043 100644 --- a/src/share/classes/java/nio/file/SimpleFileVisitor.java +++ b/src/share/classes/java/nio/file/SimpleFileVisitor.java @@ -124,8 +124,8 @@ public class SimpleFileVisitor implements FileVisitor { * cause. * * @throws IOError - * if iteration of the directory completed prematurely due to an - * I/O error + * with the I/O exception thrown when iteration of the directory + * completed prematurely due to an I/O error */ @Override public FileVisitResult postVisitDirectory(T dir, IOException exc) { diff --git a/src/share/sample/nio/file/Xdd.java b/src/share/sample/nio/file/Xdd.java index b540b31fd1bbe2dbee8890a0a3c1c73fa6a9e9fa..b5102976077cd89db1406414dd919ed1ea99f532 100644 --- a/src/share/sample/nio/file/Xdd.java +++ b/src/share/sample/nio/file/Xdd.java @@ -57,9 +57,9 @@ public class Xdd { Path file = (args.length == 1) ? Paths.get(args[0]) : Paths.get(args[2]); - // check that user defined attributes are supported by the file system + // check that user defined attributes are supported by the file store FileStore store = file.getFileStore(); - if (!store.supportsFileAttributeView("user")) { + if (!store.supportsFileAttributeView(UserDefinedFileAttributeView.class)) { System.err.format("UserDefinedFileAttributeView not supported on %s\n", store); System.exit(-1); diff --git a/src/share/transport/socket/socketTransport.c b/src/share/transport/socket/socketTransport.c index f960fae2d39a726aaf2494410380e47511a98e81..59ebcc9ad3cdab8d4de07270d354c3d8722effac 100644 --- a/src/share/transport/socket/socketTransport.c +++ b/src/share/transport/socket/socketTransport.c @@ -134,15 +134,16 @@ setOptions(int fd) static jdwpTransportError handshake(int fd, jlong timeout) { - char *hello = "JDWP-Handshake"; + const char *hello = "JDWP-Handshake"; char b[16]; - int rv, received, i; + int rv, helloLen, received; if (timeout > 0) { dbgsysConfigureBlocking(fd, JNI_FALSE); } + helloLen = (int)strlen(hello); received = 0; - while (received < (int)strlen(hello)) { + while (received < helloLen) { int n; char *buf; if (timeout > 0) { @@ -154,7 +155,7 @@ handshake(int fd, jlong timeout) { } buf = b; buf += received; - n = dbgsysRecv(fd, buf, (int)strlen(hello)-received, 0); + n = dbgsysRecv(fd, buf, helloLen-received, 0); if (n == 0) { setLastError(0, "handshake failed - connection prematurally closed"); return JDWPTRANSPORT_ERROR_IO_ERROR; @@ -167,20 +168,19 @@ handshake(int fd, jlong timeout) { if (timeout > 0) { dbgsysConfigureBlocking(fd, JNI_TRUE); } - for (i=0; i<(int)strlen(hello); i++) { - if (b[i] != hello[i]) { - char msg[64]; - strcpy(msg, "handshake failed - received >"); - strncat(msg, b, strlen(hello)); - strcat(msg, "< - excepted >"); - strcat(msg, hello); - strcat(msg, "<"); - setLastError(0, msg); - return JDWPTRANSPORT_ERROR_IO_ERROR; - } + if (strncmp(b, hello, received) != 0) { + char msg[80+2*16]; + b[received] = '\0'; + /* + * We should really use snprintf here but it's not available on Windows. + * We can't use jio_snprintf without linking the transport against the VM. + */ + sprintf(msg, "handshake failed - received >%s< - expected >%s<", b, hello); + setLastError(0, msg); + return JDWPTRANSPORT_ERROR_IO_ERROR; } - if (dbgsysSend(fd, hello, (int)strlen(hello), 0) != (int)strlen(hello)) { + if (dbgsysSend(fd, (char*)hello, helloLen, 0) != helloLen) { RETURN_IO_ERROR("send failed during handshake"); } return JDWPTRANSPORT_ERROR_NONE; diff --git a/src/solaris/classes/sun/nio/fs/LinuxFileStore.java b/src/solaris/classes/sun/nio/fs/LinuxFileStore.java index 7eb45bde48177836051420b1c50246a1030dea0f..81132985b75ab07ef9329faa66f8dc85f87d952c 100644 --- a/src/solaris/classes/sun/nio/fs/LinuxFileStore.java +++ b/src/solaris/classes/sun/nio/fs/LinuxFileStore.java @@ -25,6 +25,7 @@ package sun.nio.fs; +import java.nio.file.attribute.*; import java.util.*; import java.io.IOException; @@ -113,10 +114,12 @@ class LinuxFileStore } @Override - public boolean supportsFileAttributeView(String name) { + public boolean supportsFileAttributeView(Class type) { // support DosFileAttributeView and UserDefinedAttributeView if extended // attributes enabled - if (name.equals("dos") || name.equals("user")) { + if (type == DosFileAttributeView.class || + type == UserDefinedFileAttributeView.class) + { // lookup fstypes.properties FeatureStatus status = checkIfFeaturePresent("user_xattr"); if (status == FeatureStatus.PRESENT) @@ -142,7 +145,15 @@ class LinuxFileStore } return xattrEnabled; } + return super.supportsFileAttributeView(type); + } + @Override + public boolean supportsFileAttributeView(String name) { + if (name.equals("dos")) + return supportsFileAttributeView(DosFileAttributeView.class); + if (name.equals("user")) + return supportsFileAttributeView(UserDefinedFileAttributeView.class); return super.supportsFileAttributeView(name); } diff --git a/src/solaris/classes/sun/nio/fs/SolarisFileStore.java b/src/solaris/classes/sun/nio/fs/SolarisFileStore.java index aaa737137d3c31a183dde802d473172b782d4801..8cf2bbe08183fbbae053e1e29294b9a87ebf7cbd 100644 --- a/src/solaris/classes/sun/nio/fs/SolarisFileStore.java +++ b/src/solaris/classes/sun/nio/fs/SolarisFileStore.java @@ -25,6 +25,7 @@ package sun.nio.fs; +import java.nio.file.attribute.*; import java.io.IOException; import static sun.nio.fs.UnixNativeDispatcher.*; @@ -72,27 +73,39 @@ class SolarisFileStore } @Override - public boolean supportsFileAttributeView(String name) { - if (name.equals("acl")) { + public boolean supportsFileAttributeView(Class type) { + if (type == AclFileAttributeView.class) { // lookup fstypes.properties FeatureStatus status = checkIfFeaturePresent("nfsv4acl"); - if (status == FeatureStatus.PRESENT) - return true; - if (status == FeatureStatus.NOT_PRESENT) - return false; - // AclFileAttributeView available on ZFS - return (type().equals("zfs")); + switch (status) { + case PRESENT : return true; + case NOT_PRESENT : return false; + default : + // AclFileAttributeView available on ZFS + return (type().equals("zfs")); + } } - if (name.equals("user")) { + if (type == UserDefinedFileAttributeView.class) { // lookup fstypes.properties FeatureStatus status = checkIfFeaturePresent("xattr"); - if (status == FeatureStatus.PRESENT) - return true; - if (status == FeatureStatus.NOT_PRESENT) - return false; - return xattrEnabled; + switch (status) { + case PRESENT : return true; + case NOT_PRESENT : return false; + default : + // UserDefinedFileAttributeView available if extended + // attributes supported + return xattrEnabled; + } } + return super.supportsFileAttributeView(type); + } + @Override + public boolean supportsFileAttributeView(String name) { + if (name.equals("acl")) + return supportsFileAttributeView(AclFileAttributeView.class); + if (name.equals("user")) + return supportsFileAttributeView(UserDefinedFileAttributeView.class); return super.supportsFileAttributeView(name); } diff --git a/src/solaris/classes/sun/nio/fs/UnixFileStore.java b/src/solaris/classes/sun/nio/fs/UnixFileStore.java index 02397648eae122e43130f9226e9f6f360663ea1d..f19b2f90fe8755de58ea87c83096525ff13daa34 100644 --- a/src/solaris/classes/sun/nio/fs/UnixFileStore.java +++ b/src/solaris/classes/sun/nio/fs/UnixFileStore.java @@ -145,9 +145,8 @@ abstract class UnixFileStore { // lookup fstypes.properties FeatureStatus status = checkIfFeaturePresent("posix"); - if (status == FeatureStatus.NOT_PRESENT) - return false; - return true; + // assume supported if UNKNOWN + return (status != FeatureStatus.NOT_PRESENT); } return false; } diff --git a/src/windows/classes/sun/nio/fs/WindowsFileStore.java b/src/windows/classes/sun/nio/fs/WindowsFileStore.java index a906b54e0de39c2dd68d55916d5c3ae1bcdfa7f2..5af14f1673fca1baa001c3207cf73004d9f07f23 100644 --- a/src/windows/classes/sun/nio/fs/WindowsFileStore.java +++ b/src/windows/classes/sun/nio/fs/WindowsFileStore.java @@ -153,7 +153,7 @@ class WindowsFileStore public boolean supportsFileAttributeView(Class type) { if (type == null) throw new NullPointerException(); - if (type == BasicFileAttributeView.class) + if (type == BasicFileAttributeView.class || type == DosFileAttributeView.class) return true; if (type == AclFileAttributeView.class || type == FileOwnerAttributeView.class) return ((volInfo.flags() & FILE_PERSISTENT_ACLS) != 0); diff --git a/test/com/sun/jdi/BadHandshakeTest.java b/test/com/sun/jdi/BadHandshakeTest.java index a0fba898f0bfff249f8206c0c2ace022c738d21a..d5ecd0a73b84d7a07c7f94912c6b13c421309043 100644 --- a/test/com/sun/jdi/BadHandshakeTest.java +++ b/test/com/sun/jdi/BadHandshakeTest.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 6306165 + * @bug 6306165 6432567 * @summary Check that a bad handshake doesn't cause a debuggee to abort * * @build VMConnection BadHandshakeTest Exit0 diff --git a/test/java/nio/file/FileStore/Basic.java b/test/java/nio/file/FileStore/Basic.java index 604795db43591870b97ec35a27dda563ebd0c4a6..85e6b992a57922348f05c4ed364c8fd54a2a91a4 100644 --- a/test/java/nio/file/FileStore/Basic.java +++ b/test/java/nio/file/FileStore/Basic.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 + * @bug 4313887 6873621 * @summary Unit test for java.nio.file.FileStore * @library .. */ @@ -67,6 +67,15 @@ public class Basic { * Test: File and FileStore attributes */ assertTrue(store1.supportsFileAttributeView("basic")); + assertTrue(store1.supportsFileAttributeView(BasicFileAttributeView.class)); + assertTrue(store1.supportsFileAttributeView("posix") == + store1.supportsFileAttributeView(PosixFileAttributeView.class)); + assertTrue(store1.supportsFileAttributeView("dos") == + store1.supportsFileAttributeView(DosFileAttributeView.class)); + assertTrue(store1.supportsFileAttributeView("acl") == + store1.supportsFileAttributeView(AclFileAttributeView.class)); + assertTrue(store1.supportsFileAttributeView("user") == + store1.supportsFileAttributeView(UserDefinedFileAttributeView.class)); /** * Test: Enumerate all FileStores