Skip to content

Commit

Permalink
Merge master jdk-11.0.25+4 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Aug 22, 2024
2 parents 1a11939 + 1dc4a50 commit 9bbecff
Show file tree
Hide file tree
Showing 13 changed files with 863 additions and 30 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,26 +333,23 @@ jobs:
- test-windows-x64

steps:
# Hack to get hold of the api environment variables that are only defined for actions
- name: 'Get API configuration'
id: api
uses: actions/github-script@v7
with:
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'

- name: 'Remove bundle artifacts'
run: |
# Find and remove all bundle artifacts
ALL_ARTIFACT_URLS="$(curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
for url in $BUNDLE_ARTIFACT_URLS; do
echo "Removing $url"
curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
-X DELETE "$url" \
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
ALL_ARTIFACT_IDS="$(curl -sL \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ github.token }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts')"
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
for id in $BUNDLE_ARTIFACT_IDS; do
echo "Removing $id"
curl -sL \
-X DELETE \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ github.token }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
|| echo "Failed to remove bundle"
done
1 change: 1 addition & 0 deletions .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version=11.0.25

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
warning=issuestitle,binary

[repository]
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public TestProcessLauncher(String className, ArgumentHandler argHandler) {
}

public TestProcessLauncher(String className) {
this(className, new ArgumentHandler(new String[0]));
this(className, new ArgumentHandler(new String[] {"-transport.address=dynamic"}));
}

