mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-08 10:29:40 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e939fdcc12 | ||
|
|
3e56bc0689 | ||
|
|
6877bb6cd1 | ||
|
|
aab6c2301d | ||
|
|
8b63dd1c22 | ||
|
|
9baaee86b0 | ||
|
|
9e0ff20be5 | ||
|
|
f51e55a20f | ||
|
|
e68d154a63 | ||
|
|
b526f948ff | ||
|
|
fdbb6f02b8 | ||
|
|
6743f36c32 | ||
|
|
f706b93717 | ||
|
|
6f046e9f68 | ||
|
|
bac641fe77 | ||
|
|
8dfcb3fd5a | ||
|
|
ef651ca1bb | ||
|
|
3092ca0461 | ||
|
|
3caa06a639 | ||
|
|
6c50ed6690 | ||
|
|
805a5b4f75 |
@@ -117,6 +117,8 @@ bool Arguments::_has_jimage = false;
|
||||
|
||||
char* Arguments::_ext_dirs = NULL;
|
||||
|
||||
GrowableArray<const char *> *Arguments::_unrecognized_vm_options = NULL;
|
||||
|
||||
bool PathString::set_value(const char *value) {
|
||||
if (_value != NULL) {
|
||||
FreeHeap(_value);
|
||||
@@ -132,7 +134,7 @@ bool PathString::set_value(const char *value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PathString::append_value(const char *value) {
|
||||
void PathString::append_value(const char *value, const char *separator) {
|
||||
char *sp;
|
||||
size_t len = 0;
|
||||
if (value != NULL) {
|
||||
@@ -145,7 +147,7 @@ void PathString::append_value(const char *value) {
|
||||
if (sp != NULL) {
|
||||
if (_value != NULL) {
|
||||
strcpy(sp, _value);
|
||||
strcat(sp, os::path_separator());
|
||||
strcat(sp, separator);
|
||||
strcat(sp, value);
|
||||
FreeHeap(_value);
|
||||
} else {
|
||||
@@ -1217,8 +1219,10 @@ bool Arguments::process_argument(const char* arg,
|
||||
}
|
||||
} else {
|
||||
if (ignore_unrecognized) {
|
||||
store_unrecognized_vm_option(arg);
|
||||
return true;
|
||||
}
|
||||
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"Unrecognized VM option '%s'\n", argname);
|
||||
JVMFlag* fuzzy_matched = JVMFlag::fuzzy_match((const char*)argname, arg_len, true);
|
||||
@@ -1229,7 +1233,7 @@ bool Arguments::process_argument(const char* arg,
|
||||
fuzzy_matched->name(),
|
||||
(fuzzy_matched->is_bool()) ? "" : "=<value>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// allow for commandline "commenting out" options like -XX:#+Verbose
|
||||
return arg[0] == '#';
|
||||
@@ -2017,9 +2021,38 @@ bool Arguments::check_vm_args_consistency() {
|
||||
return status;
|
||||
}
|
||||
|
||||
void Arguments::set_unrecognized_vm_options_property() {
|
||||
if (_unrecognized_vm_options != NULL) {
|
||||
int num_of_entries = _unrecognized_vm_options->length();
|
||||
const char* option_string = _unrecognized_vm_options->at(0);
|
||||
|
||||
SystemProperty* prop = new SystemProperty("java.vm.unrecognized.options", "", true, false);
|
||||
|
||||
prop->set_value(option_string);
|
||||
|
||||
for (int i = 1; i < num_of_entries; i++) {
|
||||
option_string = _unrecognized_vm_options->at(i);
|
||||
prop->append_value(option_string, "\n");
|
||||
}
|
||||
|
||||
PropertyList_add(&_system_properties, prop);
|
||||
}
|
||||
}
|
||||
|
||||
void Arguments::store_unrecognized_vm_option(const char* option) {
|
||||
if (_unrecognized_vm_options == NULL) {
|
||||
// Create GrowableArray lazily, only if unrecognized vm options found
|
||||
_unrecognized_vm_options = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<const char *>(10, mtArguments);
|
||||
}
|
||||
_unrecognized_vm_options->push(option);
|
||||
}
|
||||
|
||||
bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
|
||||
const char* option_type) {
|
||||
if (ignore) return false;
|
||||
if (ignore) {
|
||||
store_unrecognized_vm_option(option->optionString);
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* spacer = " ";
|
||||
if (option_type == NULL) {
|
||||
|
||||
@@ -62,7 +62,8 @@ class PathString : public CHeapObj<mtArguments> {
|
||||
char* value() const { return _value; }
|
||||
|
||||
bool set_value(const char *value);
|
||||
void append_value(const char *value);
|
||||
void append_value(const char *value, const char *delemiter);
|
||||
void append_value(const char *value) { append_value(value, os::path_separator()); }
|
||||
|
||||
PathString(const char* value);
|
||||
~PathString();
|
||||
@@ -346,6 +347,10 @@ class Arguments : AllStatic {
|
||||
static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; }
|
||||
static bool xdebug_mode() { return _xdebug_mode; }
|
||||
|
||||
// List of unrecognized VM options
|
||||
static GrowableArray<const char *> *_unrecognized_vm_options;
|
||||
static void store_unrecognized_vm_option(const char* option);
|
||||
|
||||
// preview features
|
||||
static bool _enable_preview;
|
||||
|
||||
@@ -559,6 +564,9 @@ class Arguments : AllStatic {
|
||||
// Update/Initialize System properties after JDK version number is known
|
||||
static void init_version_specific_system_properties();
|
||||
|
||||
// Store unrecognized vm options to system property
|
||||
static void set_unrecognized_vm_options_property();
|
||||
|
||||
// Update VM info property - called after argument parsing
|
||||
static void update_vm_info_property(const char* vm_info) {
|
||||
_vm_info->set_value(vm_info);
|
||||
|
||||
@@ -1051,7 +1051,7 @@ const intx ObjectAlignmentInBytes = 8;
|
||||
product(bool, PrintVMOptions, false, \
|
||||
"Print flags that appeared on the command line") \
|
||||
\
|
||||
product(bool, IgnoreUnrecognizedVMOptions, false, \
|
||||
product(bool, IgnoreUnrecognizedVMOptions, true, \
|
||||
"Ignore unrecognized VM options") \
|
||||
\
|
||||
product(bool, PrintCommandLineFlags, false, \
|
||||
|
||||
@@ -2748,6 +2748,10 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
||||
jint parse_result = Arguments::parse(args);
|
||||
if (parse_result != JNI_OK) return parse_result;
|
||||
|
||||
// Store all unrecognized vm options to system property
|
||||
// to make it accessible from Java
|
||||
Arguments::set_unrecognized_vm_options_property();
|
||||
|
||||
os::init_before_ergo();
|
||||
|
||||
jint ergo_result = Arguments::apply_ergo();
|
||||
|
||||
@@ -234,6 +234,7 @@ void setOSNameAndVersion(java_props_t *sprops) {
|
||||
// Hardcode os_name, and fill in os_version
|
||||
sprops->os_name = strdup("Mac OS X");
|
||||
|
||||
NSString *nsVerStr = NULL;
|
||||
char* osVersionCStr = NULL;
|
||||
// Mac OS 10.9 includes the [NSProcessInfo operatingSystemVersion] function,
|
||||
// but it's not in the 10.9 SDK. So, call it via NSInvocation.
|
||||
@@ -246,7 +247,6 @@ void setOSNameAndVersion(java_props_t *sprops) {
|
||||
[invoke invokeWithTarget:[NSProcessInfo processInfo]];
|
||||
[invoke getReturnValue:&osVer];
|
||||
|
||||
NSString *nsVerStr;
|
||||
// Copy out the char* if running on version other than 10.16 Mac OS (10.16 == 11.x)
|
||||
// or explicitly requesting version compatibility
|
||||
if (!((long)osVer.majorVersion == 10 && (long)osVer.minorVersion >= 16) ||
|
||||
@@ -258,36 +258,30 @@ void setOSNameAndVersion(java_props_t *sprops) {
|
||||
nsVerStr = [NSString stringWithFormat:@"%ld.%ld.%ld",
|
||||
(long)osVer.majorVersion, (long)osVer.minorVersion, (long)osVer.patchVersion];
|
||||
}
|
||||
// Copy out the char*
|
||||
osVersionCStr = strdup([nsVerStr UTF8String]);
|
||||
} else {
|
||||
// Version 10.16, without explicit env setting of SYSTEM_VERSION_COMPAT
|
||||
// AKA 11.x; compute the version number from the letter in the ProductBuildVersion
|
||||
// AKA 11+ Read the *real* ProductVersion from the hidden link to avoid SYSTEM_VERSION_COMPAT
|
||||
// If not found, fallback below to the SystemVersion.plist
|
||||
NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile :
|
||||
@"/System/Library/CoreServices/SystemVersion.plist"];
|
||||
@"/System/Library/CoreServices/.SystemVersionPlatform.plist"];
|
||||
if (version != NULL) {
|
||||
NSString *nsBuildVerStr = [version objectForKey : @"ProductBuildVersion"];
|
||||
if (nsBuildVerStr != NULL && nsBuildVerStr.length >= 3) {
|
||||
int letter = [nsBuildVerStr characterAtIndex:2];
|
||||
if (letter >= 'B' && letter <= 'Z') {
|
||||
int vers = letter - 'A' - 1;
|
||||
asprintf(&osVersionCStr, "11.%d", vers);
|
||||
}
|
||||
}
|
||||
nsVerStr = [version objectForKey : @"ProductVersion"];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback if running on pre-10.9 Mac OS
|
||||
if (osVersionCStr == NULL) {
|
||||
if (nsVerStr == NULL) {
|
||||
NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile :
|
||||
@"/System/Library/CoreServices/SystemVersion.plist"];
|
||||
if (version != NULL) {
|
||||
NSString *nsVerStr = [version objectForKey : @"ProductVersion"];
|
||||
if (nsVerStr != NULL) {
|
||||
osVersionCStr = strdup([nsVerStr UTF8String]);
|
||||
}
|
||||
nsVerStr = [version objectForKey : @"ProductVersion"];
|
||||
}
|
||||
}
|
||||
|
||||
if (nsVerStr != NULL) {
|
||||
// Copy out the char*
|
||||
osVersionCStr = strdup([nsVerStr UTF8String]);
|
||||
}
|
||||
if (osVersionCStr == NULL) {
|
||||
osVersionCStr = strdup("Unknown");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
package java.nio.file;
|
||||
|
||||
import java.nio.file.attribute.BasicFileAttributeView;
|
||||
import java.nio.file.attribute.BasicWithKeyFileAttributeView;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
@@ -217,7 +219,11 @@ class FileTreeWalker implements Closeable {
|
||||
// links then a link target might not exist so get attributes of link
|
||||
BasicFileAttributes attrs;
|
||||
try {
|
||||
attrs = Files.readAttributes(file, BasicFileAttributes.class, linkOptions);
|
||||
BasicFileAttributeView view = Files.getFileAttributeView(file, BasicWithKeyFileAttributeView.class, linkOptions);
|
||||
if (view == null) {
|
||||
view = Files.getFileAttributeView(file, BasicFileAttributeView.class, linkOptions);
|
||||
}
|
||||
attrs = view.readAttributes();
|
||||
} catch (IOException ioe) {
|
||||
if (!followLinks)
|
||||
throw ioe;
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package java.nio.file.attribute;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Similar to {@link BasicFileAttributeView} with a hint to implementors
|
||||
* to retrieve a valid {@link BasicFileAttributes#fileKey()} if possible, even
|
||||
* at a performance cost.
|
||||
*/
|
||||
|
||||
public interface BasicWithKeyFileAttributeView
|
||||
extends BasicFileAttributeView {
|
||||
}
|
||||
@@ -41,16 +41,16 @@ import static sun.nio.fs.WindowsConstants.*;
|
||||
class WindowsDirectoryStream
|
||||
implements DirectoryStream<Path>
|
||||
{
|
||||
private static final int NATIVE_BUFFER_SIZE = 8192;
|
||||
|
||||
private final WindowsPath dir;
|
||||
private final DirectoryStream.Filter<? super Path> filter;
|
||||
|
||||
// handle to directory
|
||||
private final long handle;
|
||||
// first entry in the directory
|
||||
private final String firstName;
|
||||
// Query directory information data structure
|
||||
private final QueryDirectoryInformation queryDirectoryInformation;
|
||||
|
||||
// buffer for WIN32_FIND_DATA structure that receives information about file
|
||||
private final NativeBuffer findDataBuffer;
|
||||
// Buffer used to receive file entries from NtQueryDirectoryInformation calls
|
||||
private final NativeBuffer queryDirectoryInformationBuffer;
|
||||
|
||||
private final Object closeLock = new Object();
|
||||
|
||||
@@ -65,21 +65,15 @@ class WindowsDirectoryStream
|
||||
this.dir = dir;
|
||||
this.filter = filter;
|
||||
|
||||
this.queryDirectoryInformationBuffer = NativeBuffers.getNativeBuffer(NATIVE_BUFFER_SIZE);
|
||||
try {
|
||||
// Need to append * or \* to match entries in directory.
|
||||
// Open the directory for reading and read the first set of entries in the native buffer
|
||||
String search = dir.getPathForWin32Calls();
|
||||
char last = search.charAt(search.length() -1);
|
||||
if (last == ':' || last == '\\') {
|
||||
search += "*";
|
||||
} else {
|
||||
search += "\\*";
|
||||
}
|
||||
|
||||
FirstFile first = FindFirstFile(search);
|
||||
this.handle = first.handle();
|
||||
this.firstName = first.name();
|
||||
this.findDataBuffer = WindowsFileAttributes.getBufferForFindData();
|
||||
this.queryDirectoryInformation = OpenNtQueryDirectoryInformation(search, this.queryDirectoryInformationBuffer);
|
||||
} catch (WindowsException x) {
|
||||
// Release the buffer, as this instance is not fully constructed
|
||||
this.queryDirectoryInformationBuffer.release();
|
||||
|
||||
if (x.lastError() == ERROR_DIRECTORY) {
|
||||
throw new NotDirectoryException(dir.getPathForExceptionMessage());
|
||||
}
|
||||
@@ -99,9 +93,9 @@ class WindowsDirectoryStream
|
||||
return;
|
||||
isOpen = false;
|
||||
}
|
||||
findDataBuffer.release();
|
||||
queryDirectoryInformationBuffer.release();
|
||||
try {
|
||||
FindClose(handle);
|
||||
CloseNtQueryDirectoryInformation(queryDirectoryInformation);
|
||||
} catch (WindowsException x) {
|
||||
x.rethrowAsIOException(dir);
|
||||
}
|
||||
@@ -115,20 +109,20 @@ class WindowsDirectoryStream
|
||||
synchronized (this) {
|
||||
if (iterator != null)
|
||||
throw new IllegalStateException("Iterator already obtained");
|
||||
iterator = new WindowsDirectoryIterator(firstName);
|
||||
iterator = new WindowsDirectoryIterator();
|
||||
return iterator;
|
||||
}
|
||||
}
|
||||
|
||||
private class WindowsDirectoryIterator implements Iterator<Path> {
|
||||
private boolean atEof;
|
||||
private String first;
|
||||
private Path nextEntry;
|
||||
private String prefix;
|
||||
private int nextOffset;
|
||||
|
||||
WindowsDirectoryIterator(String first) {
|
||||
WindowsDirectoryIterator() {
|
||||
atEof = false;
|
||||
this.first = first;
|
||||
nextOffset = 0;
|
||||
if (dir.needsSlashWhenResolving()) {
|
||||
prefix = dir.toString() + "\\";
|
||||
} else {
|
||||
@@ -156,44 +150,40 @@ class WindowsDirectoryStream
|
||||
|
||||
// reads next directory entry
|
||||
private Path readNextEntry() {
|
||||
// handle first element returned by search
|
||||
if (first != null) {
|
||||
nextEntry = isSelfOrParent(first) ? null : acceptEntry(first, null);
|
||||
first = null;
|
||||
if (nextEntry != null)
|
||||
return nextEntry;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
String name = null;
|
||||
String name;
|
||||
WindowsFileAttributes attrs;
|
||||
|
||||
// synchronize on closeLock to prevent close while reading
|
||||
synchronized (closeLock) {
|
||||
try {
|
||||
if (isOpen) {
|
||||
name = FindNextFile(handle, findDataBuffer.address());
|
||||
}
|
||||
} catch (WindowsException x) {
|
||||
IOException ioe = x.asIOException(dir);
|
||||
throw new DirectoryIteratorException(ioe);
|
||||
}
|
||||
|
||||
// NO_MORE_FILES or stream closed
|
||||
if (name == null) {
|
||||
// Fetch next set of entries if we don't have anything available in buffer
|
||||
if (!isOpen) {
|
||||
atEof = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
// ignore link to self and parent directories
|
||||
if (isSelfOrParent(name))
|
||||
continue;
|
||||
if (nextOffset < 0) {
|
||||
try {
|
||||
atEof = !NextNtQueryDirectoryInformation(queryDirectoryInformation, queryDirectoryInformationBuffer);
|
||||
} catch (WindowsException x) {
|
||||
IOException ioe = x.asIOException(dir);
|
||||
throw new DirectoryIteratorException(ioe);
|
||||
}
|
||||
if (atEof) {
|
||||
return null;
|
||||
}
|
||||
nextOffset = 0;
|
||||
}
|
||||
|
||||
// grab the attributes from the WIN32_FIND_DATA structure
|
||||
// (needs to be done while holding closeLock because close
|
||||
// will release the buffer)
|
||||
attrs = WindowsFileAttributes
|
||||
.fromFindData(findDataBuffer.address());
|
||||
long fullDirInformationAddress = queryDirectoryInformationBuffer.address() + nextOffset;
|
||||
int nextEntryOffset = WindowsFileAttributes.getNextOffsetFromFileIdFullDirInformation(fullDirInformationAddress);
|
||||
nextOffset = nextEntryOffset == 0 ? -1 : nextOffset + nextEntryOffset;
|
||||
name = WindowsFileAttributes.getFileNameFromFileIdFullDirInformation(fullDirInformationAddress);
|
||||
if (isSelfOrParent(name)) {
|
||||
// Skip "." and ".."
|
||||
continue;
|
||||
}
|
||||
attrs = WindowsFileAttributes.fromFileIdFullDirInformation(fullDirInformationAddress, queryDirectoryInformation.volSerialNumber());
|
||||
}
|
||||
|
||||
// return entry if accepted by filter
|
||||
|
||||
@@ -150,6 +150,23 @@ class WindowsFileAttributeViews {
|
||||
}
|
||||
}
|
||||
|
||||
private static class BasicWithKey extends Basic {
|
||||
BasicWithKey(WindowsPath file, boolean followLinks) {
|
||||
super(file, followLinks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WindowsFileAttributes readAttributes() throws IOException {
|
||||
file.checkRead();
|
||||
try {
|
||||
return WindowsFileAttributes.getWithFileKey(file, followLinks);
|
||||
} catch (WindowsException x) {
|
||||
x.rethrowAsIOException(file);
|
||||
return null; // keep compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class Dos extends Basic implements DosFileAttributeView {
|
||||
private static final String READONLY_NAME = "readonly";
|
||||
private static final String ARCHIVE_NAME = "archive";
|
||||
@@ -289,6 +306,10 @@ class WindowsFileAttributeViews {
|
||||
return new Basic(file, followLinks);
|
||||
}
|
||||
|
||||
static Basic createBasicWithKeyView(WindowsPath file, boolean followLinks) {
|
||||
return new BasicWithKey(file, followLinks);
|
||||
}
|
||||
|
||||
static Dos createDosView(WindowsPath file, boolean followLinks) {
|
||||
return new Dos(file, followLinks);
|
||||
}
|
||||
|
||||
@@ -108,10 +108,42 @@ class WindowsFileAttributes
|
||||
private static final short OFFSETOF_FIND_DATA_SIZELOW = 32;
|
||||
private static final short OFFSETOF_FIND_DATA_RESERVED0 = 36;
|
||||
|
||||
|
||||
// used to adjust values between Windows and java epochs
|
||||
private static final long WINDOWS_EPOCH_IN_MICROS = -11644473600000000L;
|
||||
private static final long WINDOWS_EPOCH_IN_100NS = -116444736000000000L;
|
||||
|
||||
/**
|
||||
* typedef struct _FILE_ID_FULL_DIR_INFORMATION {
|
||||
* ULONG NextEntryOffset; // offset = 0
|
||||
* ULONG FileIndex; // offset = 4
|
||||
* LARGE_INTEGER CreationTime; // offset = 8
|
||||
* LARGE_INTEGER LastAccessTime; // offset = 16
|
||||
* LARGE_INTEGER LastWriteTime; // offset = 24
|
||||
* LARGE_INTEGER ChangeTime; // offset = 32
|
||||
* LARGE_INTEGER EndOfFile; // offset = 40
|
||||
* LARGE_INTEGER AllocationSize; // offset = 48
|
||||
* ULONG FileAttributes; // offset = 56
|
||||
* ULONG FileNameLength; // offset = 60
|
||||
* ULONG EaSize; // offset = 64
|
||||
* LARGE_INTEGER FileId; // offset = 72
|
||||
* WCHAR FileName[1]; // offset = 80
|
||||
* } FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION;
|
||||
*/
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_NEXT_ENTRY_OFFSET = 0;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_CREATION_TIME = 8;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_LAST_ACCESS_TIME = 16;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_LAST_WRITE_TIME = 24;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_END_OF_FILE = 40;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_FILE_ATTRIBUTES = 56;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_FILENAME_LENGTH = 60;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_EA_SIZE = 64;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_FILE_ID = 72;
|
||||
private static final int OFFSETOF_FULL_DIR_INFO_FILENAME = 80;
|
||||
|
||||
// used to adjust values between Windows and java epoch
|
||||
private static final long WINDOWS_EPOCH_IN_MICROSECONDS = -11644473600000000L;
|
||||
|
||||
// indicates if accurate metadata is required (interesting on NTFS only)
|
||||
private static final boolean ensureAccurateMetadata;
|
||||
static {
|
||||
@@ -133,6 +165,9 @@ class WindowsFileAttributes
|
||||
private final int fileIndexHigh;
|
||||
private final int fileIndexLow;
|
||||
|
||||
// created lazily
|
||||
private volatile WindowsFileKey key;
|
||||
|
||||
/**
|
||||
* Convert 64-bit value representing the number of 100-nanosecond intervals
|
||||
* since January 1, 1601 to a FileTime.
|
||||
@@ -257,6 +292,47 @@ class WindowsFileAttributes
|
||||
0); // fileIndexLow
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a WindowsFileAttributes from a FILE_ID_FULL_DIR_INFORMATION structure
|
||||
*/
|
||||
static WindowsFileAttributes fromFileIdFullDirInformation(long address, int volSerialNumber) {
|
||||
int fileAttrs = unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_FILE_ATTRIBUTES);
|
||||
long creationTime = unsafe.getLong(address + OFFSETOF_FULL_DIR_INFO_CREATION_TIME);
|
||||
long lastAccessTime = unsafe.getLong(address + OFFSETOF_FULL_DIR_INFO_LAST_ACCESS_TIME);
|
||||
long lastWriteTime = unsafe.getLong(address + OFFSETOF_FULL_DIR_INFO_LAST_WRITE_TIME);
|
||||
long size = unsafe.getLong(address + OFFSETOF_FULL_DIR_INFO_END_OF_FILE);
|
||||
int reparseTag = isReparsePoint(fileAttrs) ?
|
||||
unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_EA_SIZE) : 0;
|
||||
int fileIndexLow = unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_FILE_ID);
|
||||
int fileIndexHigh = unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_FILE_ID + 4);
|
||||
|
||||
return new WindowsFileAttributes(fileAttrs,
|
||||
creationTime,
|
||||
lastAccessTime,
|
||||
lastWriteTime,
|
||||
size,
|
||||
reparseTag,
|
||||
volSerialNumber,
|
||||
fileIndexHigh, // fileIndexHigh
|
||||
fileIndexLow); // fileIndexLow
|
||||
}
|
||||
|
||||
static int getNextOffsetFromFileIdFullDirInformation(long address) {
|
||||
return unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_NEXT_ENTRY_OFFSET);
|
||||
}
|
||||
|
||||
static String getFileNameFromFileIdFullDirInformation(long address) {
|
||||
// copy the name
|
||||
int nameLengthInBytes = unsafe.getInt(address + OFFSETOF_FULL_DIR_INFO_FILENAME_LENGTH);
|
||||
if ((nameLengthInBytes % 2) != 0) {
|
||||
throw new AssertionError("FileNameLength is not a multiple of 2");
|
||||
}
|
||||
char[] nameAsArray = new char[nameLengthInBytes/2];
|
||||
unsafe.copyMemory(null, address + OFFSETOF_FULL_DIR_INFO_FILENAME, nameAsArray,
|
||||
Unsafe.ARRAY_CHAR_BASE_OFFSET, nameLengthInBytes);
|
||||
return new String(nameAsArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the attributes of an open file
|
||||
*/
|
||||
@@ -347,6 +423,15 @@ class WindowsFileAttributes
|
||||
}
|
||||
|
||||
// file is reparse point so need to open file to get attributes
|
||||
return getWithFileKey(path, followLinks);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns attributes of given file.
|
||||
*/
|
||||
static WindowsFileAttributes getWithFileKey(WindowsPath path, boolean followLinks)
|
||||
throws WindowsException
|
||||
{
|
||||
long handle = path.openForReadAttributeAccess(followLinks);
|
||||
try {
|
||||
return readAttributes(handle);
|
||||
@@ -414,7 +499,17 @@ class WindowsFileAttributes
|
||||
|
||||
@Override
|
||||
public Object fileKey() {
|
||||
return null;
|
||||
if (volSerialNumber == 0) {
|
||||
return null;
|
||||
}
|
||||
if (key == null) {
|
||||
synchronized (this) {
|
||||
if (key == null) {
|
||||
key = new WindowsFileKey(volSerialNumber, ((long)fileIndexHigh << 32) + fileIndexLow);
|
||||
}
|
||||
}
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
// package private
|
||||
|
||||
67
src/java.base/windows/classes/sun/nio/fs/WindowsFileKey.java
Normal file
67
src/java.base/windows/classes/sun/nio/fs/WindowsFileKey.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.nio.fs;
|
||||
|
||||
/**
|
||||
* Container for volume/file id to uniquely identify file.
|
||||
*/
|
||||
|
||||
class WindowsFileKey {
|
||||
private final int volSerialNumber;
|
||||
private final long fileId;
|
||||
|
||||
WindowsFileKey(int volSerialNumber, long fileId) {
|
||||
this.volSerialNumber = volSerialNumber;
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (volSerialNumber ^ (volSerialNumber >>> 16)) +
|
||||
(int)(fileId ^ (fileId >>> 32));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this)
|
||||
return true;
|
||||
if (!(obj instanceof WindowsFileKey))
|
||||
return false;
|
||||
WindowsFileKey other = (WindowsFileKey)obj;
|
||||
return (this.volSerialNumber == other.volSerialNumber) && (this.fileId == other.fileId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("(volId=")
|
||||
.append(Integer.toHexString(volSerialNumber))
|
||||
.append(",fileId=")
|
||||
.append(Long.toHexString(fileId))
|
||||
.append(')');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -168,6 +168,8 @@ class WindowsFileSystemProvider
|
||||
boolean followLinks = Util.followLinks(options);
|
||||
if (view == BasicFileAttributeView.class)
|
||||
return (V) WindowsFileAttributeViews.createBasicView(file, followLinks);
|
||||
if (view == BasicWithKeyFileAttributeView.class)
|
||||
return (V) WindowsFileAttributeViews.createBasicWithKeyView(file, followLinks);
|
||||
if (view == DosFileAttributeView.class)
|
||||
return (V) WindowsFileAttributeViews.createDosView(file, followLinks);
|
||||
if (view == AclFileAttributeView.class)
|
||||
@@ -205,6 +207,8 @@ class WindowsFileSystemProvider
|
||||
boolean followLinks = Util.followLinks(options);
|
||||
if (name.equals("basic"))
|
||||
return WindowsFileAttributeViews.createBasicView(file, followLinks);
|
||||
if (name.equals("basicwithkey"))
|
||||
return WindowsFileAttributeViews.createBasicWithKeyView(file, followLinks);
|
||||
if (name.equals("dos"))
|
||||
return WindowsFileAttributeViews.createDosView(file, followLinks);
|
||||
if (name.equals("acl"))
|
||||
|
||||
@@ -285,6 +285,38 @@ class WindowsNativeDispatcher {
|
||||
*/
|
||||
static native void FindClose(long handle) throws WindowsException;
|
||||
|
||||
static QueryDirectoryInformation OpenNtQueryDirectoryInformation(String path, NativeBuffer buffer) throws WindowsException {
|
||||
NativeBuffer pathBuffer = asNativeBuffer(path);
|
||||
try {
|
||||
QueryDirectoryInformation data = new QueryDirectoryInformation();
|
||||
OpenNtQueryDirectoryInformation0(pathBuffer.address(), buffer.address(), buffer.size(), data);
|
||||
return data;
|
||||
} finally {
|
||||
pathBuffer.release();
|
||||
}
|
||||
}
|
||||
static class QueryDirectoryInformation {
|
||||
private long handle;
|
||||
private int volSerialNumber;
|
||||
|
||||
private QueryDirectoryInformation() { }
|
||||
public long handle() { return handle; }
|
||||
public int volSerialNumber() { return volSerialNumber; }
|
||||
}
|
||||
private static native void OpenNtQueryDirectoryInformation0(long lpFileName, long buffer, int bufferSize, QueryDirectoryInformation obj)
|
||||
throws WindowsException;
|
||||
|
||||
static boolean NextNtQueryDirectoryInformation(QueryDirectoryInformation data, NativeBuffer buffer) throws WindowsException {
|
||||
return NextNtQueryDirectoryInformation0(data.handle(), buffer.address(), buffer.size());
|
||||
}
|
||||
|
||||
private static native boolean NextNtQueryDirectoryInformation0(long handle, long buffer, int bufferSize)
|
||||
throws WindowsException;
|
||||
|
||||
static void CloseNtQueryDirectoryInformation(QueryDirectoryInformation data) throws WindowsException {
|
||||
CloseHandle(data.handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetFileInformationByHandle(
|
||||
* HANDLE hFile,
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "jni_util.h"
|
||||
#include "jlong.h"
|
||||
|
||||
#include "ntifs_min.h"
|
||||
|
||||
#include "sun_nio_fs_WindowsNativeDispatcher.h"
|
||||
|
||||
/**
|
||||
@@ -50,6 +52,9 @@ static jfieldID findFirst_attributes;
|
||||
static jfieldID findStream_handle;
|
||||
static jfieldID findStream_name;
|
||||
|
||||
static jfieldID queryDirectoryInformation_handle;
|
||||
static jfieldID queryDirectoryInformation_volSerialNumber;
|
||||
|
||||
static jfieldID volumeInfo_fsName;
|
||||
static jfieldID volumeInfo_volName;
|
||||
static jfieldID volumeInfo_volSN;
|
||||
@@ -71,6 +76,13 @@ static jfieldID completionStatus_error;
|
||||
static jfieldID completionStatus_bytesTransferred;
|
||||
static jfieldID completionStatus_completionKey;
|
||||
|
||||
typedef NTSYSCALLAPI NTSTATUS(NTAPI* NtQueryDirectoryFile_Proc) (HANDLE, HANDLE, PIO_APC_ROUTINE,
|
||||
PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS, BOOLEAN, PUNICODE_STRING, BOOLEAN);
|
||||
typedef ULONG(NTAPI* RtlNtStatusToDosError_Proc) (NTSTATUS);
|
||||
|
||||
static NtQueryDirectoryFile_Proc NtQueryDirectoryFile_func;
|
||||
static RtlNtStatusToDosError_Proc RtlNtStatusToDosError_func;
|
||||
|
||||
static void throwWindowsException(JNIEnv* env, DWORD lastError) {
|
||||
jobject x = JNU_NewObjectByName(env, "sun/nio/fs/WindowsException",
|
||||
"(I)V", lastError);
|
||||
@@ -87,6 +99,7 @@ JNIEXPORT void JNICALL
|
||||
Java_sun_nio_fs_WindowsNativeDispatcher_initIDs(JNIEnv* env, jclass this)
|
||||
{
|
||||
jclass clazz;
|
||||
HMODULE h;
|
||||
|
||||
clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$FirstFile");
|
||||
CHECK_NULL(clazz);
|
||||
@@ -104,6 +117,13 @@ Java_sun_nio_fs_WindowsNativeDispatcher_initIDs(JNIEnv* env, jclass this)
|
||||
findStream_name = (*env)->GetFieldID(env, clazz, "name", "Ljava/lang/String;");
|
||||
CHECK_NULL(findStream_name);
|
||||
|
||||
clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$QueryDirectoryInformation");
|
||||
CHECK_NULL(clazz);
|
||||
queryDirectoryInformation_handle = (*env)->GetFieldID(env, clazz, "handle", "J");
|
||||
CHECK_NULL(queryDirectoryInformation_handle);
|
||||
queryDirectoryInformation_volSerialNumber = (*env)->GetFieldID(env, clazz, "volSerialNumber", "I");;
|
||||
CHECK_NULL(queryDirectoryInformation_volSerialNumber);
|
||||
|
||||
clazz = (*env)->FindClass(env, "sun/nio/fs/WindowsNativeDispatcher$VolumeInformation");
|
||||
CHECK_NULL(clazz);
|
||||
volumeInfo_fsName = (*env)->GetFieldID(env, clazz, "fileSystemName", "Ljava/lang/String;");
|
||||
@@ -148,6 +168,16 @@ Java_sun_nio_fs_WindowsNativeDispatcher_initIDs(JNIEnv* env, jclass this)
|
||||
CHECK_NULL(completionStatus_bytesTransferred);
|
||||
completionStatus_completionKey = (*env)->GetFieldID(env, clazz, "completionKey", "J");
|
||||
CHECK_NULL(completionStatus_completionKey);
|
||||
|
||||
// get handle to ntdll
|
||||
if (GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
L"ntdll.dll", &h) != 0)
|
||||
{
|
||||
NtQueryDirectoryFile_func =
|
||||
(NtQueryDirectoryFile_Proc)GetProcAddress(h, "NtQueryDirectoryFile");
|
||||
RtlNtStatusToDosError_func =
|
||||
(RtlNtStatusToDosError_Proc)GetProcAddress(h, "RtlNtStatusToDosError");
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
@@ -428,6 +458,118 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindClose(JNIEnv* env, jclass this,
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_fs_WindowsNativeDispatcher_OpenNtQueryDirectoryInformation0(JNIEnv* env, jclass this,
|
||||
jlong address, jlong bufferAddress, jint bufferSize, jobject obj)
|
||||
{
|
||||
LPCWSTR lpFileName = jlong_to_ptr(address);
|
||||
BOOL ok;
|
||||
BY_HANDLE_FILE_INFORMATION info;
|
||||
HANDLE handle;
|
||||
NTSTATUS status;
|
||||
ULONG win32ErrorCode;
|
||||
IO_STATUS_BLOCK ioStatusBlock;
|
||||
|
||||
if ((NtQueryDirectoryFile_func == NULL) || (RtlNtStatusToDosError_func == NULL)) {
|
||||
JNU_ThrowInternalError(env, "Should not get here");
|
||||
return;
|
||||
}
|
||||
|
||||
handle = CreateFileW(lpFileName, FILE_LIST_DIRECTORY,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
if (handle == INVALID_HANDLE_VALUE) {
|
||||
throwWindowsException(env, GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
status = NtQueryDirectoryFile_func(
|
||||
handle, // FileHandle
|
||||
NULL, // Event
|
||||
NULL, // ApcRoutine
|
||||
NULL, // ApcContext
|
||||
&ioStatusBlock, // IoStatusBlock
|
||||
jlong_to_ptr(bufferAddress), // FileInformation
|
||||
bufferSize, // Length
|
||||
FileIdFullDirectoryInformation, // FileInformationClass
|
||||
FALSE, // ReturnSingleEntry
|
||||
NULL, // FileName
|
||||
FALSE); // RestartScan
|
||||
|
||||
if (!NT_SUCCESS(status)) {
|
||||
/*
|
||||
* NtQueryDirectoryFile returns STATUS_INVALID_PARAMETER when
|
||||
* asked to enumerate an invalid directory (ie it is a file
|
||||
* instead of a directory). Verify that is the actual cause
|
||||
* of the error.
|
||||
*/
|
||||
if (status == STATUS_INVALID_PARAMETER) {
|
||||
DWORD attributes = GetFileAttributesW(lpFileName);
|
||||
if ((attributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
|
||||
status = STATUS_NOT_A_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
win32ErrorCode = RtlNtStatusToDosError_func(status);
|
||||
throwWindowsException(env, win32ErrorCode);
|
||||
CloseHandle(handle);
|
||||
return;
|
||||
}
|
||||
|
||||
// This call allows retrieving the volume ID of this directory (and all its entries)
|
||||
ok = GetFileInformationByHandle(handle, &info);
|
||||
if (!ok) {
|
||||
throwWindowsException(env, GetLastError());
|
||||
CloseHandle(handle);
|
||||
return;
|
||||
}
|
||||
|
||||
(*env)->SetLongField(env, obj, queryDirectoryInformation_handle, ptr_to_jlong(handle));
|
||||
(*env)->SetIntField(env, obj, queryDirectoryInformation_volSerialNumber, info.dwVolumeSerialNumber);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_nio_fs_WindowsNativeDispatcher_NextNtQueryDirectoryInformation0(JNIEnv* env, jclass this,
|
||||
jlong handle, jlong address, jint size)
|
||||
{
|
||||
HANDLE h = (HANDLE)jlong_to_ptr(handle);
|
||||
ULONG win32ErrorCode;
|
||||
IO_STATUS_BLOCK ioStatusBlock;
|
||||
NTSTATUS status;
|
||||
|
||||
if ((NtQueryDirectoryFile_func == NULL) || (RtlNtStatusToDosError_func == NULL)) {
|
||||
JNU_ThrowInternalError(env, "Should not get here");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
status = NtQueryDirectoryFile_func(
|
||||
h, // FileHandle
|
||||
NULL, // Event
|
||||
NULL, // ApcRoutine
|
||||
NULL, // ApcContext
|
||||
&ioStatusBlock, // IoStatusBlock
|
||||
jlong_to_ptr(address), // FileInformation
|
||||
size, // Length
|
||||
FileIdFullDirectoryInformation, // FileInformationClass
|
||||
FALSE, // ReturnSingleEntry
|
||||
NULL, // FileName
|
||||
FALSE); // RestartScan
|
||||
|
||||
if (NT_SUCCESS(status)) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
// Normal completion: no more files in directory
|
||||
if (status == STATUS_NO_MORE_FILES) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
win32ErrorCode = RtlNtStatusToDosError_func(status);
|
||||
throwWindowsException(env, win32ErrorCode);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_nio_fs_WindowsNativeDispatcher_GetFileInformationByHandle(JNIEnv* env, jclass this,
|
||||
jlong handle, jlong address)
|
||||
|
||||
160
src/java.base/windows/native/libnio/fs/ntifs_min.h
Normal file
160
src/java.base/windows/native/libnio/fs/ntifs_min.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
#ifndef _NTIFS_MIN_
|
||||
#define _NTIFS_MIN_
|
||||
|
||||
/*
|
||||
* Copy necessary structures and definitions out of the Windows DDK
|
||||
* to enable calling NtQueryDirectoryFile()
|
||||
*/
|
||||
|
||||
typedef LONG NTSTATUS;
|
||||
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
|
||||
|
||||
typedef struct _UNICODE_STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PWCH Buffer;
|
||||
} UNICODE_STRING;
|
||||
typedef UNICODE_STRING *PUNICODE_STRING;
|
||||
typedef const UNICODE_STRING *PCUNICODE_STRING;
|
||||
|
||||
typedef enum _FILE_INFORMATION_CLASS {
|
||||
FileDirectoryInformation = 1,
|
||||
FileFullDirectoryInformation,
|
||||
FileBothDirectoryInformation,
|
||||
FileBasicInformation,
|
||||
FileStandardInformation,
|
||||
FileInternalInformation,
|
||||
FileEaInformation,
|
||||
FileAccessInformation,
|
||||
FileNameInformation,
|
||||
FileRenameInformation,
|
||||
FileLinkInformation,
|
||||
FileNamesInformation,
|
||||
FileDispositionInformation,
|
||||
FilePositionInformation,
|
||||
FileFullEaInformation,
|
||||
FileModeInformation,
|
||||
FileAlignmentInformation,
|
||||
FileAllInformation,
|
||||
FileAllocationInformation,
|
||||
FileEndOfFileInformation,
|
||||
FileAlternateNameInformation,
|
||||
FileStreamInformation,
|
||||
FilePipeInformation,
|
||||
FilePipeLocalInformation,
|
||||
FilePipeRemoteInformation,
|
||||
FileMailslotQueryInformation,
|
||||
FileMailslotSetInformation,
|
||||
FileCompressionInformation,
|
||||
FileObjectIdInformation,
|
||||
FileCompletionInformation,
|
||||
FileMoveClusterInformation,
|
||||
FileQuotaInformation,
|
||||
FileReparsePointInformation,
|
||||
FileNetworkOpenInformation,
|
||||
FileAttributeTagInformation,
|
||||
FileTrackingInformation,
|
||||
FileIdBothDirectoryInformation,
|
||||
FileIdFullDirectoryInformation,
|
||||
FileValidDataLengthInformation,
|
||||
FileShortNameInformation,
|
||||
FileIoCompletionNotificationInformation,
|
||||
FileIoStatusBlockRangeInformation,
|
||||
FileIoPriorityHintInformation,
|
||||
FileSfioReserveInformation,
|
||||
FileSfioVolumeInformation,
|
||||
FileHardLinkInformation,
|
||||
FileProcessIdsUsingFileInformation,
|
||||
FileNormalizedNameInformation,
|
||||
FileNetworkPhysicalNameInformation,
|
||||
FileIdGlobalTxDirectoryInformation,
|
||||
FileIsRemoteDeviceInformation,
|
||||
FileAttributeCacheInformation,
|
||||
FileNumaNodeInformation,
|
||||
FileStandardLinkInformation,
|
||||
FileRemoteProtocolInformation,
|
||||
FileMaximumInformation
|
||||
} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
|
||||
|
||||
typedef struct _FILE_ID_FULL_DIR_INFORMATION {
|
||||
ULONG NextEntryOffset;
|
||||
ULONG FileIndex;
|
||||
LARGE_INTEGER CreationTime;
|
||||
LARGE_INTEGER LastAccessTime;
|
||||
LARGE_INTEGER LastWriteTime;
|
||||
LARGE_INTEGER ChangeTime;
|
||||
LARGE_INTEGER EndOfFile;
|
||||
LARGE_INTEGER AllocationSize;
|
||||
ULONG FileAttributes;
|
||||
ULONG FileNameLength;
|
||||
ULONG EaSize;
|
||||
LARGE_INTEGER FileId;
|
||||
WCHAR FileName[1];
|
||||
} FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION;
|
||||
|
||||
typedef struct _IO_STATUS_BLOCK {
|
||||
union {
|
||||
NTSTATUS Status;
|
||||
PVOID Pointer;
|
||||
} u;
|
||||
ULONG_PTR Information;
|
||||
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
|
||||
|
||||
typedef VOID
|
||||
(NTAPI *PIO_APC_ROUTINE)(
|
||||
IN PVOID ApcContext,
|
||||
IN PIO_STATUS_BLOCK IoStatusBlock,
|
||||
IN ULONG Reserved);
|
||||
|
||||
NTSYSCALLAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtQueryDirectoryFile(
|
||||
_In_ HANDLE FileHandle,
|
||||
_In_opt_ HANDLE Event,
|
||||
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
|
||||
_In_opt_ PVOID ApcContext,
|
||||
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
|
||||
_Out_ PVOID FileInformation,
|
||||
_In_ ULONG Length,
|
||||
_In_ FILE_INFORMATION_CLASS FileInformationClass,
|
||||
_In_ BOOLEAN ReturnSingleEntry,
|
||||
_In_opt_ PUNICODE_STRING FileName,
|
||||
_In_ BOOLEAN RestartScan
|
||||
);
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
RtlNtStatusToDosError(
|
||||
NTSTATUS Status
|
||||
);
|
||||
|
||||
#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006L)
|
||||
#define STATUS_NOT_A_DIRECTORY ((NTSTATUS)0xC0000103L)
|
||||
|
||||
#endif // _NTIFS_MIN_
|
||||
@@ -57,11 +57,14 @@ NSSize getAxComponentSize(JNIEnv *env, jobject axComponent, jobject component)
|
||||
DECLARE_STATIC_METHOD_RETURN(jm_getSize, sjc_CAccessibility, "getSize",
|
||||
"(Ljavax/accessibility/AccessibleComponent;Ljava/awt/Component;)Ljava/awt/Dimension;", NSZeroSize);
|
||||
|
||||
jobject dimension = (*env)->CallStaticObjectMethod(env, jc_Dimension, jm_getSize, axComponent, component);
|
||||
jobject dimension = (*env)->CallStaticObjectMethod(env, sjc_CAccessibility, jm_getSize, axComponent, component);
|
||||
CHECK_EXCEPTION();
|
||||
|
||||
if (dimension == NULL) return NSZeroSize;
|
||||
return NSMakeSize((*env)->GetIntField(env, dimension, jf_width), (*env)->GetIntField(env, dimension, jf_height));
|
||||
|
||||
NSSize size = NSMakeSize((*env)->GetIntField(env, dimension, jf_width), (*env)->GetIntField(env, dimension, jf_height));
|
||||
(*env)->DeleteLocalRef(env, dimension);
|
||||
return size;
|
||||
}
|
||||
|
||||
NSString *getJavaRole(JNIEnv *env, jobject axComponent, jobject component)
|
||||
@@ -226,7 +229,9 @@ NSPoint getAxComponentLocationOnScreen(JNIEnv *env, jobject axComponent, jobject
|
||||
axComponent, component);
|
||||
CHECK_EXCEPTION();
|
||||
if (jpoint == NULL) return NSZeroPoint;
|
||||
return NSMakePoint((*env)->GetIntField(env, jpoint, sjf_X), (*env)->GetIntField(env, jpoint, sjf_Y));
|
||||
NSPoint p = NSMakePoint((*env)->GetIntField(env, jpoint, sjf_X), (*env)->GetIntField(env, jpoint, sjf_Y));
|
||||
(*env)->DeleteLocalRef(env, jpoint);
|
||||
return p;
|
||||
}
|
||||
|
||||
jint getAxTextCharCount(JNIEnv *env, jobject axText, jobject component)
|
||||
|
||||
@@ -40,11 +40,18 @@ NSString* JavaStringToNSString(JNIEnv *env, jstring jstr) {
|
||||
}
|
||||
|
||||
jstring NSStringToJavaString(JNIEnv* env, NSString *str) {
|
||||
|
||||
if (str == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
jstring jStr = (*env)->NewStringUTF(env, [str UTF8String]);
|
||||
jsize len = [str length];
|
||||
unichar *buffer = (unichar*)calloc(len, sizeof(unichar));
|
||||
if (buffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
NSRange crange = NSMakeRange(0, len);
|
||||
[str getCharacters:buffer range:crange];
|
||||
jstring jStr = (*env)->NewString(env, buffer, len);
|
||||
free(buffer);
|
||||
CHECK_EXCEPTION();
|
||||
return jStr;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,8 @@ module java.desktop {
|
||||
exports sun.awt.dnd to jdk.unsupported.desktop;
|
||||
exports sun.swing to jdk.unsupported.desktop;
|
||||
|
||||
exports sun.font to jetbrains.api.impl;
|
||||
|
||||
opens javax.swing.plaf.basic to
|
||||
jdk.jconsole;
|
||||
|
||||
|
||||
@@ -110,13 +110,6 @@ class XAtomList {
|
||||
atoms.remove(atom);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds or removes (depending on {@code set} value) atom to the list. Returns {@code true} if the list contents
|
||||
* has changed after the operation.
|
||||
*/
|
||||
public boolean update(XAtom atom, boolean set) {
|
||||
return set ? atoms.add(atom) : atoms.remove(atom);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns size of the list
|
||||
|
||||
@@ -168,8 +168,6 @@ public class XBaseWindow {
|
||||
|
||||
// Set WM_CLIENT_LEADER property
|
||||
initClientLeader();
|
||||
|
||||
initUserTimeWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -441,13 +439,6 @@ public class XBaseWindow {
|
||||
}
|
||||
}
|
||||
|
||||
private void initUserTimeWindow() {
|
||||
XNETProtocol netProtocol = XWM.getWM().getNETProtocol();
|
||||
if (netProtocol != null ) {
|
||||
netProtocol.setupUserTimeWindow(this);
|
||||
}
|
||||
}
|
||||
|
||||
static XRootWindow getXAWTRootWindow() {
|
||||
return XRootWindow.getInstance();
|
||||
}
|
||||
@@ -1314,12 +1305,18 @@ public class XBaseWindow {
|
||||
}
|
||||
|
||||
protected void setUserTime(long time, boolean updateGlobalTime) {
|
||||
setUserTime(time, updateGlobalTime, true);
|
||||
}
|
||||
|
||||
protected void setUserTime(long time, boolean updateGlobalTime, boolean updateWindowProperty) {
|
||||
if (updateGlobalTime && (int)time - (int)globalUserTime > 0 /* accounting for wrap-around */) {
|
||||
globalUserTime = time;
|
||||
}
|
||||
XNETProtocol netProtocol = XWM.getWM().getNETProtocol();
|
||||
if (netProtocol != null) {
|
||||
netProtocol.setUserTime(this, time);
|
||||
if (updateWindowProperty) {
|
||||
XNETProtocol netProtocol = XWM.getWM().getNETProtocol();
|
||||
if (netProtocol != null) {
|
||||
netProtocol.setUserTime(this, time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1072,10 +1072,13 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
XClientMessageEvent cl = xev.get_xclient();
|
||||
if ((wm_protocols != null) && (cl.get_message_type() == wm_protocols.getAtom())) {
|
||||
long timestamp = getTimeStampFromClientMessage(cl);
|
||||
// we should treat WM_TAKE_FOCUS and WM_DELETE_WINDOW messages as user interaction, as they can originate
|
||||
// We should treat WM_TAKE_FOCUS and WM_DELETE_WINDOW messages as user interaction, as they can originate
|
||||
// e.g. from user clicking on window title bar and window close button correspondingly
|
||||
// (there will be no ButtonPress/ButtonRelease events in those cases)
|
||||
setUserTime(timestamp, true);
|
||||
// (there will be no ButtonPress/ButtonRelease events in those cases).
|
||||
// The received timestamp will be used to set _NET_WM_USER_TIME on newly opened windows to ensure their
|
||||
// correct focusing/positioning, but we don't set it on current window to avoid race conditions (when e.g.
|
||||
// WM_TAKE_FOCUS arrives around the time of new window opening).
|
||||
setUserTime(timestamp, true, false);
|
||||
|
||||
if (cl.get_data(0) == wm_delete_window.getAtom()) {
|
||||
handleQuit();
|
||||
|
||||
@@ -63,27 +63,11 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
try {
|
||||
Dialog target = (Dialog)this.target;
|
||||
if (vis) {
|
||||
boolean modal = target.getModalityType() != Dialog.ModalityType.MODELESS;
|
||||
if (modal) {
|
||||
if (target.getModalityType() != Dialog.ModalityType.MODELESS) {
|
||||
if (!isModalBlocked()) {
|
||||
XBaseWindow.ungrabInput();
|
||||
}
|
||||
}
|
||||
if (XWM.getWMID() == XWM.KDE2_WM) {
|
||||
// In case of KDE, we inform window manager that our window is a modal dialog
|
||||
// so that it's minimized along with its parent window.
|
||||
// This is not needed for other WMs, as it seems only KDE allows minimizing 'transient'
|
||||
// windows, and setting _NET_WM_STATE_MODAL causes other WMs' undesirable behaviour.
|
||||
// GNOME (mutter WM), for example, enforces centering of modal dialogs with respect
|
||||
// to their parent, which breaks SiblingChildOrderTest.
|
||||
XNETProtocol protocol = XWM.getWM().getNETProtocol();
|
||||
if (protocol != null && protocol.doModalityProtocol()) {
|
||||
XAtomList net_wm_state = getNETWMState();
|
||||
if (net_wm_state.update(protocol.XA_NET_WM_STATE_MODAL, modal)) {
|
||||
setNETWMState(net_wm_state);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
restoreTransientFor(this);
|
||||
prevTransientFor = null;
|
||||
@@ -171,4 +155,25 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer {
|
||||
}
|
||||
return super.isFocusedWindowModalBlocker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUnmapNotifyEvent(XEvent xev) {
|
||||
super.handleUnmapNotifyEvent(xev);
|
||||
if (visible && ((Dialog)target).isModal() && XWM.getWMID() == XWM.KDE2_WM) {
|
||||
// the case of modal dialog window being minimized (iconified) on KDE
|
||||
// (other WMs don't seem to allow minimizing)
|
||||
Vector<XWindowPeer> windowPeers = collectJavaToplevels();
|
||||
for (XWindowPeer peer : windowPeers) {
|
||||
if (peer.modalBlocker == target) {
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), peer.getWindow(), peer.getScreenNumber());
|
||||
}
|
||||
finally {
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +293,6 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
XAtom XA_NET_WM_WINDOW_OPACITY = XAtom.get("_NET_WM_WINDOW_OPACITY");
|
||||
|
||||
XAtom XA_NET_WM_USER_TIME = XAtom.get("_NET_WM_USER_TIME");
|
||||
XAtom XA_NET_WM_USER_TIME_WINDOW = XAtom.get("_NET_WM_USER_TIME_WINDOW");
|
||||
|
||||
/* For _NET_WM_STATE ClientMessage requests */
|
||||
static final int _NET_WM_STATE_REMOVE =0; /* remove/unset property */
|
||||
@@ -466,20 +465,9 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt
|
||||
return (state != null && state.size() != 0 && state.contains(XA_NET_WM_STATE_HIDDEN));
|
||||
}
|
||||
|
||||
private boolean isUserTimeWindowSupported() {
|
||||
return checkProtocol(XA_NET_SUPPORTED, XA_NET_WM_USER_TIME_WINDOW);
|
||||
}
|
||||
|
||||
void setupUserTimeWindow(XBaseWindow window) {
|
||||
if (active() && isUserTimeWindowSupported()) {
|
||||
XA_NET_WM_USER_TIME_WINDOW.setWindowProperty(window, XRootWindow.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
void setUserTime(XBaseWindow window, long time) {
|
||||
if (active()) {
|
||||
XBaseWindow target = isUserTimeWindowSupported() ? XRootWindow.getInstance() : window;
|
||||
XA_NET_WM_USER_TIME.setCard32Property(target, time);
|
||||
XA_NET_WM_USER_TIME.setCard32Property(window, time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ import java.security.PrivilegedAction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
@@ -187,7 +188,9 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
}
|
||||
|
||||
static {
|
||||
final String trace = System.getProperty("sun.awt.x11.trace");
|
||||
final GetPropertyAction gpa = new GetPropertyAction("sun.awt.x11.trace");
|
||||
@SuppressWarnings("removal")
|
||||
final String trace = AccessController.doPrivileged(gpa);
|
||||
if (trace != null) {
|
||||
int traceFlags = 0;
|
||||
final StringTokenizer st = new StringTokenizer(trace, ",");
|
||||
@@ -644,9 +647,15 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
try {
|
||||
((X11GraphicsEnvironment)GraphicsEnvironment.
|
||||
getLocalGraphicsEnvironment()).rebuildDevices();
|
||||
if (useCachedInsets) resetScreenInsetsCache();
|
||||
} finally {
|
||||
awtLock();
|
||||
}
|
||||
} else if (useCachedInsets) {
|
||||
final XAtom XA_NET_WORKAREA = XAtom.get("_NET_WORKAREA");
|
||||
final boolean rootWindowWorkareaResized = (ev.get_type() == XConstants.PropertyNotify
|
||||
&& ev.get_xproperty().get_atom() == XA_NET_WORKAREA.getAtom());
|
||||
if (rootWindowWorkareaResized) resetScreenInsetsCache();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1153,8 +1162,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
* When two screens overlap and the first contains a dock(*****), then
|
||||
* _NET_WORKAREA may start at point x1,y1 and end at point x2,y2.
|
||||
*/
|
||||
@Override
|
||||
public Insets getScreenInsets(final GraphicsConfiguration gc) {
|
||||
private Insets getScreenInsetsImpl(final GraphicsConfiguration gc) {
|
||||
GraphicsDevice gd = gc.getDevice();
|
||||
XNETProtocol np = XWM.getWM().getNETProtocol();
|
||||
if (np == null || !(gd instanceof X11GraphicsDevice) || !np.active()) {
|
||||
@@ -1182,6 +1190,20 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private final Hashtable<GraphicsConfiguration, Insets> cachedInsets = new Hashtable<>();
|
||||
private void resetScreenInsetsCache() {
|
||||
cachedInsets.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getScreenInsets(final GraphicsConfiguration gc) {
|
||||
if (useCachedInsets) {
|
||||
return cachedInsets.computeIfAbsent(gc, this::getScreenInsetsImpl);
|
||||
} else {
|
||||
return getScreenInsetsImpl(gc);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The current implementation of disabling background erasing for
|
||||
* canvases is that we don't set any native background color
|
||||
@@ -2906,4 +2928,8 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
public static boolean getSunAwtDisableGrab() {
|
||||
return AccessController.doPrivileged(new GetBooleanAction("sun.awt.disablegrab"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private static final boolean useCachedInsets = Boolean.parseBoolean(AccessController.doPrivileged(
|
||||
new GetPropertyAction("x11.cache.screen.insets", "true")));
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
import sun.awt.util.ThreadGroupUtils;
|
||||
import sun.java2d.SunGraphicsEnvironment;
|
||||
@@ -136,7 +137,7 @@ public final class X11GraphicsDevice extends GraphicsDevice
|
||||
return Region.clipRound(x / (double)getScaleFactor());
|
||||
}
|
||||
|
||||
public Rectangle getBounds() {
|
||||
private Rectangle getBoundsImpl() {
|
||||
Rectangle rect = pGetBounds(getScreen());
|
||||
if (getScaleFactor() != 1) {
|
||||
rect.x = scaleDown(rect.x);
|
||||
@@ -147,6 +148,28 @@ public final class X11GraphicsDevice extends GraphicsDevice
|
||||
return rect;
|
||||
}
|
||||
|
||||
private Rectangle boundsCached;
|
||||
|
||||
private synchronized Rectangle getBoundsCached() {
|
||||
if (boundsCached == null) {
|
||||
boundsCached = getBoundsImpl();
|
||||
}
|
||||
return boundsCached;
|
||||
}
|
||||
|
||||
public synchronized void resetBoundsCache() {
|
||||
boundsCached = null;
|
||||
}
|
||||
|
||||
public Rectangle getBounds() {
|
||||
if (X11GraphicsEnvironment.useBoundsCache()) {
|
||||
return getBoundsCached();
|
||||
}
|
||||
else {
|
||||
return getBoundsImpl();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the identification string associated with this graphics
|
||||
* device.
|
||||
@@ -633,5 +656,6 @@ public final class X11GraphicsDevice extends GraphicsDevice
|
||||
|
||||
public void invalidate(X11GraphicsDevice device) {
|
||||
screen = device.screen;
|
||||
if (X11GraphicsEnvironment.useBoundsCache()) resetBoundsCache();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
import java.security.AccessController;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
import sun.awt.X11.XToolkit;
|
||||
import sun.java2d.SunGraphicsEnvironment;
|
||||
@@ -254,6 +256,12 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (useBoundsCache()) {
|
||||
for (final X11GraphicsDevice gd : devices.values()) {
|
||||
gd.resetBoundsCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -378,4 +386,12 @@ public final class X11GraphicsEnvironment extends SunGraphicsEnvironment {
|
||||
@Override
|
||||
public void paletteChanged() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private static final boolean cacheScreenBoundsValue = Boolean.parseBoolean(AccessController.doPrivileged(
|
||||
new GetPropertyAction("x11.cache.screen.bounds", "true")));
|
||||
|
||||
public static boolean useBoundsCache() {
|
||||
return cacheScreenBoundsValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1335,9 +1335,12 @@ static int getRemoteX11WorkaroundProperty() {
|
||||
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
|
||||
jstring name = (*env)->NewStringUTF(env, WORKAROUND_PROPERTY_NAME);
|
||||
CHECK_NULL_RETURN(name, ret);
|
||||
jstring jPropValue = JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "getProperty",
|
||||
"(Ljava/lang/String;)Ljava/lang/String;", name).l;
|
||||
if (jPropValue != NULL) {
|
||||
jobject jPropGetAction = JNU_NewObjectByName(env, "sun/security/action/GetPropertyAction", "(Ljava/lang/String;)V", name);
|
||||
CHECK_NULL_RETURN(name, ret);
|
||||
jboolean ignoreExc;
|
||||
jstring jPropValue = JNU_CallStaticMethodByName(env, &ignoreExc, "java/security/AccessController", "doPrivileged",
|
||||
"(Ljava/security/PrivilegedAction;)Ljava/lang/Object;", jPropGetAction).l;
|
||||
if (jPropValue != NULL && JNU_IsInstanceOfByName(env, jPropValue, "java/lang/String")) {
|
||||
const char * utf8string = (*env)->GetStringUTFChars(env, jPropValue, NULL);
|
||||
if (utf8string != NULL) {
|
||||
if (strcmp(utf8string, "true") == 0) {
|
||||
@@ -1348,7 +1351,6 @@ static int getRemoteX11WorkaroundProperty() {
|
||||
}
|
||||
(*env)->ReleaseStringUTFChars(env, jPropValue, utf8string);
|
||||
}
|
||||
(*env)->DeleteLocalRef(env, name);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -168,10 +168,6 @@ final class WInputMethod extends InputMethodAdapter
|
||||
|
||||
@Override
|
||||
public boolean setLocale(Locale lang) {
|
||||
return setLocale(lang, false);
|
||||
}
|
||||
|
||||
private boolean setLocale(Locale lang, boolean onActivate) {
|
||||
Locale[] available = WInputMethodDescriptor.getAvailableLocalesInternal();
|
||||
for (int i = 0; i < available.length; i++) {
|
||||
Locale locale = available[i];
|
||||
@@ -180,7 +176,7 @@ final class WInputMethod extends InputMethodAdapter
|
||||
locale.equals(Locale.JAPAN) && lang.equals(Locale.JAPANESE) ||
|
||||
locale.equals(Locale.KOREA) && lang.equals(Locale.KOREAN)) {
|
||||
if (isActive) {
|
||||
setNativeLocale(locale.toLanguageTag(), onActivate);
|
||||
setNativeLocale(locale.toLanguageTag());
|
||||
}
|
||||
currentLocale = locale;
|
||||
return true;
|
||||
@@ -319,9 +315,6 @@ final class WInputMethod extends InputMethodAdapter
|
||||
isLastFocussedActiveClient = isAc;
|
||||
}
|
||||
isActive = true;
|
||||
if (currentLocale != null) {
|
||||
setLocale(currentLocale, true);
|
||||
}
|
||||
|
||||
// Compare IM's composition string with Java's composition string
|
||||
if (hasCompositionString && !isCompositionStringAvailable(context)) {
|
||||
@@ -348,10 +341,6 @@ final class WInputMethod extends InputMethodAdapter
|
||||
@Override
|
||||
public void deactivate(boolean isTemporary)
|
||||
{
|
||||
// Sync currentLocale with the Windows keyboard layout which might be changed
|
||||
// by hot key
|
||||
getLocale();
|
||||
|
||||
// Delay calling disableNativeIME until activate is called and the newly
|
||||
// focussed component has a different peer as the last focussed component.
|
||||
if (awtFocussedComponentPeer != null) {
|
||||
@@ -667,7 +656,7 @@ final class WInputMethod extends InputMethodAdapter
|
||||
private native void setStatusWindowVisible(WComponentPeer peer, boolean visible);
|
||||
private native String getNativeIMMDescription();
|
||||
static native Locale getNativeLocale();
|
||||
static native boolean setNativeLocale(String localeName, boolean onActivate);
|
||||
static native boolean setNativeLocale(String localeName);
|
||||
private native void openCandidateWindow(WComponentPeer peer, int x, int y);
|
||||
private native boolean isCompositionStringAvailable(int context);
|
||||
}
|
||||
|
||||
@@ -87,15 +87,6 @@ static DCList passiveDCList;
|
||||
|
||||
extern void CheckFontSmoothingSettings(HWND);
|
||||
|
||||
extern "C" {
|
||||
// Remember the input language has changed by some user's action
|
||||
// (Alt+Shift or through the language icon on the Taskbar) to control the
|
||||
// race condition between the toolkit thread and the AWT event thread.
|
||||
// This flag remains TRUE until the next WInputMethod.getNativeLocale() is
|
||||
// issued.
|
||||
BOOL g_bUserHasChangedInputLang = FALSE;
|
||||
}
|
||||
|
||||
BOOL AwtComponent::sm_suppressFocusAndActivation = FALSE;
|
||||
BOOL AwtComponent::sm_restoreFocusAndActivation = FALSE;
|
||||
HWND AwtComponent::sm_focusOwner = NULL;
|
||||
@@ -1847,9 +1838,6 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
::ToAsciiEx(VK_SPACE, ::MapVirtualKey(VK_SPACE, 0),
|
||||
keyboardState, &ignored, 0, GetKeyboardLayout());
|
||||
|
||||
// Set this flag to block ActivateKeyboardLayout from
|
||||
// WInputMethod.activate()
|
||||
g_bUserHasChangedInputLang = TRUE;
|
||||
CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
|
||||
break;
|
||||
}
|
||||
@@ -1858,7 +1846,6 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
"new = 0x%08X",
|
||||
GetHWnd(), GetClassName(), (UINT)lParam);
|
||||
mr = WmInputLangChange(static_cast<UINT>(wParam), reinterpret_cast<HKL>(lParam));
|
||||
g_bUserHasChangedInputLang = TRUE;
|
||||
CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
|
||||
// should return non-zero if we process this message
|
||||
retValue = 1;
|
||||
|
||||
@@ -44,8 +44,6 @@ extern "C" {
|
||||
jobject CreateLocaleObject(JNIEnv *env, const char * name);
|
||||
HKL getDefaultKeyboardLayout();
|
||||
|
||||
extern BOOL g_bUserHasChangedInputLang;
|
||||
|
||||
/*
|
||||
* Class: sun_awt_windows_WInputMethod
|
||||
* Method: createNativeContext
|
||||
@@ -292,10 +290,6 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_WInputMethod_getNativeLocale
|
||||
|
||||
const char * javaLocaleName = getJavaIDFromLangID(AwtComponent::GetInputLanguage());
|
||||
if (javaLocaleName != NULL) {
|
||||
// Now WInputMethod.currentLocale and AwtComponent::m_idLang are get sync'ed,
|
||||
// so we can reset this flag.
|
||||
g_bUserHasChangedInputLang = FALSE;
|
||||
|
||||
jobject ret = CreateLocaleObject(env, javaLocaleName);
|
||||
free((void *)javaLocaleName);
|
||||
return ret;
|
||||
@@ -309,10 +303,10 @@ JNIEXPORT jobject JNICALL Java_sun_awt_windows_WInputMethod_getNativeLocale
|
||||
/*
|
||||
* Class: sun_awt_windows_WInputMethod
|
||||
* Method: setNativeLocale
|
||||
* Signature: (Ljava/lang/String;Z)Z
|
||||
* Signature: (Ljava/lang/String;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WInputMethod_setNativeLocale
|
||||
(JNIEnv *env, jclass cls, jstring localeString, jboolean onActivate)
|
||||
(JNIEnv *env, jclass cls, jstring localeString)
|
||||
{
|
||||
TRY;
|
||||
|
||||
@@ -353,7 +347,7 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WInputMethod_setNativeLocale
|
||||
if (supported != NULL) {
|
||||
if (strcmp(supported, requested) == 0) {
|
||||
// use special message to call ActivateKeyboardLayout() in main thread.
|
||||
if (AwtToolkit::GetInstance().SendMessage(WM_AWT_ACTIVATEKEYBOARDLAYOUT, (WPARAM)onActivate, (LPARAM)hKLList[i])) {
|
||||
if (AwtToolkit::GetInstance().SendMessage(WM_AWT_ACTIVATEKEYBOARDLAYOUT, 0, (LPARAM)hKLList[i])) {
|
||||
//also need to change the same keyboard layout for the Java AWT-EventQueue thread
|
||||
AwtToolkit::activateKeyboardLayout(hKLList[i]);
|
||||
retValue = JNI_TRUE;
|
||||
|
||||
@@ -71,7 +71,6 @@ extern void initScreens(JNIEnv *env);
|
||||
extern "C" void awt_dnd_initialize();
|
||||
extern "C" void awt_dnd_uninitialize();
|
||||
extern "C" void awt_clipboard_uninitialize(JNIEnv *env);
|
||||
extern "C" BOOL g_bUserHasChangedInputLang;
|
||||
|
||||
extern CriticalSection windowMoveLock;
|
||||
extern BOOL windowMoveLockHeld;
|
||||
@@ -1218,14 +1217,6 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
|
||||
return cmode;
|
||||
}
|
||||
case WM_AWT_ACTIVATEKEYBOARDLAYOUT: {
|
||||
if (wParam && g_bUserHasChangedInputLang) {
|
||||
// Input language has been changed since the last WInputMethod.getNativeLocale()
|
||||
// call. So let's honor the user's selection.
|
||||
// Note: we need to check this flag inside the toolkit thread to synchronize access
|
||||
// to the flag.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (lParam == (LPARAM)::GetKeyboardLayout(0)) {
|
||||
// already active
|
||||
return FALSE;
|
||||
|
||||
@@ -713,7 +713,7 @@ final class ZipPath implements Path {
|
||||
if (type == FileOwnerAttributeView.class)
|
||||
return (V)new ZipPosixFileAttributeView(this,true);
|
||||
}
|
||||
throw new UnsupportedOperationException("view <" + type + "> is not supported");
|
||||
return null;
|
||||
}
|
||||
|
||||
private ZipFileAttributeView getFileAttributeView(String type) {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2021 JetBrains s.r.o.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.jetbrains.impl;
|
||||
|
||||
import com.jetbrains.ExtendedGlyphCache;
|
||||
|
||||
import java.awt.*;
|
||||
import sun.font.FontUtilities;
|
||||
|
||||
public class ExtendedGlyphCacheImpl implements ExtendedGlyphCache.V1 {
|
||||
|
||||
@Override
|
||||
public Dimension getSubpixelResolution() {
|
||||
return FontUtilities.subpixelResolution;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.jetbrains.impl;
|
||||
|
||||
import com.jetbrains.SampleJBRApi;
|
||||
|
||||
// Here we just implement latest API version
|
||||
public class SampleJBRApiImpl implements SampleJBRApi.V2 {
|
||||
|
||||
@Override
|
||||
public void someMethod1(SomeDataClass arg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SomeDataClass someMethod2() {
|
||||
return new SomeDataClass();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import com.jetbrains.JBRService;
|
||||
import com.jetbrains.impl.SampleJBRApiImpl;
|
||||
import com.jetbrains.impl.*;
|
||||
|
||||
module jetbrains.api.impl {
|
||||
|
||||
@@ -23,6 +23,6 @@ module jetbrains.api.impl {
|
||||
|
||||
// We probably don't want to add `provides with` for each version of API, so we just provide `JBRService`
|
||||
// implementation, `JBRService#load` will take care of the rest
|
||||
provides JBRService with SampleJBRApiImpl;
|
||||
provides JBRService with ExtendedGlyphCacheImpl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2021 JetBrains s.r.o.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.jetbrains;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public interface ExtendedGlyphCache extends JBRService {
|
||||
|
||||
|
||||
interface V1 extends ExtendedGlyphCache {
|
||||
|
||||
Dimension getSubpixelResolution();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.jetbrains;
|
||||
|
||||
// SampleJBRApi is a base of our feature API, it's just a marker interface extending JBRService
|
||||
public interface SampleJBRApi extends JBRService {
|
||||
|
||||
|
||||
// And actual API goes from V1
|
||||
interface V1 extends SampleJBRApi {
|
||||
|
||||
void someMethod1(SomeDataClass arg);
|
||||
|
||||
class SomeDataClass {
|
||||
public SomeDataClass() {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// When we need to add something to our API, we create interface for a new version, extending previous one
|
||||
interface V2 extends V1 {
|
||||
|
||||
SomeDataClass someMethod2();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,6 +18,8 @@ import com.jetbrains.JBRService;
|
||||
|
||||
module jetbrains.api {
|
||||
|
||||
requires transitive java.desktop;
|
||||
|
||||
exports com.jetbrains;
|
||||
|
||||
uses JBRService;
|
||||
|
||||
@@ -42,6 +42,7 @@ public class TestUnrecognizedVMOptionsHandling {
|
||||
public static void main(String args[]) throws Exception {
|
||||
// The first two JAVA processes are expected to fail, but with a correct VM option suggestion
|
||||
ProcessBuilder pb = GCArguments.createJavaProcessBuilder(
|
||||
"-XX:-IgnoreUnrecognizedVMOptions",
|
||||
"-XX:+UseDynamicNumberOfGcThreads",
|
||||
"-version"
|
||||
);
|
||||
@@ -52,6 +53,7 @@ public class TestUnrecognizedVMOptionsHandling {
|
||||
}
|
||||
|
||||
pb = GCArguments.createJavaProcessBuilder(
|
||||
"-XX:-IgnoreUnrecognizedVMOptions",
|
||||
"-XX:MaxiumHeapSize=500m",
|
||||
"-version"
|
||||
);
|
||||
@@ -63,6 +65,7 @@ public class TestUnrecognizedVMOptionsHandling {
|
||||
|
||||
// The last JAVA process should run successfully for the purpose of sanity check
|
||||
pb = GCArguments.createJavaProcessBuilder(
|
||||
"-XX:-IgnoreUnrecognizedVMOptions",
|
||||
"-XX:+UseDynamicNumberOfGCThreads",
|
||||
"-version"
|
||||
);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TestUnrecognizedVmOption {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-showversion", "-XX:" + OPTION);
|
||||
"-showversion", "-XX:-IgnoreUnrecognizedVMOptions", "-XX:" + OPTION);
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldNotHaveExitValue(0)
|
||||
.shouldContain("Unrecognized VM option")
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ConfigFileWarning {
|
||||
pw.println("aaa");
|
||||
pw.close();
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:Flags=hs_flags.txt","-version");
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:Flags=hs_flags.txt","-XX:-IgnoreUnrecognizedVMOptions","-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unrecognized VM option 'aaa'");
|
||||
output.shouldHaveExitValue(1);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class TestLongUnrecognizedVMOption {
|
||||
public static void main(String[] args) throws Exception {
|
||||
OutputAnalyzer output;
|
||||
|
||||
output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder("-XX:" + VERY_LONG_OPTION, "-version").start());
|
||||
output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder("-XX:" + VERY_LONG_OPTION,"-XX:-IgnoreUnrecognizedVMOptions","-version").start());
|
||||
output.shouldHaveExitValue(1);
|
||||
output.shouldContain(String.format("Unrecognized VM option '%s'", VERY_LONG_OPTION));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TestNullTerminatedFlags {
|
||||
for (String option : options) {
|
||||
String testOption = option + "junk";
|
||||
ProcessBuilder pb =
|
||||
ProcessTools.createJavaProcessBuilder(testOption, "-version");
|
||||
ProcessTools.createJavaProcessBuilder(testOption, "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
new OutputAnalyzer(pb.start())
|
||||
.shouldContain("Unrecognized option: " + testOption)
|
||||
.shouldHaveExitValue(1);
|
||||
|
||||
@@ -44,7 +44,7 @@ public class UnrecognizedVMOption {
|
||||
};
|
||||
for (String option : badOptions) {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:" + option, "-version");
|
||||
"-XX:" + option, "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Unrecognized VM option '" + option + "'");
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8006298 8204055
|
||||
* @summary Using an unrecognized VM option should print the name of the option
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xverify:BadV -XX-BadSyn -Bad -XX:+BadXX01 -XX:+BadXX02 -XX:+Bad:SC UnrecognizedVMOptionsProperty
|
||||
*/
|
||||
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class UnrecognizedVMOptionsProperty {
|
||||
public static void main(String[] args) throws Exception {
|
||||
String badOptions = System.getProperty("java.vm.unrecognized.options");
|
||||
System.out.println("Found unrecognized VM options " + badOptions);
|
||||
if (! badOptions.equals("-Xverify:BadV\n-XX-BadSyn\n-Bad\n+BadXX01\n+BadXX02\n+Bad:SC")) {
|
||||
throw new RuntimeException("Invalid value of 'java.vm.unrecognized.options' property '" + badOptions + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ import jdk.test.lib.Platform;
|
||||
|
||||
public class VMOptionWarning {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-version");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+AlwaysSafeConstructors", "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Error: VM option 'AlwaysSafeConstructors' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.");
|
||||
|
||||
@@ -46,15 +46,15 @@ public class VMOptionWarning {
|
||||
return;
|
||||
}
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-version");
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintInlining", "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version");
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version");
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-XX:-IgnoreUnrecognizedVMOptions", "-version");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM.");
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ public class TestVMOptionsFile {
|
||||
private static ProcessBuilder createProcessBuilder() throws Exception {
|
||||
ProcessBuilder pb;
|
||||
List<String> runJava = new ArrayList<>();
|
||||
runJava.add("-XX:-IgnoreUnrecognizedVMOptions");
|
||||
|
||||
runJava.addAll(VMParams);
|
||||
runJava.add(PrintPropertyAndOptions.class.getName());
|
||||
|
||||
@@ -52,9 +52,7 @@ public class SiblingChildOrderTest
|
||||
frame.setVisible(true);
|
||||
});
|
||||
|
||||
Robot robot = new Robot();
|
||||
for (int i = 0; i < colors.length; i++) {
|
||||
robot.delay(100);
|
||||
int finalI = i;
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
dlgs[finalI] = new JDialog(frame, "DLG " + finalI, true);
|
||||
@@ -65,6 +63,7 @@ public class SiblingChildOrderTest
|
||||
});
|
||||
}
|
||||
|
||||
Robot robot = new Robot();
|
||||
robot.waitForIdle();
|
||||
robot.delay(1000);
|
||||
|
||||
|
||||
100
test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlSpace.java
Normal file
100
test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlSpace.java
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
@test
|
||||
@key headful
|
||||
@bug 8272602
|
||||
@summary Ctrl+Space should generate a KeyTyped event on macOS
|
||||
@run main CtrlSpace
|
||||
*/
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Panel;
|
||||
import java.awt.TextField;
|
||||
import java.awt.Robot;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
|
||||
public class CtrlSpace extends Frame implements KeyListener {
|
||||
|
||||
static volatile boolean testPassed = false;
|
||||
static volatile Robot robot;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
robot = new Robot();
|
||||
robot.setAutoWaitForIdle(true);
|
||||
robot.setAutoDelay(100);
|
||||
|
||||
Frame frame = createAndShowGUI(robot);
|
||||
|
||||
test(robot);
|
||||
robot.waitForIdle();
|
||||
Thread.sleep(2000);
|
||||
frame.setVisible(false);
|
||||
frame.dispose();
|
||||
if (!testPassed) {
|
||||
throw new RuntimeException("No KeyTyped event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static Frame createAndShowGUI(Robot robot) {
|
||||
CtrlSpace win = new CtrlSpace();
|
||||
win.setSize(300, 300);
|
||||
Panel panel = new Panel(new BorderLayout());
|
||||
TextField textField = new TextField("abcdefghijk");
|
||||
textField.addKeyListener(win);
|
||||
panel.add(textField, BorderLayout.CENTER);
|
||||
win.add(panel);
|
||||
win.setVisible(true);
|
||||
robot.waitForIdle();
|
||||
textField.requestFocusInWindow();
|
||||
robot.waitForIdle();
|
||||
return win;
|
||||
}
|
||||
|
||||
public static void test(Robot robot) {
|
||||
robot.keyPress(KeyEvent.VK_CONTROL);
|
||||
robot.keyPress(KeyEvent.VK_SPACE);
|
||||
robot.keyRelease(KeyEvent.VK_SPACE);
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
robot.delay(200);
|
||||
}
|
||||
|
||||
public void keyPressed(KeyEvent evt) {
|
||||
System.out.println("Pressed " + evt);
|
||||
}
|
||||
|
||||
public void keyReleased(KeyEvent evt) {
|
||||
System.out.println("Released " + evt);
|
||||
}
|
||||
|
||||
public void keyTyped(KeyEvent evt) {
|
||||
System.out.println("Typed " + evt);
|
||||
testPassed = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,8 @@ import java.nio.file.WatchService;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.nio.file.attribute.FileAttribute;
|
||||
import java.nio.file.attribute.FileAttributeView;
|
||||
import java.nio.file.attribute.FileTime;
|
||||
import java.nio.file.attribute.BasicFileAttributeView;
|
||||
import java.nio.file.attribute.UserPrincipalLookupService;
|
||||
import java.nio.file.spi.FileSystemProvider;
|
||||
import java.util.Iterator;
|
||||
@@ -323,12 +325,44 @@ class FaultyFileSystem extends FileSystem {
|
||||
return Files.readAttributes(unwrap(file), attributes, options);
|
||||
}
|
||||
|
||||
private class FaultyBasicFileAttributeView implements BasicFileAttributeView {
|
||||
private final Path file;
|
||||
private final LinkOption[] options;
|
||||
|
||||
public FaultyBasicFileAttributeView(final Path file, final LinkOption... options) {
|
||||
this.file = file;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "faulty";
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicFileAttributes readAttributes() throws IOException {
|
||||
triggerEx(file, "readAttributes");
|
||||
return Files.readAttributes(file, BasicFileAttributes.class, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimes(FileTime lastModifiedTime,
|
||||
FileTime lastAccessTime,
|
||||
FileTime createTime) throws IOException {
|
||||
triggerEx(file, "setTimes");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V extends FileAttributeView> V getFileAttributeView(Path file,
|
||||
Class<V> type,
|
||||
LinkOption... options)
|
||||
{
|
||||
return Files.getFileAttributeView(unwrap(file), type, options);
|
||||
if (type != BasicFileAttributeView.class) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (V)new FaultyBasicFileAttributeView(unwrap(file), options);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
80
test/jdk/java/nio/file/Files/walkFileTree/NonLatin.java
Normal file
80
test/jdk/java/nio/file/Files/walkFileTree/NonLatin.java
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, JetBrains s.r.o.. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Tests that walkFileTree can find files in a directory with
|
||||
* non-latin characters in the name (including ones from
|
||||
* the supplementary plane)
|
||||
* @library /test/lib
|
||||
*/
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Vector;
|
||||
import java.util.HashSet;
|
||||
|
||||
import jdk.test.lib.Asserts;
|
||||
|
||||
public class NonLatin {
|
||||
// Use non-Latin characters from basic (\u1889) and supplementary (\uD844\uDDD9) Unicode planes
|
||||
private static final String NON_LATIN_PATH_NAME = "ka-\u1889-supp-\uD844\uDDD9";
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
final Path currentDirPath = Paths.get(".").toAbsolutePath();
|
||||
Path nonLatinPath = null;
|
||||
|
||||
try {
|
||||
nonLatinPath = currentDirPath.resolve(NON_LATIN_PATH_NAME);
|
||||
Files.createDirectory(nonLatinPath);
|
||||
final Path underNonLatinPath = nonLatinPath.resolve("dir");
|
||||
Files.createDirectory(underNonLatinPath);
|
||||
} catch (java.nio.file.InvalidPathException e) {
|
||||
System.out.println("Cannot create the directory with the right name. Test is considered passed");
|
||||
return;
|
||||
}
|
||||
|
||||
final Vector<String> visitedDirs = new Vector<String>();
|
||||
|
||||
Files.walkFileTree(nonLatinPath, new HashSet<FileVisitOption>(), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
|
||||
@Override
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
|
||||
visitedDirs.add(dir.toString());
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
|
||||
boolean found = false;
|
||||
for (final String dirName : visitedDirs) {
|
||||
System.out.println("Found: " + dirName);
|
||||
found |= dirName.contains(NON_LATIN_PATH_NAME);
|
||||
}
|
||||
Asserts.assertTrue(found);
|
||||
}
|
||||
}
|
||||
@@ -245,20 +245,23 @@ public class CustomComboBoxFocusTest {
|
||||
System.out.println("Request focus on " + target);
|
||||
final Component c = target.getEditor().getEditorComponent();
|
||||
|
||||
c.addFocusListener(new FocusListener() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
}
|
||||
if (c.isFocusOwner()) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
} else {
|
||||
c.addFocusListener(new FocusListener() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
SwingUtilities.invokeLater(focusHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
c.requestFocus();
|
||||
}
|
||||
});
|
||||
|
||||
c.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
public Step nextStep() {
|
||||
|
||||
@@ -56,21 +56,21 @@ public class JBRServiceTest {
|
||||
* it in 'instanceof' statement will cause loading this interface, which may in turn cause NoClassDefFoundError.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// Declaring variables is safe
|
||||
SampleJBRApi.V1 service;
|
||||
// We pass lambda instead of plain class. This allows JBRService#load to deal with NoClassDefFoundErrors
|
||||
service = JBRService.load(() -> SampleJBRApi.V1.class);
|
||||
// Null-checking variables is safe too
|
||||
Objects.requireNonNull(service);
|
||||
// When we ensured that SampleJBRApi.V1 is available, we can use anything that's inside
|
||||
service.someMethod1(null);
|
||||
// We can also create SampleJBRApi.V1.SomeDataClass instances, as we know they're supported with V1
|
||||
service.someMethod1(new SampleJBRApi.V1.SomeDataClass());
|
||||
|
||||
// But don't try doing 'service instanceof SampleJBRApi.V2' as it may cause NoClassDefFoundErrors!
|
||||
SampleJBRApi.V2 service2 = Objects.requireNonNull(JBRService.load(() -> SampleJBRApi.V2.class));
|
||||
// Versioned service interfaces are inherited, so V2 gives you access to both V2 and V1 API
|
||||
service2.someMethod1(service2.someMethod2());
|
||||
// // Declaring variables is safe
|
||||
// SampleJBRApi.V1 service;
|
||||
// // We pass lambda instead of plain class. This allows JBRService#load to deal with NoClassDefFoundErrors
|
||||
// service = JBRService.load(() -> SampleJBRApi.V1.class);
|
||||
// // Null-checking variables is safe too
|
||||
// Objects.requireNonNull(service);
|
||||
// // When we ensured that SampleJBRApi.V1 is available, we can use anything that's inside
|
||||
// service.someMethod1(null);
|
||||
// // We can also create SampleJBRApi.V1.SomeDataClass instances, as we know they're supported with V1
|
||||
// service.someMethod1(new SampleJBRApi.V1.SomeDataClass());
|
||||
//
|
||||
// // But don't try doing 'service instanceof SampleJBRApi.V2' as it may cause NoClassDefFoundErrors!
|
||||
// SampleJBRApi.V2 service2 = Objects.requireNonNull(JBRService.load(() -> SampleJBRApi.V2.class));
|
||||
// // Versioned service interfaces are inherited, so V2 gives you access to both V2 and V1 API
|
||||
// service2.someMethod1(service2.someMethod2());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public class TypeaheadRequestFocusTest {
|
||||
initFinished.get(10, TimeUnit.SECONDS);
|
||||
clickOn(frameField);
|
||||
SwingUtilities.invokeAndWait(TypeaheadRequestFocusTest::showPopup);
|
||||
robot.delay(1000);
|
||||
pressAndRelease(KeyEvent.VK_ENTER);
|
||||
pressAndRelease(KeyEvent.VK_A);
|
||||
typedInPopup.get(10, TimeUnit.SECONDS);
|
||||
|
||||
133
test/jdk/jb/java/awt/Window/ModalDialogMinimizeOnKDE.java
Normal file
133
test/jdk/jb/java/awt/Window/ModalDialogMinimizeOnKDE.java
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright 2021 JetBrains s.r.o.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @summary Regression test for JBR-3726 Modal windows 'disappear' on minimize in KDE
|
||||
* @key headful
|
||||
* @requires os.family == "linux"
|
||||
* @modules java.desktop/java.awt:open
|
||||
* java.desktop/sun.awt
|
||||
* java.desktop/sun.awt.X11:open
|
||||
*/
|
||||
|
||||
public class ModalDialogMinimizeOnKDE {
|
||||
private static final CompletableFuture<Boolean> dialogShown = new CompletableFuture<>();
|
||||
private static JFrame frame;
|
||||
private static JDialog dialog;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (!isKDE()) {
|
||||
System.out.println("This test is only valid for KDE");
|
||||
return;
|
||||
}
|
||||
Robot robot = new Robot();
|
||||
try {
|
||||
SwingUtilities.invokeLater(ModalDialogMinimizeOnKDE::initUI);
|
||||
dialogShown.get(5, TimeUnit.SECONDS);
|
||||
robot.delay(1000);
|
||||
minimize(dialog);
|
||||
robot.delay(1000);
|
||||
if (frame.getState() != Frame.ICONIFIED) {
|
||||
throw new RuntimeException("Parent frame isn't minimized");
|
||||
}
|
||||
} finally {
|
||||
SwingUtilities.invokeAndWait(ModalDialogMinimizeOnKDE::disposeUI);
|
||||
}
|
||||
}
|
||||
|
||||
private static void initUI() {
|
||||
frame = new JFrame("ModalDialogMinimizeOnKDE");
|
||||
frame.setSize(300, 200);
|
||||
frame.setVisible(true);
|
||||
dialog = new JDialog(frame, true);
|
||||
dialog.setSize(200, 100);
|
||||
dialog.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowOpened(WindowEvent e) {
|
||||
dialogShown.complete(true);
|
||||
}
|
||||
});
|
||||
dialog.setVisible(true);
|
||||
}
|
||||
|
||||
private static void disposeUI() {
|
||||
if (frame != null) frame.dispose();
|
||||
}
|
||||
|
||||
private static boolean isKDE() throws Exception {
|
||||
Class<?> xwmCls = Class.forName("sun.awt.X11.XWM");
|
||||
|
||||
Field kdeField = xwmCls.getDeclaredField("KDE2_WM");
|
||||
kdeField.setAccessible(true);
|
||||
|
||||
Method wmidMethod = xwmCls.getDeclaredMethod("getWMID");
|
||||
wmidMethod.setAccessible(true);
|
||||
|
||||
return kdeField.get(null).equals(wmidMethod.invoke(null));
|
||||
}
|
||||
|
||||
// We need to simulate user minimizing the dialog using button in title bar.
|
||||
// As we don't know the location of the button (and it can depend on KDE version),
|
||||
// we'll just use Xlib to minimize the window.
|
||||
private static void minimize(JDialog dialog) throws Exception {
|
||||
Class<?> toolkitCls = Class.forName("sun.awt.SunToolkit");
|
||||
Method lockMethod = toolkitCls.getDeclaredMethod("awtLock");
|
||||
Method unlockMethod = toolkitCls.getDeclaredMethod("awtUnlock");
|
||||
|
||||
Class<?> xToolkitClass = Class.forName("sun.awt.X11.XToolkit");
|
||||
Method displayMethod = xToolkitClass.getDeclaredMethod("getDisplay");
|
||||
|
||||
Class<?> wrapperClass = Class.forName("sun.awt.X11.XlibWrapper");
|
||||
Method iconifyMethod = wrapperClass.getDeclaredMethod("XIconifyWindow",
|
||||
long.class, long.class, long.class);
|
||||
iconifyMethod.setAccessible(true);
|
||||
|
||||
Class<?> windowClass = Class.forName("sun.awt.X11.XBaseWindow");
|
||||
Method windowMethod = windowClass.getDeclaredMethod("getWindow");
|
||||
Method screenMethod = windowClass.getDeclaredMethod("getScreenNumber");
|
||||
screenMethod.setAccessible(true);
|
||||
|
||||
Field peerField = Component.class.getDeclaredField("peer");
|
||||
peerField.setAccessible(true);
|
||||
Object peer = peerField.get(dialog);
|
||||
|
||||
lockMethod.invoke(null);
|
||||
try {
|
||||
iconifyMethod.invoke(null,
|
||||
displayMethod.invoke(null),
|
||||
windowMethod.invoke(peer),
|
||||
screenMethod.invoke(peer));
|
||||
} finally {
|
||||
unlockMethod.invoke(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,13 +61,11 @@ public class NestedDialogHideTest {
|
||||
button3 = new JButton("Hide");
|
||||
button3.addActionListener(eee -> d.setVisible(false));
|
||||
d2.add(button3);
|
||||
d2.pack();
|
||||
d2.setLocation(240, 240);
|
||||
d2.setBounds(240, 240, 200, 200);
|
||||
d2.setVisible(true);
|
||||
});
|
||||
d.add(button2);
|
||||
d.pack();
|
||||
d.setLocation(220, 220);
|
||||
d.setBounds(220, 220, 200, 200);
|
||||
d.setVisible(true);
|
||||
d.addComponentListener(new ComponentAdapter() {
|
||||
@Override
|
||||
@@ -77,8 +75,7 @@ public class NestedDialogHideTest {
|
||||
});
|
||||
});
|
||||
frame.add(button1);
|
||||
frame.pack();
|
||||
frame.setLocation(200, 200);
|
||||
frame.setBounds(200, 200, 200, 200);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
50
test/jdk/jbA11yProblemList.txt
Normal file
50
test/jdk/jbA11yProblemList.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/WindowIsFocusableAccessByThreadsTest/WindowIsFocusableAccessByThreadsTest.java JBR-3730 macosx-all
|
||||
java/awt/Mixing/ValidBounds.java JBR-3730 macosx-all
|
||||
java/awt/Mixing/Validating.java JBR-3730 macosx-all
|
||||
sanity/client/SwingSet/src/TableDemoTest.java JBR-3389 macosx-all intermittent
|
||||
java/awt/Component/7097771/bug7097771.java JBR-3730 macosx-all
|
||||
java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java JBR-3730 macosx-all
|
||||
java/awt/Component/SetComponentsBounds/SetComponentsBounds.java JBR-3722 macosx-all
|
||||
java/awt/event/ComponentEvent/MovedResizedTwiceTest/MovedResizedTwiceTest.java JBR-3730 macosx-all
|
||||
java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java JBR-3730 macosx-all
|
||||
java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java JBR-3730 macosx-all
|
||||
java/awt/Focus/ClearGlobalFocusOwnerTest/ClearGlobalFocusOwnerTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/DisposedWindow/DisposeDialogNotActivateOwnerTest/DisposeDialogNotActivateOwnerTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/FrameMinimizeTest/FrameMinimizeTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/RequestFocusAndHideTest/RequestFocusAndHideTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/RequestOnCompWithNullParent/RequestOnCompWithNullParent1.java JBR-3730 macosx-all
|
||||
java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java JBR-3733 macosx-all
|
||||
java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java JBR-3730 macosx-all
|
||||
java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java JBR-3730 macosx-all
|
||||
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java JBR-3730 macosx-all
|
||||
java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java JBR-3730 macosx-all
|
||||
java/awt/Frame/MiscUndecorated/FrameCloseTest.java JBR-3733 macosx-all
|
||||
java/awt/Frame/ObscuredFrame/ObscuredFrameTest.java JBR-3730 macosx-all
|
||||
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java JBR-3730 macosx-all
|
||||
java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java JBR-3730 macosx-all
|
||||
java/awt/Insets/CombinedTestApp1.java JBR-3730 macosx-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java JBR-3730 macosx-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.java JBR-3730 macosx-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java JBR-3730 macosx-all
|
||||
java/awt/Mixing/MixingOnDialog.java JBR-3730 macosx-all
|
||||
java/awt/Mixing/MixingOnShrinkingHWButton.java JBR-3730 macosx-all
|
||||
java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java JBR-3730 macosx-all
|
||||
java/awt/Paint/ButtonRepaint.java JBR-3730 macosx-all
|
||||
java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java JBR-3730 macosx-all
|
||||
java/awt/Toolkit/RealSync/Test.java JBR-3730 macosx-all
|
||||
java/awt/TrayIcon/ActionEventMask/ActionEventMask.java JBR-3730 macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentChoice.java JBR-3730 macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentWindowClick.java JBR-3730 macosx-all
|
||||
java/awt/Window/setLocRelativeTo/SetLocationRelativeToTest.java JBR-3730 macosx-all
|
||||
javax/swing/ProgressMonitor/ProgressMonitorEscapeKeyPress.java JBR-3730 macosx-all
|
||||
|
||||
sanity/client/SwingSet/src/TreeDemoTest.java JBR-3389 macosx-all
|
||||
@@ -185,7 +185,7 @@ java/awt/Mixing/AWT_Mixing/JToggleButtonInGlassPaneOverlapping.java 8158801 wind
|
||||
java/awt/Mixing/AWT_Mixing/JToggleButtonOverlapping.java 8158801 windows-all
|
||||
java/awt/Mixing/MixingOnDialog.java 8225777 linux-all
|
||||
java/awt/Mixing/NonOpaqueInternalFrame.java 7124549 macosx-all
|
||||
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 linux-all
|
||||
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388,8253184 linux-all,windows-all
|
||||
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java 6829264 generic-all
|
||||
java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java 8080982 generic-all
|
||||
java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java 8079268 linux-all
|
||||
@@ -231,11 +231,14 @@ java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all,
|
||||
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8150540 windows-all
|
||||
java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all
|
||||
|
||||
java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936 macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/SetShapeDynamicallyAndClick.java 8013450 macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/SetShape.java 8253184 windows-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936,8253184 macosx-all,windows-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/SetShapeDynamicallyAndClick.java 8013450,8253184 macosx-all,windows-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java 8013450 macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentChoice.java 8221901 linux-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentChoice.java 8221901,8253184 linux-all,windows-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentWindowClick.java 8253184 windows-all
|
||||
java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java 8222323 windows-all
|
||||
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8253184 windows-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java 8222328 windows-all,linux-all,macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/Shaped.java 8222328 windows-all,linux-all,macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/ShapedByAPI.java 8222328 windows-all,linux-all,macosx-all
|
||||
@@ -281,49 +284,50 @@ java/awt/Component/SetEnabledPerformance/SetEnabledPerformance.java 8165863 maco
|
||||
java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 8017454 macosx-all
|
||||
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
|
||||
java/awt/Frame/MiscUndecorated/RepaintTest.java 8079267 windows-all,linux-all
|
||||
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8253184 windows-all
|
||||
java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java 8157173 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal1Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal2Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal3Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal4Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal5Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal6Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal1Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal2Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal3Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal4Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal5Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal6Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal7Test.java 7186009 macosx-all,linux-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal1Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal2Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal3Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal4Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal5Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal6Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal1Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal2Test.java 7186009 macosx-all,linux-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal3Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal4Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal5Test.java 7186009 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal6Test.java 7186009 macosx-all,linux-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal7Test.java 7186009 macosx-all,linux-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal1Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal2Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal3Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal4Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal5Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogAppModal6Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal1Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal2Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal3Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal4Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal5Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal6Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogDocModal7Test.java 7186009,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal1Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal2Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal3Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal4Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal5Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogModal6Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal1Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal2Test.java 7186009,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal3Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal4Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal5Test.java 7186009,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal6Test.java 7186009,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogNonModal7Test.java 7186009,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal1Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal2Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal3Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal4Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal5Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal6Test.java 8196430 generic-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal7Test.java 8196430 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java 8198665 macosx-all
|
||||
java/awt/Modal/FileDialog/FileDialogTKModal7Test.java 8196430,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDAppModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDDocModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDModelessTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDNonModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDSetModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDDToolkitModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFAppModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFSetModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFToolkitModalTest.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFWModeless1Test.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFWModeless2Test.java 8198665 macosx-all
|
||||
java/awt/Modal/ModalBlockingTests/BlockingDFWNonModal1Test.java 8198665 macosx-all
|
||||
@@ -384,9 +388,10 @@ java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePageSetupTest.java 8196431
|
||||
java/awt/Modal/ModalExclusionTests/ToolkitExcludeFramePrintSetupTest.java 8196431 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal2Test.java 8058813 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless2Test.java 8196191 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFAppModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFDocModalTest.java 8196432,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFModelessTest.java 8196432,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDWFNonModalTest.java 8196432,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsModelessTest.java 8196432 linux-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsNonModalTest.java 8196432 linux-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferFDWDocModalTest.java 8196432 linux-all
|
||||
@@ -408,81 +413,121 @@ java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal1Test.java 819643
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal2Test.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal3Test.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferFWDNonModal4Test.java 8196432 linux-all,macosx-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java 8196432 linux-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java 8196432 linux-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFAppModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFDocModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFModeless3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferWDFNonModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ModalInternalFrameTest/ModalInternalFrameTest.java 8253184 windows-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs1Test.java 8198665 macosx-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java 8198665 macosx-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java 8198665 macosx-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java 8198665 macosx-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java 8198665 macosx-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326,8253184 macosx-all,windows-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562 macosx-all
|
||||
java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all
|
||||
java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all
|
||||
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all
|
||||
java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170 macosx-all
|
||||
java/awt/Modal/ToFront/DialogToFrontModeless1Test.java 8213530 linux-all
|
||||
java/awt/Modal/ToFront/DialogToFrontNonModalTest.java 8221899 linux-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal1Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal2Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal3Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal4Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal5Test.java 8196441 macosx-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal6Test.java 8196441 linux-all
|
||||
java/awt/Modal/ToBack/ToBackModal1Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackModal2Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackModal3Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackModal4Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal1Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal2Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal3Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal4Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal5Test.java 8196441 macosx-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal1Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal2Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal3Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal4Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal5Test.java 8196441 linux-all,macosx-all
|
||||
java/awt/Modal/ToBack/ToBackModeless1Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackModeless2Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackModeless3Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackModeless4Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackModeless5Test.java 8196441 macosx-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal1Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal2Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal3Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal4Test.java 8196441 macosx-all,linux-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal5Test.java 8196441 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal1Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal2Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal3Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal4Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal5Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal6Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal1Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal2Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal3Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal4Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal5Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal6Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal1Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal2Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal3Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal4Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal5Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModal6Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless1Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless2Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless3Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless4Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless5Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopModeless6Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal1Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal2Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal3Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal4Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal5Test.java 8198666 macosx-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal6Test.java 8198666 macosx-all
|
||||
java/awt/Modal/ToFront/DialogToFrontAppModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/DialogToFrontDocModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/DialogToFrontModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/DialogToFrontModeless1Test.java 8213530,8253184 linux-all,windows-all
|
||||
java/awt/Modal/ToFront/DialogToFrontNonModalTest.java 8221899,8253184 linux-all,windows-all
|
||||
java/awt/Modal/ToFront/DialogToFrontTKModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontAppModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontAppModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontAppModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontAppModal4Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontAppModal5Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontDocModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontDocModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModal4Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModal5Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontModeless1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontNonModalTest.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontTKModal1Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontTKModal2Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontTKModal3Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontTKModal4Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToFront/FrameToFrontTKModal5Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal1Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal2Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal3Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal4Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal5Test.java 8196441,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackAppModal6Test.java 8196441,8253184 linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal1Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal2Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal3Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal4Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal5Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackModal6Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal1Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal2Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal3Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal4Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal5Test.java 8196441,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackTKModal6Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal1Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal2Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal3Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal4Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal5Test.java 8196441,8253184 linux-all,macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackDocModal6Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless1Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless2Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless3Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless4Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless5Test.java 8196441,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackModeless6Test.java 8253184 windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal1Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal2Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal3Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal4Test.java 8196441,8253184 macosx-all,linux-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal5Test.java 8196441,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/ToBack/ToBackNonModal6Test.java 8253184 windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal1Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal2Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal3Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal4Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal5Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopAppModal6Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal1Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal2Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal3Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal4Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal5Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopDocModal6Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal1Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal2Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal3Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal4Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal5Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModal6Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless1Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless2Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless3Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless4Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless5Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopModeless6Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal1Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal2Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal3Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal4Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal5Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/OnTop/OnTopTKModal6Test.java 8198666,8253184 macosx-all,windows-all
|
||||
java/awt/List/SingleModeDeselect/SingleModeDeselect.java 8196367 windows-all
|
||||
java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235 macosx-all
|
||||
javax/print/PrintSEUmlauts/PrintSEUmlauts.java 8135174 generic-all
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2019, 2021, SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -68,7 +68,7 @@ import static org.testng.Assert.fail;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8213031
|
||||
* @bug 8213031 8273935
|
||||
* @modules jdk.zipfs
|
||||
* jdk.jartool
|
||||
* @run testng TestPosix
|
||||
@@ -595,7 +595,7 @@ public class TestPosix {
|
||||
assertTrue(throwsUOE(()->Files.setPosixFilePermissions(entry, UW)));
|
||||
assertTrue(throwsUOE(()->Files.getOwner(entry)));
|
||||
assertTrue(throwsUOE(()->Files.setOwner(entry, DUMMY_USER)));
|
||||
assertTrue(throwsUOE(()->Files.getFileAttributeView(entry, PosixFileAttributeView.class)));
|
||||
assertNull(Files.getFileAttributeView(entry, PosixFileAttributeView.class));
|
||||
}
|
||||
|
||||
// test with posix = true -> default values
|
||||
|
||||
102
test/jdk/jdk/nio/zipfs/testng/test/PosixAttributeViewTest.java
Normal file
102
test/jdk/jdk/nio/zipfs/testng/test/PosixAttributeViewTest.java
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
package test;
|
||||
|
||||
import org.testng.annotations.AfterTest;
|
||||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Test;
|
||||
import util.ZipFsBaseTest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.PosixFileAttributeView;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8273935
|
||||
* @summary Validate that Files.getFileAttributeView will not throw an
|
||||
* Exception when the attribute view PosixFileAttributeView is not available
|
||||
*/
|
||||
public class PosixAttributeViewTest extends ZipFsBaseTest {
|
||||
public static final String ZIP_ENTRY = "Entry-0";
|
||||
private static final Path ZIP_FILE = Path.of("posixTest.zip");
|
||||
|
||||
/**
|
||||
* Create initial Zip File
|
||||
* @throws IOException if an error occurs
|
||||
*/
|
||||
@BeforeTest
|
||||
public void setup() throws IOException {
|
||||
Files.deleteIfExists(ZIP_FILE);
|
||||
Entry entry = Entry.of(ZIP_ENTRY, ZipEntry.DEFLATED,
|
||||
"Tennis Anyone");
|
||||
zip(ZIP_FILE, Map.of("create", "true"), entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Zip File used by Test
|
||||
* @throws IOException if an error occurs
|
||||
*/
|
||||
@AfterTest
|
||||
public void cleanup() throws IOException {
|
||||
Files.deleteIfExists(ZIP_FILE);
|
||||
}
|
||||
|
||||
/**
|
||||
* DataProvider used to specify the Map indicating whether Posix
|
||||
* file attributes have been enabled
|
||||
* @return map of the Zip FS properties to configure
|
||||
*/
|
||||
@DataProvider
|
||||
protected Object[][] zipfsMap() {
|
||||
return new Object[][]{
|
||||
{Map.of()},
|
||||
{Map.of("enablePosixFileAttributes", "true")}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that Files.getFileAttributeView will not throw
|
||||
* an Exception when the attribute view
|
||||
* PosixFileAttributeView is not available
|
||||
* @param env map of the Zip FS properties to configure
|
||||
* @throws Exception if an error occurs
|
||||
*/
|
||||
@Test(dataProvider = "zipfsMap")
|
||||
public void testPosixAttributeView(Map<String, String> env) throws Exception {
|
||||
try (FileSystem fs = FileSystems.newFileSystem(ZIP_FILE, env)) {
|
||||
Path entry = fs.getPath(ZIP_ENTRY);
|
||||
PosixFileAttributeView view = Files.getFileAttributeView(entry,
|
||||
PosixFileAttributeView.class);
|
||||
System.out.printf("View returned: %s, Map= %s%n", view,
|
||||
formatMap(env));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -105,7 +105,7 @@ public class ZipFsBaseTest {
|
||||
* @param env Map to format
|
||||
* @return Formatted string of the Map entries
|
||||
*/
|
||||
private static String formatMap(Map<String, ?> env) {
|
||||
protected static String formatMap(Map<String, ?> env) {
|
||||
return env.entrySet().stream()
|
||||
.map(e -> format("(%s:%s)", e.getKey(), e.getValue()))
|
||||
.collect(joining(", "));
|
||||
|
||||
@@ -48,7 +48,7 @@ public class JdiBadOptionLaunchExecutionControlTest {
|
||||
Logger.getLogger("jdk.jshell.execution").setLevel(Level.ALL);
|
||||
JShell.builder()
|
||||
.executionEngine("jdi:launch(true)")
|
||||
.remoteVMOptions("-BadBadOption")
|
||||
.remoteVMOptions("-XX:-IgnoreUnrecognizedVMOptions", "-BadBadOption")
|
||||
.build();
|
||||
} catch (IllegalStateException ex) {
|
||||
assertTrue(ex.getMessage().startsWith(EXPECTED_ERROR), ex.getMessage());
|
||||
|
||||
@@ -48,7 +48,7 @@ public class JdiBadOptionListenExecutionControlTest {
|
||||
Logger.getLogger("jdk.jshell.execution").setLevel(Level.ALL);
|
||||
JShell.builder()
|
||||
.executionEngine("jdi")
|
||||
.remoteVMOptions("-BadBadOption")
|
||||
.remoteVMOptions("-XX:-IgnoreUnrecognizedVMOptions","-BadBadOption")
|
||||
.build();
|
||||
} catch (IllegalStateException ex) {
|
||||
assertTrue(ex.getMessage().contains(EXPECTED_ERROR), ex.getMessage());
|
||||
|
||||
@@ -293,7 +293,7 @@ public class StartOptionTest {
|
||||
// Test an option that causes the back-end to fail is propagated
|
||||
public void testStartupFailedOption() {
|
||||
startExCe(1, s -> assertTrue(s.contains("Unrecognized option: -hoge-foo-bar"), "cmderr: " + s),
|
||||
"-R-hoge-foo-bar");
|
||||
"-R-XX:-IgnoreUnrecognizedVMOptions", "-R-hoge-foo-bar");
|
||||
}
|
||||
|
||||
// Test the use of non-existant files with the --startup option
|
||||
|
||||
Reference in New Issue
Block a user