Skip to content

Commit

Permalink
Merge latest openjdk
Browse files Browse the repository at this point in the history
  • Loading branch information
j9build committed Nov 2, 2020
2 parents 36a4eea + c9fcf0c commit 619ad58
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/java.base/share/classes/sun/security/util/Cache.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 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
Expand Down Expand Up @@ -265,8 +265,7 @@ public MemoryCache(boolean soft, int maxSize, int lifetime) {
else
this.queue = null;

int buckets = (int)(maxSize / LOAD_FACTOR) + 1;
cacheMap = new LinkedHashMap<>(buckets, LOAD_FACTOR, true);
cacheMap = new LinkedHashMap<>(1, LOAD_FACTOR, true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,14 @@ public boolean isHidden(Path obj) {
UnixPath name = file.getFileName();
if (name == null)
return false;
return (name.asByteArray()[0] == '.');

byte[] path;
if (name.isEmpty()) { // corner case for empty paths
path = name.getFileSystem().defaultDirectory();
} else {
path = name.asByteArray();
}
return path[0] == '.';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/unix/classes/sun/nio/fs/UnixPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void initOffsets() {
}

// returns {@code true} if this path is an empty path
private boolean isEmpty() {
boolean isEmpty() {
return path.length == 0;
}

Expand Down
2 changes: 0 additions & 2 deletions test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@ javax/swing/JTable/4235420/bug4235420.java 8079127 generic-all
javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
javax/swing/JFileChooser/8041694/bug8041694.java 8196302 windows-all,macosx-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
Expand Down Expand Up @@ -782,7 +781,6 @@ javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
javax/swing/JTree/6263446/bug6263446.java 8213125 macosx-all
javax/swing/text/View/8014863/bug8014863.java 8233561 macosx-all
javax/swing/text/StyledEditorKit/4506788/bug4506788.java 8233562 macosx-all
javax/swing/text/JTextComponent/6361367/bug6361367.java 8233569 macosx-all
javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all
javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java 8233555 macosx-all
javax/swing/JRadioButton/8075609/bug8075609.java 8233555 macosx-all
Expand Down
5 changes: 4 additions & 1 deletion test/jdk/java/nio/file/Files/Misc.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

/* @test
* @bug 4313887 6838333 8005566 8032220 8215467
* @bug 4313887 6838333 8005566 8032220 8215467 8255576
* @summary Unit test for miscellenous methods in java.nio.file.Files
* @library ..
*/
Expand Down Expand Up @@ -87,6 +87,9 @@ static void testCreateDirectories(Path tmpdir) throws IOException {
* Tests isHidden
*/
static void testIsHidden(Path tmpdir) throws IOException {
// passing an empty path must not throw any runtime exception
assertTrue(!isHidden(Path.of("")));

assertTrue(!isHidden(tmpdir));

Path file = tmpdir.resolve(".foo");
Expand Down
5 changes: 4 additions & 1 deletion test/jdk/javax/swing/JFileChooser/8041694/bug8041694.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private static void runTest() {
// Set Metal L&F to make the test compatible with OS X.
UIManager.setLookAndFeel(new MetalLookAndFeel());
Robot robot = new Robot();
robot.setAutoDelay(100);

dir1 = Files.createTempDirectory("bug8041694").toFile();
if (Platform.isWindows()) {
Expand All @@ -83,15 +84,17 @@ public void run() {
}
});

robot.setAutoDelay(50);
robot.delay(1000);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_D);
robot.keyRelease(KeyEvent.VK_D);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_SPACE);
robot.keyRelease(KeyEvent.VK_SPACE);
robot.waitForIdle();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
robot.waitForIdle();

fChooserClosedSignal.await();
if (selectedDir == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public JTextComponent call() throws Exception {
waitForFocus(textComponent);
Robot robot = new Robot();
robot.setAutoWaitForIdle(true);
robot.setAutoDelay(250);
robot.setAutoDelay(100);
robot.keyPress(KeyEvent.VK_END);
robot.keyRelease(KeyEvent.VK_END);
robot.keyPress(KeyEvent.VK_SHIFT);
Expand Down

0 comments on commit 619ad58

Please sign in to comment.