public Process launch() {
Expand Down
16 changes: 6 additions & 10 deletions test/hotspot/jtreg/vmTestbase/nsk/share/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ public class Log extends FinalizableObject {

/**
* Is log-mode verbose?
* Default value is <code>false</code>.
* Always enabled.
*/
private boolean verbose = false;
private final boolean verbose = true;

/**
* Should log messages prefixed with timestamps?
* Default value is <code>false</code>.
* Always enabled.
*/
private boolean timestamp = false;
private final boolean timestamp = true;

/**
* Names for trace levels
Expand Down Expand Up @@ -210,7 +210,6 @@ public Log(PrintStream stream) {
*/
public Log(PrintStream stream, boolean verbose) {
this(stream);
this.verbose = verbose;
}

/**
Expand All @@ -221,7 +220,6 @@ public Log(PrintStream stream, boolean verbose) {
public Log(PrintStream stream, ArgumentParser argsParser) {
this(stream, argsParser.verbose());
traceLevel = argsParser.getTraceLevel();
timestamp = argsParser.isTimestamp();
}

/////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -265,10 +263,9 @@ public void enableVerboseOnError(boolean enable) {
* Enable or disable verbose mode for printing messages.
*/
public void enableVerbose(boolean enable) {
if (!verbose) {
flushLogBuffer();
if (!enable) {
throw new RuntimeException("The non-verbose logging is not supported.");
}
verbose = enable;
}

public int getTraceLevel() {
Expand Down Expand Up @@ -467,7 +464,6 @@ private void logExceptionForFailureAnalysis(String msg) {
protected synchronized void logTo(PrintStream stream) {
finalize(); // flush older log stream
out = stream;
verbose = true;
}

/////////////////////////////////////////////////////////////////
Expand Down
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all
javax/swing/JFileChooser/8002077/bug8002077.java 8196094 windows-all,macosx-all
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8058231 generic-all
javax/swing/JFileChooser/8194044/FileSystemRootTest.java 8327236 windows-all
javax/swing/JList/6462008/bug6462008.java 7156347 generic-all
javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all
javax/swing/JPopupMenu/6675802/bug6675802.java 8196097 windows-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
Expand Down
216 changes: 216 additions & 0 deletions test/jdk/java/awt/ScrollPane/ScrollPaneTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
/*
* Copyright (c) 1998, 2023, 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.
*/

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.Point;
import java.awt.Robot;
import java.awt.ScrollPane;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;

/*
* @test
* @bug 4124460
* @key headful
* @summary Test for initializing a Motif peer component causes a crash.
*/

public class ScrollPaneTest {
private static volatile Point p1 = null;
private static volatile Point p2 = null;
private static Robot robot = null;

private static Point getClickPoint(Component component) {
Point locationOnScreen = component.getLocationOnScreen();
Dimension size = component.getSize();
locationOnScreen.x += size.width / 2;
locationOnScreen.y += size.height / 2;
return locationOnScreen;
}
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoWaitForIdle(true);
robot.setAutoDelay(100);

try {
doTest();
} finally {
ScrollPaneTester.disposeAll();
}
}

private static void doTest() throws Exception {
EventQueue.invokeAndWait(ScrollPaneTester::initAndShowGui);

robot.waitForIdle();
robot.delay(1000);

EventQueue.invokeAndWait(() -> {
p1 = getClickPoint(ScrollPaneTester.st1.buttonRight);
p2 = getClickPoint(ScrollPaneTester.st1.buttonSwap);
});

robot.mouseMove(p1.x, p1.y);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);

robot.mouseMove(p2.x, p2.y);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);

robot.delay(1000);

EventQueue.invokeAndWait(() -> {
p1 = getClickPoint(ScrollPaneTester.st2.buttonRight);
p2 = getClickPoint(ScrollPaneTester.st2.buttonSwap);
});

robot.mouseMove(p1.x, p1.y);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);

robot.mouseMove(p2.x, p2.y);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
}
}

class ScrollPaneTester implements ActionListener {
static ScrollPaneTester st1, st2;
final Button buttonLeft, buttonRight, buttonQuit, buttonSwap;
protected ScrollPane sp;
protected Frame f;

public static void initAndShowGui() {
ScrollPaneTester.st1 = new ScrollPaneTester(true);
ScrollPaneTester.st2 = new ScrollPaneTester(false);
}

public ScrollPaneTester(boolean large) {
sp = new ScrollPane(ScrollPane.SCROLLBARS_NEVER);

Panel p = new Panel();

if (large) {
p.setLayout(new GridLayout(10, 10));
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++) {
TextField tf = new TextField("I am " + i + j);
tf.setSize(100, 20);
p.add(tf);
}
} else {
TextField tf = new TextField("Smallness:");
tf.setSize(150, 50);
p.add(tf);
}

sp.add(p);

// Button panel
buttonLeft = new Button("Left");
buttonLeft.addActionListener(this);
buttonQuit = new Button("Quit");
buttonQuit.addActionListener(this);
buttonSwap = new Button("Swap");
buttonSwap.addActionListener(this);
buttonRight = new Button("Right");
buttonRight.addActionListener(this);

Panel bp = new Panel();
bp.add(buttonLeft);
bp.add(buttonSwap);
bp.add(buttonQuit);
bp.add(buttonRight);

// Window w/ button panel and scrollpane
f = new Frame("ScrollPane Test " + (large ? "large" : "small"));
f.setLayout(new BorderLayout());
f.add("South", bp);
f.add("Center", sp);

if (large) {
f.setSize(300, 200);
f.setLocation(100, 100);
} else {
f.setSize(200, 100);
f.setLocation(500, 100);
}

f.setVisible(true);
}

public static void disposeAll() {
ScrollPaneTester.st1.f.dispose();
ScrollPaneTester.st2.f.dispose();
}

public static void
swapPanels() {
ScrollPane sss = st1.sp;

st1.f.add("Center", st2.sp);
st1.sp = st2.sp;

st2.f.add("Center", sss);
st2.sp = sss;
}

public void
actionPerformed(ActionEvent ev) {
Object s = ev.getSource();

if (s == buttonLeft) {
scroll(true);
} else if (s == buttonRight) {
scroll(false);
} else if (s == buttonSwap) {
swapPanels();
} else if (s == buttonQuit) {
disposeAll();
}
}

private void
scroll(boolean scroll_left) {
Point p = sp.getScrollPosition();

if (scroll_left)
p.x = Math.max(0, p.x - 20);
else {
int cwidth = sp.getComponent(0).getSize().width;
p.x = Math.min(p.x + 20, cwidth);
}

sp.setScrollPosition(p);
}
}
Loading

0 comments on commit 9bbecff

Please sign in to comment.