Skip to content

Commit

Permalink
Merge master HEAD 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 Oct 6, 2023
2 parents 1336dad + 37ba0e3 commit 521c7d1
Show file tree
Hide file tree
Showing 12 changed files with 298 additions and 82 deletions.
2 changes: 1 addition & 1 deletion make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ define SetupRunJtregTestBody
$$(RM) -r $$($1_TEST_RESULTS_DIR)

$1_COMMAND_LINE := \
$$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
$$(JTREG_JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \
-Dprogram=jtreg -jar $$(JT_HOME)/lib/jtreg.jar \
$$($1_JTREG_BASIC_OPTIONS) \
-testjdk:$$(JDK_UNDER_TEST) \
Expand Down
2 changes: 2 additions & 0 deletions make/RunTestsPrebuilt.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ $(eval $(call SetupVariable,JT_HOME))
$(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
$(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
$(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
$(eval $(call SetupVariable,JTREG_JAVA,$(BOOT_JDK)/bin/java))

# Provide default values for tools that we need
$(eval $(call SetupVariable,MAKE,make,NO_CHECK))
Expand Down Expand Up @@ -248,6 +249,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
TOPDIR := $(TOPDIR), \
OUTPUTDIR := $(OUTPUTDIR), \
BOOT_JDK := $(BOOT_JDK), \
JTREG_JAVA := $(FIXPATH) $(JTREG_JAVA), \
JT_HOME := $(JT_HOME), \
JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
JCOV_IMAGE_DIR := $(JCOV_IMAGE_DIR), \
Expand Down
38 changes: 37 additions & 1 deletion make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,48 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG],
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Specify a JDK for running jtreg. Defaults to the BOOT_JDK.
AC_ARG_WITH(jtreg-jdk, [AS_HELP_STRING([--with-jdk],
[path to JDK for running jtreg @<:@BOOT_JDK@:>@])])
AC_MSG_CHECKING([for jtreg jdk])
if test "x${with_jtreg_jdk}" != x; then
if test "x${with_jtreg_jdk}" = xno; then
AC_MSG_RESULT([no, jtreg jdk not specified])
elif test "x${with_jtreg_jdk}" = xyes; then
AC_MSG_RESULT([not specified])
AC_MSG_ERROR([--with-jtreg-jdk needs a value])
else
JTREG_JDK="${with_jtreg_jdk}"
AC_MSG_RESULT([$JTREG_JDK])
UTIL_FIXUP_PATH(JTREG_JDK)
if test ! -f "$JTREG_JDK/bin/java"; then
AC_MSG_ERROR([Could not find jtreg java at $JTREG_JDK/bin/java])
fi
fi
else
JTREG_JDK="${BOOT_JDK}"
AC_MSG_RESULT([no, using BOOT_JDK])
fi
JTREG_JAVA="$JTREG_JDK/bin/java"
UTIL_FIXUP_PATH(JTREG_JAVA)
JTREG_JAVA="$FIXPATH $JTREG_JAVA"
AC_SUBST([JTREG_JAVA])
# Verify jtreg version
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([jtreg jar existence])
if test ! -f "$JT_HOME/lib/jtreg.jar"; then
AC_MSG_ERROR([Could not find jtreg jar at $JT_HOME/lib/jtreg.jar])
fi
AC_MSG_CHECKING([jtreg version number])
# jtreg -version looks like this: "jtreg 6.1+1-19"
# Extract actual version part ("6.1" in this case)
jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
jtreg_version_full=$($JTREG_JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2)
jtreg_version=${jtreg_version_full/%+*}
AC_MSG_RESULT([$jtreg_version])
Expand Down
2 changes: 2 additions & 0 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
BUILDJDK_JAVA_FLAGS_SMALL:=@BUILDJDK_JAVA_FLAGS_SMALL@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@

JTREG_JAVA:=@JTREG_JAVA@

# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
# for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD
# versions of the variables directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,19 +849,20 @@ public String[] getListPatterns(ListFormat.Type type, ListFormat.Style style) {
ResourceReference data = cache.get(cacheKey);

if (data == null || ((lpArray = (String[]) data.get()) == null)) {
ResourceBundle rb = localeData.getDateFormatData(locale);
lpArray = rb.getStringArray("ListPatterns_" + typeStr + (style == ListFormat.Style.FULL ? "" : "-" + styleStr));
var rbKey = "ListPatterns_" + typeStr + (style == ListFormat.Style.FULL ? "" : "-" + styleStr);
lpArray = localeData.getDateFormatData(locale).getStringArray(rbKey);

if (lpArray[0].isEmpty() || lpArray[1].isEmpty() || lpArray[2].isEmpty()) {
var adapter = LocaleProviderAdapter.forType(LocaleProviderAdapter.Type.CLDR);
if (adapter instanceof ResourceBundleBasedAdapter rbba) {
if (LocaleProviderAdapter.forType(LocaleProviderAdapter.Type.CLDR)
instanceof ResourceBundleBasedAdapter rbba) {
var candList = rbba.getCandidateLocales("", locale);
// make sure there is at least one parent locale
if (candList.size() >= 2) {
var parentPatterns = adapter.getLocaleResources(candList.get(1)).getListPatterns(type, style);
for (int i = 0; i < 3; i++) { // exclude optional ones, ie, "two"/"three"
if (lpArray[i].isEmpty()) {
lpArray[i] = parentPatterns[i];
if (!candList.isEmpty()) {
for (var p : candList.subList(1, candList.size())) {
var parentPatterns = localeData.getDateFormatData(p).getStringArray(rbKey);
for (int i = 0; i < 3; i++) { // exclude optional ones, ie, "two"/"three"
if (lpArray[i].isEmpty()) {
lpArray[i] = parentPatterns[i];
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
Expand Down Expand Up @@ -144,15 +144,15 @@
* Alternatively, you could invoke <code>commitEdit</code>, which would also
* commit the value.
* <p>
* <code>JFormattedTextField</code> does not do the formatting it self,
* <code>JFormattedTextField</code> does not do the formatting itself,
* rather formatting is done through an instance of
* <code>JFormattedTextField.AbstractFormatter</code> which is obtained from
* an instance of <code>JFormattedTextField.AbstractFormatterFactory</code>.
* Instances of <code>JFormattedTextField.AbstractFormatter</code> are
* notified when they become active by way of the
* <code>install</code> method, at which point the
* <code>JFormattedTextField.AbstractFormatter</code> can install whatever
* it needs to, typically a <code>DocumentFilter</code>. Similarly when
* it needs to, typically a <code>DocumentFilter</code>. Similarly, when
* <code>JFormattedTextField</code> no longer
* needs the <code>AbstractFormatter</code>, it will invoke
* <code>uninstall</code>.
Expand All @@ -164,7 +164,7 @@
* policy is <code>JFormattedTextField.PERSIST</code>
* and the <code>JFormattedTextField</code> has been edited, the
* <code>AbstractFormatterFactory</code> will not be queried until the
* value has been committed. Similarly if the focus lost policy is
* value has been committed. Similarly, if the focus lost policy is
* <code>JFormattedTextField.COMMIT</code> and an exception
* is thrown from <code>stringToValue</code>, the
* <code>AbstractFormatterFactory</code> will not be queried when focus is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,85 @@

package javax.swing.plaf.basic;

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.datatransfer.*;
import java.beans.*;
import java.util.Enumeration;
import java.util.Hashtable;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Stroke;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.LookAndFeel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.TransferHandler;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.event.MouseInputListener;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeModelEvent;
import javax.swing.event.TreeModelListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.TreeUI;
import javax.swing.tree.*;
import javax.swing.text.Position;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag;
import sun.awt.AWTAccessor;
import sun.swing.SwingUtilities2;
import javax.swing.text.Position;
import javax.swing.tree.AbstractLayoutCache;
import javax.swing.tree.DefaultTreeCellEditor;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.FixedHeightLayoutCache;
import javax.swing.tree.TreeCellEditor;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import javax.swing.tree.VariableHeightLayoutCache;

import sun.awt.AWTAccessor;
import sun.swing.DefaultLookup;
import sun.swing.SwingUtilities2;
import sun.swing.UIAction;

/**
Expand Down Expand Up @@ -4082,7 +4141,7 @@ void handleSelection(MouseEvent e) {
}

// Preferably checkForClickInExpandControl could take
// the Event to do this it self!
// the Event to do this itself!
if(SwingUtilities.isLeftMouseButton(e)) {
checkForClickInExpandControl(pressedPath, e.getX(), e.getY());
}
Expand Down
15 changes: 3 additions & 12 deletions test/hotspot/gtest/metaspace/test_metaspacearena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
*/

#include "precompiled.hpp"
#include "memory/metaspace/chunkManager.hpp"
#include "memory/metaspace/commitLimiter.hpp"
#include "memory/metaspace/counters.hpp"
#include "memory/metaspace/internalStats.hpp"
#include "memory/metaspace/metaspaceArena.hpp"
#include "memory/metaspace/metaspaceArenaGrowthPolicy.hpp"
#include "memory/metaspace/metaspaceCommon.hpp"
#include "memory/metaspace/metaspaceSettings.hpp"
#include "memory/metaspace/metaspaceStatistics.hpp"
#include "runtime/mutex.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"

Expand All @@ -55,22 +55,14 @@ class MetaspaceArenaTestHelper {

MetaspaceGtestContext& _context;

Mutex* _lock;
const ArenaGrowthPolicy* _growth_policy;
SizeAtomicCounter _used_words_counter;
MetaspaceArena* _arena;

void initialize(const ArenaGrowthPolicy* growth_policy, const char* name = "gtest-MetaspaceArena") {
_growth_policy = growth_policy;
_lock = new Mutex(Monitor::nosafepoint, "gtest-MetaspaceArenaTest_lock");
// Lock during space creation, since this is what happens in the VM too
// (see ClassLoaderData::metaspace_non_null(), which we mimick here).
{
MutexLocker ml(_lock, Mutex::_no_safepoint_check_flag);
_arena = new MetaspaceArena(&_context.cm(), _growth_policy, _lock, &_used_words_counter, name);
}
_arena = new MetaspaceArena(&_context.cm(), _growth_policy, &_used_words_counter, name);
DEBUG_ONLY(_arena->verify());

}

public:
Expand All @@ -94,7 +86,6 @@ class MetaspaceArenaTestHelper {

~MetaspaceArenaTestHelper() {
delete_arena_with_tests();
delete _lock;
}

const CommitLimiter& limiter() const { return _context.commit_limiter(); }
Expand Down
10 changes: 1 addition & 9 deletions test/hotspot/gtest/metaspace/test_metaspacearena_stress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class MetaspaceArenaTestBed : public CHeapObj<mtInternal> {

MetaspaceArena* _arena;

Mutex* _lock;

const SizeRange _allocation_range;
size_t _size_of_last_failed_allocation;

Expand Down Expand Up @@ -131,18 +129,13 @@ class MetaspaceArenaTestBed : public CHeapObj<mtInternal> {
MetaspaceArenaTestBed(ChunkManager* cm, const ArenaGrowthPolicy* alloc_sequence,
SizeAtomicCounter* used_words_counter, SizeRange allocation_range) :
_arena(NULL),
_lock(NULL),
_allocation_range(allocation_range),
_size_of_last_failed_allocation(0),
_allocations(NULL),
_alloc_count(),
_dealloc_count()
{
_lock = new Mutex(Monitor::nosafepoint, "gtest-MetaspaceArenaTestBed_lock");
// Lock during space creation, since this is what happens in the VM too
// (see ClassLoaderData::metaspace_non_null(), which we mimick here).
MutexLocker ml(_lock, Mutex::_no_safepoint_check_flag);
_arena = new MetaspaceArena(cm, alloc_sequence, _lock, used_words_counter, "gtest-MetaspaceArenaTestBed-sm");
_arena = new MetaspaceArena(cm, alloc_sequence, used_words_counter, "gtest-MetaspaceArenaTestBed-sm");
}

~MetaspaceArenaTestBed() {
Expand All @@ -161,7 +154,6 @@ class MetaspaceArenaTestBed : public CHeapObj<mtInternal> {

// Delete MetaspaceArena. That should clean up all metaspace.
delete _arena;
delete _lock;

}

Expand Down
Loading

0 comments on commit 521c7d1

Please sign in to comment.