Compare commits

..

1 Commits

Author SHA1 Message Date
Sergey Malenkov
8d2f25483a FractionalMetricsSupport 2020-02-20 16:14:08 +03:00
47 changed files with 521 additions and 1690 deletions

View File

@@ -2,7 +2,7 @@
FROM centos:7
RUN yum -y install centos-release-scl
RUN yum -y install devtoolset-8
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel git
RUN yum -y install zip bzip2 unzip tar wget make autoconf automake libtool alsa-devel cups-devel xorg-x11-devel libjpeg62-devel giflib-devel freetype-devel file which libXtst-devel libXt-devel libXrender-devel alsa-lib-devel fontconfig-devel libXrandr-devel libXi-devel
# Install Java 11
RUN wget https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrsdk-11_0_3-linux-x64-b360.2.tar.gz \
-O - | tar xz -C /

View File

@@ -1,33 +0,0 @@
Index: src/java.desktop/share/classes/module-info.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/java.desktop/share/classes/module-info.java (revision 08d1926f8b7c74da0e1144e0ce5912e7589c4688)
+++ src/java.desktop/share/classes/module-info.java (date 1583207610780)
@@ -109,10 +109,7 @@
// see make/GensrcModuleInfo.gmk
exports sun.awt to
jdk.accessibility,
- jdk.unsupported.desktop,
- jcef;
-
- exports java.awt.peer to jcef;
+ jdk.unsupported.desktop;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;
Index: modules.list
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision 08d1926f8b7c74da0e1144e0ce5912e7589c4688)
+++ modules.list (date 1583207610776)
@@ -60,5 +60,4 @@
jdk.unsupported,
jdk.xml.dom,
jdk.zipfs,
-jdk.hotspot.agent,
-jcef
+jdk.hotspot.agent

View File

@@ -1,21 +0,0 @@
Index: modules.list
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision 57ff1dba25206f9f078b48995aa8744e51b1dd2a)
+++ modules.list (date 1584500341724)
@@ -20,13 +20,6 @@
java.transaction.xa,
java.xml,
java.xml.crypto,
-javafx.base,
-javafx.controls,
-javafx.fxml,
-javafx.graphics,
-javafx.media,
-javafx.swing,
-javafx.web,
jdk.accessibility,
jdk.aot,
jdk.charsets,

View File

@@ -1,9 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/linux/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,77 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-boot-jdk=amazon-corretto-11.0.5.10.1-linux-aarch64 \
--with-import-modules=./modular-sdk \
--enable-cds=yes || exit $?
make clean CONF=linux-aarch64-normal-server-release || exit $?
make images CONF=linux-aarch64-normal-server-release test-image || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-aarch64-b${build_number}
BASE_DIR=build/linux-aarch64-normal-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
tar -pcf $JBSDK.tar \
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-aarch64-b$build_number
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.aarch64
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.aarch64 | sed s/" "//g | sed s/,$//g) \
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -pcf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
gzip $JBR.tar || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-aarch64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?

View File

@@ -1,123 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
function create_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
;;
esac
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
JBR=$JBR_BASE_NAME-linux-x64-b$build_number
echo Running jlink....
$JSDK/bin/jlink \
--module-path $JSDK/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE
if [[ "$bundle_type" == *jcef* ]]; then
cp -R $BASE_DIR/$JBR_BUNDLE $BASE_DIR/jbr
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
fi
grep -v "^JAVA_VERSION" $JSDK/release | grep -v "^MODULES" >> $BASE_DIR/$JBR_BUNDLE/release
echo Creating $JBR.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
tar -pcf $JBR.tar -C $BASE_DIR jbr || exit $?
gzip $JBR.tar || exit $?
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
git checkout -- modules.list src
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
;;
"jcef")
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
;;
esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=./modular-sdk \
--enable-cds=yes || exit $?
make images CONF=linux-x86_64-normal-server-release || exit $?
JSDK=build/linux-x86_64-normal-server-release/images/jdk
JBSDK=$JBRSDK_BASE_NAME-linux-x64-b$build_number
echo Fixing permissions
chmod -R a+r $JSDK
BASE_DIR=build/linux-x86_64-normal-server-release/images
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
if [[ "$bundle_type" == *jcef* ]]; then
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
echo Creating $JBSDK.tar.gz ...
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR $JBRSDK_BUNDLE || exit $?
gzip $JBSDK.tar || exit $?
fi
JBR_BUNDLE=jbr_${bundle_type}
create_jbr ${bundle_type}
if [ "$bundle_type" == "jfx_jcef" ]; then
make test-image || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x64-b$build_number
echo Creating $JBSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?
fi

View File

@@ -1,72 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
sh configure \
--disable-warnings-as-errors \
--with-debug-level=fastdebug \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-import-modules=./modular-sdk \
--enable-cds=yes || exit $?
make clean CONF=linux-x86_64-normal-server-fastdebug || exit $?
make images CONF=linux-x86_64-normal-server-fastdebug || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-fastdebug-b${build_number}
BASE_DIR=build/linux-x86_64-normal-server-fastdebug/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
echo Creating $JBSDK.tar.gz ...
tar -pcf $JBSDK.tar \
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-x64-fastdebug-b$build_number
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list | sed s/" "//g | sed s/,$//g) \
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -czf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
gzip $JBR.tar || exit $?

View File

@@ -1,73 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
linux32 bash configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-boot-jdk=/jbrsdk-11.0.5-b1 \
--enable-cds=yes || exit $?
make clean CONF=linux-x86-normal-server-release || exit $?
make images CONF=linux-x86-normal-server-release test-image || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-x86-b${build_number}
BASE_DIR=build/linux-x86-normal-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man -C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-x86-b$build_number
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.x86 | sed s/" "//g | sed s/,$//g) --output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -pcf $JBR.tar -C $BASE_DIR $JBR_BUNDLE || exit $?
gzip $JBR.tar || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x86-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' --exclude='test/hotspot/gtest' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?

View File

@@ -1,9 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/mac/scripts
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,134 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
function create_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
;;
esac
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
JRE_CONTENTS=${BASE_DIR}/${JBR_BUNDLE}/Contents
JRE_HOME=${JRE_CONTENTS}/Home
if [ -d "${JRE_CONTENTS}" ]; then
rm -rf ${JRE_CONTENTS}
fi
mkdir -p ${JRE_CONTENTS}
JBR=${JBR_BASE_NAME}-osx-x64-b${build_number}
${BASE_DIR}/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
--module-path ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JRE_HOME} || exit $?
grep -v "^JAVA_VERSION" ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release | grep -v "^MODULES" >> ${JRE_HOME}/release
cp -R ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/MacOS ${JRE_CONTENTS}
cp ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Info.plist ${JRE_CONTENTS}
if [[ "${bundle_type}" == *jcef* ]]; then
rm -rf ${JRE_CONTENTS}/Frameworks || exit $?
rm -rf ${JRE_CONTENTS}/Helpers || exit $?
cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?
cp -a jcef_mac/Helpers ${JRE_CONTENTS} || exit $?
fi
echo Creating ${JBR}.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
COPYFILE_DISABLE=1 tar -pczf ${JBR}.tar.gz --exclude='*.dSYM' --exclude='man' -C ${BASE_DIR} jbr || exit $?
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
git checkout -- modules.list src
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
;;
"jcef")
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
;;
esac
sh configure \
--disable-warnings-as-errors \
--with-debug-level=release \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=./modular-sdk \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make images CONF=macosx-x86_64-normal-server-release || exit $?
JSDK=build/macosx-x86_64-normal-server-release/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
BASE_DIR=jre
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR
mkdir $BASE_DIR || exit $?
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
if [[ "$bundle_type" == *jcef* ]]; then
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
cp -a jcef_mac/Helpers $BASE_DIR/$JBRSDK_BUNDLE/Contents/
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
echo Creating $JBSDK.tar.gz ...
COPYFILE_DISABLE=1 tar -pczf $JBSDK.tar.gz -C $BASE_DIR \
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
$JBRSDK_BUNDLE || exit $?
fi
JBR_BUNDLE=jbr_${bundle_type}
create_jbr "${bundle_type}" || exit $?
if [ "$bundle_type" == "jfx_jcef" ]; then
make test-image || exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-osx-test-x64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
COPYFILE_DISABLE=1 tar -pczf $JBRSDK_TEST.tar.gz -C build/macosx-x86_64-normal-server-release/images \
--exclude='test/jdk/demos' test || exit $?
fi

View File

@@ -1,83 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
sh configure \
--disable-warnings-as-errors \
--with-debug-level=fastdebug \
--with-version-build=$JDK_BUILD_NUMBER \
--with-version-pre= \
--with-version-opt=b$build_number \
--with-import-modules=./modular-sdk \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make clean CONF=macosx-x86_64-normal-server-fastdebug || exit $?
make images CONF=macosx-x86_64-normal-server-fastdebug || exit $?
JSDK=build/macosx-x86_64-normal-server-fastdebug/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-fastdebug-b${build_number}
BASE_DIR=jre
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR
mkdir $BASE_DIR || exit $?
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
cp -a jcef_mac/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
cp -a jcef_mac/Helpers $BASE_DIR/$JBRSDK_BUNDLE/Contents
COPYFILE_DISABLE=1 \
tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
${JBRSDK_BUNDLE} || exit $?
JBR_BUNDLE=jbr
JRE_CONTENTS=$BASE_DIR/$JBR_BUNDLE/Contents
JRE_HOME=$JRE_CONTENTS/Home
JBR_BASE_NAME=jbr-$JBSDK_VERSION
mkdir -p $JRE_CONTENTS
if [ -d "$JRE_HOME" ]; then
rm -rf $JRE_HOME
fi
JBR=${JBR_BASE_NAME}-osx-x64-fastdebug-b${build_number}
$BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
--module-path $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list | sed s/" "//g) --output $JRE_HOME || exit $?
grep -v "^JAVA_VERSION" $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/release | grep -v "^MODULES" >> $JRE_HOME/release
cp -R $BASE_DIR/$JBRSDK_BUNDLE/Contents/MacOS $JRE_CONTENTS
cp $BASE_DIR/$JBRSDK_BUNDLE/Contents/Info.plist $JRE_CONTENTS
cp -a jcef_mac/Frameworks ${JRE_CONTENTS} || exit $?
cp -a jcef_mac/Helpers ${JRE_CONTENTS} || exit $?
echo Creating $JBR.tar.gz ...
COPYFILE_DISABLE=1 tar -pczf $JBR.tar.gz --exclude='*.dSYM' --exclude='man' -C $BASE_DIR $JBR_BUNDLE || exit $?

View File

@@ -26,9 +26,7 @@ log "Signing libraries and executables..."
# -perm +111 searches for executables
for f in \
"Contents/Home/bin" \
"Contents/Home/lib" \
"Contents/Frameworks" \
"Contents/Helpers"; do
"Contents/Home/lib"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \

View File

@@ -37,7 +37,11 @@ BUILD_NAME="$(ls "$EXPLODED")"
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/jmods; then
mv $EXPLODED/$BUILD_NAME/Contents/Home/jmods $BACKUP_JMODS
fi
if test -d $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks; then
mv $EXPLODED/$BUILD_NAME/Contents/Home/Frameworks $BACKUP_JMODS
fi
#log "$INPUT_FILE unzipped and removed"
log "$INPUT_FILE extracted and removed"
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
@@ -124,6 +128,9 @@ log "Zipping $BUILD_NAME to $INPUT_FILE ..."
if test -d $BACKUP_JMODS/jmods; then
mv $BACKUP_JMODS/jmods $EXPLODED/$BUILD_NAME/Contents/Home
fi
if test -d $BACKUP_JMODS/Frameworks; then
mv $BACKUP_JMODS/Frameworks $EXPLODED/$BUILD_NAME/Contents/Home
fi
COPYFILE_DISABLE=1 tar -pczf $INPUT_FILE --exclude='*.dSYM' --exclude='man' -C $EXPLODED $BUILD_NAME
log "Finished zipping"

View File

@@ -1,9 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/windows/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,100 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
function create_jbr {
case "$1" in
"${bundle_type}_lw")
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef" | "jfx_jcef")
cat modules.list > modules_tmp.list
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
;;
esac
rm -rf ${JBR_BUNDLE}
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
if [[ "${bundle_type}" == *jcef* ]]
then
cp -R jcef_win_x64/* ${JBR_BUNDLE}/bin
fi
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
git checkout -- modules.list src
case "$bundle_type" in
"jfx")
echo "Excluding jcef modules"
git apply -p0 < jb/project/tools/exclude_jcef_module.patch
;;
"jcef")
echo "Excluding jfx modules"
git apply -p0 < jb/project/tools/exclude_jfx_module.patch
;;
esac
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--disable-warnings-as-errors \
--disable-debug-symbols \
--with-target-bits=64 \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=${WORK_DIR}/modular-sdk \
--with-toolchain-version=2015 \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
if [ "$bundle_type" == "jfx_jcef" ]; then
make LOG=info images CONF=windows-x86_64-normal-server-release test-image || exit 1
else
make LOG=info images CONF=windows-x86_64-normal-server-release || exit 1
fi
JSDK=build/windows-x86_64-normal-server-release/images/jdk
if [[ "$bundle_type" == *jcef* ]]; then
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
fi
BASE_DIR=build/windows-x86_64-normal-server-release/images
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
cp -R jcef_win_x64/* ${JBRSDK_BUNDLE}/bin
JBR_BUNDLE=jbr_${bundle_type}
create_jbr ${bundle_type}
#JBR_BUNDLE=jbr_${bundle_type}_lw
#create_jbr ${bundle_type}_lw

View File

@@ -1,57 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--disable-warnings-as-errors \
--disable-debug-symbols \
--with-target-bits=32 \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-toolchain-version=2015 \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
make clean CONF=windows-x86-normal-server-release || exit 1
make LOG=info images CONF=windows-x86-normal-server-release test-image || exit 1
JBSDK=${JBRSDK_BASE_NAME}-windows-x86-b${build_number}
BASE_DIR=build/windows-x86-normal-server-release/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
JBR_BUNDLE=jbr
rm -rf ${JBR_BUNDLE}
grep -v javafx modules.list | grep -v "jdk.internal.vm\|jdk.aot\|jcef" > modules.list.x86
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list.x86 | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${JBR_BUNDLE}/release

View File

@@ -1,72 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
function pack_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
;;
"jfx" | "jcef")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
;;
esac
JBR=$JBR_BASE_NAME-windows-x64-b$build_number
echo Creating $JBR.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || exit 1
#rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/windows-x86_64-normal-server-release/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
BASE_DIR=.
if [ "$bundle_type" == "jfx_jcef" ]; then
JBRSDK_BUNDLE=jbrsdk
echo Creating $JBSDK.tar.gz ...
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
fi
JBR_BUNDLE=jbr_${bundle_type}
pack_jbr $bundle_type
if [ "$bundle_type" == "jfx_jcef" ]; then
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1
fi

View File

@@ -1,45 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/windows-x86-normal-server-release/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x86-b$build_number
BASE_DIR=.
JBRSDK_BUNDLE=jbrsdk
echo Creating $JBSDK.tar.gz ...
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
JBR=$JBR_BASE_NAME-windows-x86-b$build_number
echo Creating $JBR.tar.gz ...
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR ${JBR_BUNDLE} || exit 1
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x86-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1

View File

@@ -230,7 +230,7 @@ sequence.dialog.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats
sequence.dialoginput.x-MS950-HKSCS-XP=alphabetic,chinese-ms950,chinese-hkscs,dingbats,symbol,chinese-ms950-extb
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,dingbats,symbol
sequence.allfonts.UTF-8.ja=alphabetic,japanese,devanagari,dingbats,symbol
sequence.allfonts.UTF-8.ja=alphabetic,japanese,dingbats,symbol
sequence.allfonts.windows-1255=hebrew,alphabetic/1252,dingbats,symbol

View File

@@ -4241,121 +4241,98 @@ static void file_attribute_data_to_stat(struct stat* sbuf, WIN32_FILE_ATTRIBUTE_
}
}
static errno_t convert_to_unicode(char const* char_path, LPWSTR* unicode_path) {
// Get required buffer size to convert to Unicode
int unicode_path_len = MultiByteToWideChar(CP_THREAD_ACP,
MB_ERR_INVALID_CHARS,
char_path, -1,
NULL, 0);
if (unicode_path_len == 0) {
return EINVAL;
}
*unicode_path = NEW_C_HEAP_ARRAY(WCHAR, unicode_path_len, mtInternal);
int result = MultiByteToWideChar(CP_THREAD_ACP,
MB_ERR_INVALID_CHARS,
char_path, -1,
*unicode_path, unicode_path_len);
assert(result == unicode_path_len, "length already checked above");
return ERROR_SUCCESS;
}
static errno_t get_full_path(LPCWSTR unicode_path, LPWSTR* full_path) {
// Get required buffer size to convert to full path. The return
// value INCLUDES the terminating null character.
DWORD full_path_len = GetFullPathNameW(unicode_path, 0, NULL, NULL);
if (full_path_len == 0) {
return EINVAL;
}
*full_path = NEW_C_HEAP_ARRAY(WCHAR, full_path_len, mtInternal);
// When the buffer has sufficient size, the return value EXCLUDES the
// terminating null character
DWORD result = GetFullPathNameW(unicode_path, full_path_len, *full_path, NULL);
assert(result <= full_path_len, "length already checked above");
return ERROR_SUCCESS;
}
static void set_path_prefix(char* buf, LPWSTR* prefix, int* prefix_off, bool* needs_fullpath) {
*prefix_off = 0;
*needs_fullpath = true;
if (::isalpha(buf[0]) && !::IsDBCSLeadByte(buf[0]) && buf[1] == ':' && buf[2] == '\\') {
*prefix = L"\\\\?\\";
} else if (buf[0] == '\\' && buf[1] == '\\') {
if (buf[2] == '?' && buf[3] == '\\') {
*prefix = L"";
*needs_fullpath = false;
} else {
*prefix = L"\\\\?\\UNC";
*prefix_off = 1; // Overwrite the first char with the prefix, so \\share\path becomes \\?\UNC\share\path
}
} else {
*prefix = L"\\\\?\\";
}
}
// Returns the given path as an absolute wide path in unc format. The returned path is NULL
// on error (with err being set accordingly) and should be freed via os::free() otherwise.
// additional_space is the size of space, in wchar_t, the function will additionally add to
// the allocation of return buffer (such that the size of the returned buffer is at least
// wcslen(buf) + 1 + additional_space).
// additional_space is the number of additionally allocated wchars after the terminating L'\0'.
// This is based on pathToNTPath() in io_util_md.cpp, but omits the optimizations for
// short paths.
static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additional_space = 0) {
if ((path == NULL) || (path[0] == '\0')) {
err = ENOENT;
return NULL;
}
size_t path_len = strlen(path);
// Need to allocate at least room for 3 characters, since os::native_path transforms C: to C:.
size_t buf_len = 1 + MAX2((size_t)3, strlen(path));
char* buf = NEW_C_HEAP_ARRAY(char, buf_len, mtInternal);
strncpy(buf, path, buf_len);
os::native_path(buf);
char* buf = (char*) os::malloc(1 + MAX2((size_t) 3, path_len), mtInternal);
wchar_t* result = NULL;
LPWSTR prefix = NULL;
int prefix_off = 0;
bool needs_fullpath = true;
set_path_prefix(buf, &prefix, &prefix_off, &needs_fullpath);
LPWSTR unicode_path = NULL;
err = convert_to_unicode(buf, &unicode_path);
FREE_C_HEAP_ARRAY(char, buf);
if (err != ERROR_SUCCESS) {
return NULL;
}
LPWSTR converted_path = NULL;
if (needs_fullpath) {
err = get_full_path(unicode_path, &converted_path);
if (buf == NULL) {
err = ENOMEM;
} else {
converted_path = unicode_path;
}
memcpy(buf, path, path_len + 1);
os::native_path(buf);
LPWSTR result = NULL;
if (converted_path != NULL) {
wchar_t* prefix;
int prefix_off = 0;
bool is_abs = true;
bool needs_fullpath = true;
if (::isalpha(buf[0]) && !::IsDBCSLeadByte(buf[0]) && buf[1] == ':' && buf[2] == '\\') {
prefix = L"\\\\?\\";
} else if (buf[0] == '\\' && buf[1] == '\\') {
if (buf[2] == '?' && buf[3] == '\\') {
prefix = L"";
needs_fullpath = false;
} else {
prefix = L"\\\\?\\UNC";
prefix_off = 1; // Overwrite the first char with the prefix, so \\share\path becomes \\?\UNC\share\path
}
} else {
is_abs = false;
prefix = L"\\\\?\\";
}
size_t buf_len = strlen(buf);
size_t prefix_len = wcslen(prefix);
size_t result_len = prefix_len - prefix_off + wcslen(converted_path) + additional_space + 1;
result = NEW_C_HEAP_ARRAY(WCHAR, result_len, mtInternal);
_snwprintf(result, result_len, L"%s%s", prefix, &converted_path[prefix_off]);
size_t full_path_size = is_abs ? 1 + buf_len : JVM_MAXPATHLEN;
size_t result_size = prefix_len + full_path_size - prefix_off;
result = (wchar_t*) os::malloc(sizeof(wchar_t) * (additional_space + result_size), mtInternal);
// Remove trailing pathsep (not for \\?\<DRIVE>:\, since it would make it relative)
result_len = wcslen(result);
if ((result[result_len - 1] == L'\\') &&
!(::iswalpha(result[4]) && result[5] == L':' && result_len == 7)) {
result[result_len - 1] = L'\0';
if (result == NULL) {
err = ENOMEM;
} else {
size_t converted_chars;
wchar_t* path_start = result + prefix_len - prefix_off;
err = ::mbstowcs_s(&converted_chars, path_start, buf_len + 1, buf, buf_len);
if ((err == ERROR_SUCCESS) && needs_fullpath) {
wchar_t* tmp = (wchar_t*) os::malloc(sizeof(wchar_t) * full_path_size, mtInternal);
if (tmp == NULL) {
err = ENOMEM;
} else {
if (!_wfullpath(tmp, path_start, full_path_size)) {
err = ENOENT;
} else {
::memcpy(path_start, tmp, (1 + wcslen(tmp)) * sizeof(wchar_t));
}
os::free(tmp);
}
}
memcpy(result, prefix, sizeof(wchar_t) * prefix_len);
// Remove trailing pathsep (not for \\?\<DRIVE>:\, since it would make it relative)
size_t result_len = wcslen(result);
if (result[result_len - 1] == L'\\') {
if (!(::iswalpha(result[4]) && result[5] == L':' && result_len == 7)) {
result[result_len - 1] = L'\0';
}
}
}
}
if (converted_path != unicode_path) {
FREE_C_HEAP_ARRAY(WCHAR, converted_path);
}
FREE_C_HEAP_ARRAY(WCHAR, unicode_path);
os::free(buf);
return static_cast<wchar_t*>(result); // LPWSTR and wchat_t* are the same type on Windows.
if (err != ERROR_SUCCESS) {
os::free(result);
result = NULL;
}
return result;
}
int os::stat(const char *path, struct stat *sbuf) {

View File

@@ -67,7 +67,7 @@ static __thread bool reentry = false; /* prevent reentry deadlock (per-thread) *
/* Used to synchronize the installation of signal handlers. */
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static pthread_t tid;
static pthread_t tid = 0;
typedef void (*sa_handler_t)(int);
typedef void (*sa_sigaction_t)(int, siginfo_t *, void *);
@@ -100,11 +100,8 @@ static void signal_lock() {
/* When the jvm is installing its set of signal handlers, threads
* other than the jvm thread should wait. */
if (jvm_signal_installing) {
/* tid is not initialized until jvm_signal_installing is set to true. */
if (pthread_equal(tid, pthread_self()) == 0) {
do {
pthread_cond_wait(&cond, &mutex);
} while (jvm_signal_installing);
if (tid != pthread_self()) {
pthread_cond_wait(&cond, &mutex);
}
}
}

View File

@@ -304,8 +304,8 @@ final class CPlatformResponder {
// otherwise, we use char ignoring modifiers
int[] in = new int[] {
characterToGetKeyCode,
nsEvent.isHasDeadKey() ? 1 : 0,
nsEvent.getModifierFlags(),
nsEvent.isHasDeadKey() ? 1 : 0,
nsEvent.getKeyCode()
};

View File

@@ -33,7 +33,6 @@
#import "java_awt_event_InputEvent.h"
#import "java_awt_event_KeyEvent.h"
#import "sun_awt_event_KeyEvent.h"
#import "LWCToolkit.h"
#import "jni_util.h"
@@ -454,38 +453,38 @@ static NSDictionary* getDiacriticUnicharToVkCodeDictionary() {
dispatch_once(&onceToken, ^{
diacriticUnicharToVkCodeDictionary =
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_GRAVE], @"à",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_ACUTE], @"á",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_CIRCUMFLEX], @"â",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_TILDE], @"ã",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_DIAERESIS], @"ä",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_A_WITH_RING_ABOVE], @"å",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_AE], @"æ",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_C_WITH_CEDILLA], @"ç",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_E_WITH_GRAVE], @"è",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_E_WITH_ACUTE], @"é",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_E_WITH_CIRCUMFLEX], @"ê",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_E_WITH_DIAERESIS], @"ë",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_I_WITH_GRAVE], @"ì",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_I_WITH_ACUTE], @"í",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_I_WITH_CIRCUMFLEX], @"î",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_I_WITH_DIAERESIS], @"ï",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_ETH], @"ð",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_N_WITH_TILDE], @"ñ",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_GRAVE], @"ò",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_ACUTE], @"ó",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_CIRCUMFLEX], @"ô",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_TILDE], @"õ",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_DIAERESIS], @"ö",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_DIVISION_SIGN], @"÷",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_O_WITH_SLASH], @"ø",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_U_WITH_GRAVE], @"ù",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_U_WITH_ACUTE], @"ú",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_U_WITH_CIRCUMFLEX], @"û",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_U_WITH_DIAERESIS], @"ü",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_Y_WITH_ACUTE], @"ý",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_THORN], @"þ",
[NSNumber numberWithInt:sun_awt_event_KeyEvent_VK_Y_WITH_DIAERESIS], @"ÿ",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_GRAVE], @"à",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_ACUTE], @"á",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_CIRCUMFLEX], @"â",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_TILDE], @"ã",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_DIAERESIS], @"ä",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A_WITH_RING_ABOVE], @"å",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_AE], @"æ",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_C_WITH_CEDILLA], @"ç",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_E_WITH_GRAVE], @"è",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_E_WITH_ACUTE], @"é",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_E_WITH_CIRCUMFLEX], @"ê",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_E_WITH_DIAERESIS], @"ë",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_I_WITH_GRAVE], @"ì",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_I_WITH_ACUTE], @"í",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_I_WITH_CIRCUMFLEX], @"î",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_I_WITH_DIAERESIS], @"ï",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ETH], @"ð",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_N_WITH_TILDE], @"ñ",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_GRAVE], @"ò",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_ACUTE], @"ó",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_CIRCUMFLEX], @"ô",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_TILDE], @"õ",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_DIAERESIS], @"ö",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_DIVISION_SIGN], @"÷",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O_WITH_SLASH], @"ø",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_U_WITH_GRAVE], @"ù",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_U_WITH_ACUTE], @"ú",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_U_WITH_CIRCUMFLEX], @"û",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_U_WITH_DIAERESIS], @"ü",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_Y_WITH_ACUTE], @"ý",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_THORN], @"þ",
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_Y_WITH_DIAERESIS], @"ÿ",
nil
];
// This is ok to retain a singleton object
@@ -918,8 +917,8 @@ JNF_COCOA_ENTER(env);
// in = [testChar, testDeadChar, modifierFlags, keyCode]
jchar testChar = (jchar)data[0];
BOOL isDeadChar = (data[1] != 0);
jint modifierFlags = data[2];
jint modifierFlags = data[1];
BOOL isDeadChar = (data[2] != 0);
jshort keyCode = (jshort)data[3];
jint jkeyCode = java_awt_event_KeyEvent_VK_UNDEFINED;

View File

@@ -1175,15 +1175,6 @@ JNF_COCOA_ENTER(env);
// ensure we repaint the whole window after the resize operation
// (this will also re-enable screen updates, which were disabled above)
// TODO: send PaintEvent
// the macOS may ignore our "setFrame" request, in this, case the
// windowDidMove() will not come and we need to manually resync the
// "java.awt.Window" and NSWindow locations, because "java.awt.Window"
// already uses location ignored by the macOS.
// see sun.lwawt.LWWindowPeer#notifyReshape()
if (!NSEqualRects(rect, [nsWindow frame])) {
[window _deliverMoveResizeEvent];
}
}];
JNF_COCOA_EXIT(env);

View File

@@ -30,6 +30,7 @@ import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.HashMap;
import sun.awt.AWTAccessor;
@@ -410,6 +411,74 @@ public class KeyEvent extends InputEvent {
/** Constant for the "Z" key. */
public static final int VK_Z = 0x5A;
/** */
public static final int START_OF_LATIN_DIACRITIC_LETTERS = 0x0300;
/** */
public static final int VK_A_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE0;
/** */
public static final int VK_A_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE1;
/** */
public static final int VK_A_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xE2;
/** */
public static final int VK_A_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE3;
/** */
public static final int VK_A_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xE4;
/** */
public static final int VK_A_WITH_RING_ABOVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE5;
/** */
public static final int VK_AE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE6;
/** */
public static final int VK_C_WITH_CEDILLA = START_OF_LATIN_DIACRITIC_LETTERS + 0xE7;
/** */
public static final int VK_E_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE8;
/** */
public static final int VK_E_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE9;
/** */
public static final int VK_E_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xEA;
/** */
public static final int VK_E_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xEB;
/** */
public static final int VK_I_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xEC;
/** */
public static final int VK_I_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xED;
/** */
public static final int VK_I_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xEE;
/** */
public static final int VK_I_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xEF;
/** */
public static final int VK_ETH = START_OF_LATIN_DIACRITIC_LETTERS + 0xF0;
/** */
public static final int VK_N_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF1;
/** */
public static final int VK_O_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF2;
/** */
public static final int VK_O_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF3;
/** */
public static final int VK_O_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xF4;
/** */
public static final int VK_O_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF5;
/** */
public static final int VK_O_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xF6;
/** */
public static final int VK_DIVISION_SIGN = START_OF_LATIN_DIACRITIC_LETTERS + 0xF7;
/** */
public static final int VK_O_WITH_SLASH = START_OF_LATIN_DIACRITIC_LETTERS + 0xF8;
/** */
public static final int VK_U_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF9;
/** */
public static final int VK_U_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xFA;
/** */
public static final int VK_U_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xFB;
/** */
public static final int VK_U_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xFC;
/** */
public static final int VK_Y_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xFD;
/** */
public static final int VK_THORN = START_OF_LATIN_DIACRITIC_LETTERS + 0xFE;
/** */
public static final int VK_Y_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xFF;
/**
* Constant for the open bracket key, "["
*/
@@ -1354,6 +1423,43 @@ public class KeyEvent extends InputEvent {
return keyLocation;
}
private static final HashMap<Integer, String> asciiCodeToString = new HashMap<Integer, String>() {
{
put(VK_A_WITH_GRAVE, "\u00e0");
put(VK_A_WITH_ACUTE, "\u00e1");
put(VK_A_WITH_CIRCUMFLEX, "\u00e2");
put(VK_A_WITH_TILDE, "\u00e3");
put(VK_A_WITH_DIAERESIS, "\u00e4");
put(VK_A_WITH_RING_ABOVE, "\u00e5");
put(VK_AE, "\u00e6");
put(VK_C_WITH_CEDILLA, "\u00e7");
put(VK_E_WITH_GRAVE, "\u00e8");
put(VK_E_WITH_ACUTE, "\u00e9");
put(VK_E_WITH_CIRCUMFLEX, "\u00ea");
put(VK_E_WITH_DIAERESIS, "\u00eb");
put(VK_I_WITH_GRAVE, "\u00ec");
put(VK_I_WITH_ACUTE, "\u00ed");
put(VK_I_WITH_CIRCUMFLEX, "\u00ee");
put(VK_I_WITH_DIAERESIS, "\u00ef");
put(VK_ETH, "\u00f0");
put(VK_N_WITH_TILDE, "\u00f1");
put(VK_O_WITH_GRAVE, "\u00f2");
put(VK_O_WITH_ACUTE, "\u00f3");
put(VK_O_WITH_CIRCUMFLEX, "\u00f4");
put(VK_O_WITH_TILDE, "\u00f5");
put(VK_O_WITH_DIAERESIS, "\u00f6");
put(VK_DIVISION_SIGN, "\u00f7");
put(VK_O_WITH_SLASH, "\u00f8");
put(VK_U_WITH_GRAVE, "\u00f9");
put(VK_U_WITH_ACUTE, "\u00fa");
put(VK_U_WITH_CIRCUMFLEX, "\u00fb");
put(VK_U_WITH_DIAERESIS, "\u00fc");
put(VK_Y_WITH_ACUTE, "\u00fd");
put(VK_THORN, "\u00fe");
put(VK_Y_WITH_DIAERESIS, "\u00ff");
}
};
/**
* Returns a String describing the keyCode, such as "HOME", "F1" or "A".
* These strings can be localized by changing the awt.properties file.
@@ -1369,7 +1475,7 @@ public class KeyEvent extends InputEvent {
}
if (keyCode > 0x0300 && keyCode < 0x0400) {
return sun.awt.event.KeyEvent.asciiCodeToString.get(keyCode);
return asciiCodeToString.get(keyCode);
}
switch(keyCode) {

View File

@@ -1584,12 +1584,7 @@ public abstract class AbstractDocument implements Document, Serializable {
/**
* Document property that indicates if a character has been inserted
* into the document that is more than one byte long. GlyphView uses
* this to determine if it should use BreakIterator. This property should
* not be publicly exposed, since it is used for implementation convenience
* only. As a side effect, copies of this property may be in its subclasses
* that live in different packages (e.g. HTMLDocument as of now), so those
* copies should also be taken care of when this property needs to be
* modified.
* this to determine if it should use BreakIterator.
*/
static final Object MultiByteProperty = "multiByte";

View File

@@ -770,8 +770,38 @@ public class GlyphView extends View implements TabableView, Cloneable {
private int getBreakSpot(int p0, int p1) {
if (breakSpots == null) {
// Re-calculate breakpoints for the whole view
int start = getStartOffset();
int end = getEndOffset();
int[] bs = new int[end + 1 - start];
int ix = 0;
// Breaker should work on the parent element because there may be
// a valid breakpoint at the end edge of the view (space, etc.)
Element parent = getElement().getParentElement();
int pstart = (parent == null ? start : parent.getStartOffset());
int pend = (parent == null ? end : parent.getEndOffset());
Segment s = getText(pstart, pend);
s.first();
BreakIterator breaker = getBreaker();
breakSpots = calcBreakSpots(breaker);
breaker.setText(s);
// Backward search should start from end+1 unless there's NO end+1
int startFrom = end + (pend > end ? 1 : 0);
for (;;) {
startFrom = breaker.preceding(s.offset + (startFrom - pstart))
+ (pstart - s.offset);
if (startFrom > start) {
// The break spot is within the view
bs[ix++] = startFrom;
} else {
break;
}
}
SegmentCache.releaseSharedSegment(s);
breakSpots = new int[ix];
System.arraycopy(bs, 0, breakSpots, 0, ix);
}
int breakSpot = BreakIterator.DONE;
@@ -787,41 +817,6 @@ public class GlyphView extends View implements TabableView, Cloneable {
return breakSpot;
}
protected int[] calcBreakSpots(BreakIterator breaker) {
int start = getStartOffset();
int end = getEndOffset();
int[] bs = new int[end + 1 - start];
int ix = 0;
// Breaker should work on the parent element because there may be
// a valid breakpoint at the end edge of the view (space, etc.)
Element parent = getElement().getParentElement();
int pstart = (parent == null ? start : parent.getStartOffset());
int pend = (parent == null ? end : parent.getEndOffset());
Segment s = getText(pstart, pend);
s.first();
breaker.setText(s);
// Backward search should start from end+1 unless there's NO end+1
int startFrom = end + (pend > end ? 1 : 0);
for (;;) {
startFrom = breaker.preceding(s.offset + (startFrom - pstart))
+ (pstart - s.offset);
if (startFrom > start) {
// The break spot is within the view
bs[ix++] = startFrom;
} else {
break;
}
}
SegmentCache.releaseSharedSegment(s);
int[] result = new int[ix];
System.arraycopy(bs, 0, result, 0, ix);
return result;
}
/**
* Return break iterator appropriate for the current document.
*

View File

@@ -94,7 +94,6 @@ import javax.swing.text.View;
* <li>list-style-image
* <li>list-style-type
* <li>list-style-position
* <li>overflow-wrap
* </ul>
* The following are modeled, but currently not rendered.
* <ul><li>font-variant
@@ -492,12 +491,6 @@ public class CSS implements Serializable {
public static final Attribute MARGIN_TOP =
new Attribute("margin-top", "0", false);
/**
* CSS attribute "overflow-wrap".
*/
public static final Attribute OVERFLOW_WRAP =
new Attribute("overflow-wrap", "normal", true);
/**
* CSS attribute "padding".
*/
@@ -601,8 +594,7 @@ public class CSS implements Serializable {
PADDING_TOP, TEXT_ALIGN, TEXT_DECORATION, TEXT_INDENT, TEXT_TRANSFORM,
VERTICAL_ALIGN, WORD_SPACING, WHITE_SPACE, WIDTH,
BORDER_SPACING, CAPTION_SIDE,
MARGIN_LEFT_LTR, MARGIN_LEFT_RTL, MARGIN_RIGHT_LTR, MARGIN_RIGHT_RTL,
OVERFLOW_WRAP
MARGIN_LEFT_LTR, MARGIN_LEFT_RTL, MARGIN_RIGHT_LTR, MARGIN_RIGHT_RTL
};
private static final Attribute[] ALL_MARGINS =

View File

@@ -1868,13 +1868,6 @@ public class HTMLDocument extends DefaultStyledDocument {
*/
private static final String I18NProperty = "i18n";
/**
* Multi-byte property key.
*
* @see AbstractDocument#MultiByteProperty
*/
static final String MultiByteProperty = "multiByte";
static {
contentAttributeSet = new SimpleAttributeSet();
((MutableAttributeSet)contentAttributeSet).

View File

@@ -26,7 +26,6 @@ package javax.swing.text.html;
import java.awt.*;
import java.text.BreakIterator;
import java.util.Locale;
import javax.swing.event.DocumentEvent;
import javax.swing.text.*;
@@ -62,7 +61,6 @@ public class InlineView extends LabelView {
* @see View#insertUpdate
*/
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) {
wrapAnywhereMinimumSpan = -1;
super.insertUpdate(e, a, f);
}
@@ -79,7 +77,6 @@ public class InlineView extends LabelView {
* @see View#removeUpdate
*/
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) {
wrapAnywhereMinimumSpan = -1;
super.removeUpdate(e, a, f);
}
@@ -93,7 +90,6 @@ public class InlineView extends LabelView {
* @see View#changedUpdate
*/
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {
wrapAnywhereMinimumSpan = -1;
super.changedUpdate(e, a, f);
StyleSheet sheet = getStyleSheet();
attr = sheet.getViewAttributes(this);
@@ -210,8 +206,6 @@ public class InlineView extends LabelView {
nowrap = false;
}
wrapAnywhere = "anywhere".equals(a.getAttribute(CSS.Attribute.OVERFLOW_WRAP));
HTMLDocument doc = (HTMLDocument)getDocument();
// fetches background color from stylesheet if specified
Color bg = doc.getBackground(a);
@@ -230,41 +224,6 @@ public class InlineView extends LabelView {
return doc.getStyleSheet();
}
@Override
public float getMinimumSpan(int axis) {
if (axis == View.X_AXIS && wrapAnywhere) {
if (wrapAnywhereMinimumSpan < 0) {
wrapAnywhereMinimumSpan = 0;
int startOffset = getStartOffset();
int endOffset = getEndOffset();
Document doc = getDocument();
if ((doc != null) && Boolean.TRUE.equals(doc.getProperty(HTMLDocument.MultiByteProperty))) {
Container c = getContainer();
Locale locale = (c == null ? Locale.getDefault() : c.getLocale());
BreakIterator breaker = BreakIterator.getCharacterInstance(locale);
int[] breakSpots = calcBreakSpots(breaker);
int lastBreak = endOffset;
for (int breakSpot : breakSpots) {
wrapAnywhereMinimumSpan = Math.max(wrapAnywhereMinimumSpan,
getPartialSpan(breakSpot, lastBreak));
lastBreak = breakSpot;
}
wrapAnywhereMinimumSpan = Math.max(wrapAnywhereMinimumSpan,
getPartialSpan(startOffset, lastBreak));
} else {
for (int i = startOffset ; i < endOffset; i++) {
wrapAnywhereMinimumSpan = Math.max(wrapAnywhereMinimumSpan,
getPartialSpan(i, i + 1));
}
}
}
return wrapAnywhereMinimumSpan;
}
return super.getMinimumSpan(axis);
}
private float wrapAnywhereMinimumSpan = -1;
private boolean wrapAnywhere;
private boolean nowrap;
private AttributeSet attr;
}

View File

@@ -42,7 +42,6 @@ import javax.swing.text.*;
class LineView extends ParagraphView {
/** Last place painted at. */
int tabBase;
private boolean wrap;
/**
* Creates a LineView object.
@@ -72,7 +71,7 @@ class LineView extends ParagraphView {
* @see View#getPreferredSpan
*/
public float getMinimumSpan(int axis) {
return wrap ? super.getMinimumSpan(axis) : getPreferredSpan(axis);
return getPreferredSpan(axis);
}
/**
@@ -121,7 +120,7 @@ class LineView extends ParagraphView {
* is the height inside of the inset area.
*/
protected void layout(int width, int height) {
super.layout(wrap ? width : Integer.MAX_VALUE - 1, height);
super.layout(Integer.MAX_VALUE - 1, height);
}
/**
@@ -185,10 +184,4 @@ class LineView extends ParagraphView {
protected int getCharactersPerTab() {
return 8;
}
protected void setPropertiesFromAttributes() {
super.setPropertiesFromAttributes();
View parent = getParent();
wrap = parent != null && parent.getAttributes().containsAttribute(CSS.Attribute.WHITE_SPACE, "pre-wrap");
}
}

View File

@@ -85,7 +85,7 @@ public class AWTThreading {
public Thread newThread(Runnable r) {
Thread t = factory.newThread(r);
t.setDaemon(true);
t.setName(AWTThreading.class.getSimpleName() + " " + t.getName());
t.setName("AWT-" + AWTThreading.class.getSimpleName() + " " + t.getName());
return t;
}
})
@@ -161,42 +161,24 @@ public class AWTThreading {
instance.invocations.push(new TrackingQueue());
}
final TrackingQueue queue = instance.invocations.peek();
final InvocationEvent[] eventRef = new InvocationEvent[1];
InvocationEvent event = new InvocationEvent(source, runnable, listener, catchThrowables) {
final SoftReference<TrackingQueue> queueRef = new SoftReference<>(queue);
queue.add(eventRef[0] = new InvocationEvent(
source,
runnable,
// Wrap the original completion listener so that it:
// - guarantees a single run either from dispatch or dispose
// - removes the invocation event from the tracking queue
new Runnable() {
SoftReference<TrackingQueue> queueRef = new SoftReference<>(queue);
@Override
public void run() {
if (queueRef != null) {
if (listener != null) {
listener.run();
}
TrackingQueue q = queueRef.get();
if (q != null) {
q.remove(eventRef[0]);
q.clear();
}
queueRef = null;
}
}
},
catchThrowables)
{
@Override
public void dispatch() {
if (!isDispatched()) {
super.dispatch();
TrackingQueue queue = queueRef.get();
if (queue != null) {
queue.remove(this);
queueRef.clear();
}
}
}
});
return eventRef[0];
};
queue.add(event);
return event;
}
}
return new InvocationEvent(source, runnable, listener, catchThrowables);

View File

@@ -1,112 +0,0 @@
package sun.awt.event;
import java.lang.annotation.Native;
import java.util.HashMap;
public class KeyEvent {
/** */
@Native
public static final int START_OF_LATIN_DIACRITIC_LETTERS = 0x0300;
/** */
public static final int VK_A_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE0;
/** */
public static final int VK_A_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE1;
/** */
public static final int VK_A_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xE2;
/** */
public static final int VK_A_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE3;
/** */
public static final int VK_A_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xE4;
/** */
public static final int VK_A_WITH_RING_ABOVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE5;
/** */
public static final int VK_AE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE6;
/** */
public static final int VK_C_WITH_CEDILLA = START_OF_LATIN_DIACRITIC_LETTERS + 0xE7;
/** */
public static final int VK_E_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE8;
/** */
public static final int VK_E_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xE9;
/** */
public static final int VK_E_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xEA;
/** */
public static final int VK_E_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xEB;
/** */
public static final int VK_I_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xEC;
/** */
public static final int VK_I_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xED;
/** */
public static final int VK_I_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xEE;
/** */
public static final int VK_I_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xEF;
/** */
public static final int VK_ETH = START_OF_LATIN_DIACRITIC_LETTERS + 0xF0;
/** */
public static final int VK_N_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF1;
/** */
public static final int VK_O_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF2;
/** */
public static final int VK_O_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF3;
/** */
public static final int VK_O_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xF4;
/** */
public static final int VK_O_WITH_TILDE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF5;
/** */
public static final int VK_O_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xF6;
/** */
public static final int VK_DIVISION_SIGN = START_OF_LATIN_DIACRITIC_LETTERS + 0xF7;
/** */
public static final int VK_O_WITH_SLASH = START_OF_LATIN_DIACRITIC_LETTERS + 0xF8;
/** */
public static final int VK_U_WITH_GRAVE = START_OF_LATIN_DIACRITIC_LETTERS + 0xF9;
/** */
public static final int VK_U_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xFA;
/** */
public static final int VK_U_WITH_CIRCUMFLEX = START_OF_LATIN_DIACRITIC_LETTERS + 0xFB;
/** */
public static final int VK_U_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xFC;
/** */
public static final int VK_Y_WITH_ACUTE = START_OF_LATIN_DIACRITIC_LETTERS + 0xFD;
/** */
public static final int VK_THORN = START_OF_LATIN_DIACRITIC_LETTERS + 0xFE;
/** */
public static final int VK_Y_WITH_DIAERESIS = START_OF_LATIN_DIACRITIC_LETTERS + 0xFF;
public static final HashMap<Integer, String> asciiCodeToString = new HashMap<Integer, String>() {
{
put(VK_A_WITH_GRAVE, "\u00e0");
put(VK_A_WITH_ACUTE, "\u00e1");
put(VK_A_WITH_CIRCUMFLEX, "\u00e2");
put(VK_A_WITH_TILDE, "\u00e3");
put(VK_A_WITH_DIAERESIS, "\u00e4");
put(VK_A_WITH_RING_ABOVE, "\u00e5");
put(VK_AE, "\u00e6");
put(VK_C_WITH_CEDILLA, "\u00e7");
put(VK_E_WITH_GRAVE, "\u00e8");
put(VK_E_WITH_ACUTE, "\u00e9");
put(VK_E_WITH_CIRCUMFLEX, "\u00ea");
put(VK_E_WITH_DIAERESIS, "\u00eb");
put(VK_I_WITH_GRAVE, "\u00ec");
put(VK_I_WITH_ACUTE, "\u00ed");
put(VK_I_WITH_CIRCUMFLEX, "\u00ee");
put(VK_I_WITH_DIAERESIS, "\u00ef");
put(VK_ETH, "\u00f0");
put(VK_N_WITH_TILDE, "\u00f1");
put(VK_O_WITH_GRAVE, "\u00f2");
put(VK_O_WITH_ACUTE, "\u00f3");
put(VK_O_WITH_CIRCUMFLEX, "\u00f4");
put(VK_O_WITH_TILDE, "\u00f5");
put(VK_O_WITH_DIAERESIS, "\u00f6");
put(VK_DIVISION_SIGN, "\u00f7");
put(VK_O_WITH_SLASH, "\u00f8");
put(VK_U_WITH_GRAVE, "\u00f9");
put(VK_U_WITH_ACUTE, "\u00fa");
put(VK_U_WITH_CIRCUMFLEX, "\u00fb");
put(VK_U_WITH_DIAERESIS, "\u00fc");
put(VK_Y_WITH_ACUTE, "\u00fd");
put(VK_THORN, "\u00fe");
put(VK_Y_WITH_DIAERESIS, "\u00ff");
}
};
}

View File

@@ -69,8 +69,10 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
//
// enable X11_DISABLE_OVERRIDE_FLAG by default (users haven't found side-effects), see
// https://youtrack.jetbrains.com/issue/JBR-1680#focus=streamItem-27-3924178.0-0
private static final boolean X11_DISABLE_OVERRIDE_FLAG;
private static final boolean X11_DISABLE_OVERRIDE_XWINDOWPEER;
private static final boolean X11_DISABLE_OVERRIDE_FLAG =
GetPropertyAction.privilegedGetProperty("x11.disable.override.flag", "true").equalsIgnoreCase("true");
private static final boolean X11_DISABLE_OVERRIDE_XWINDOWPEER =
GetPropertyAction.privilegedGetProperty("x11.disable.override.xwindowpeer", "false").equalsIgnoreCase("true");
// should be synchronized on awtLock
private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
@@ -149,17 +151,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
*/
private static final int MAXIMUM_BUFFER_LENGTH_NET_WM_ICON = (2<<15) - 1;
static {
/* https://userbase.kde.org/KDE_System_Administration/Environment_Variables#KDE_FULL_SESSION */
final String kdeSession = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getenv("KDE_FULL_SESSION"));
final boolean isKDE = kdeSession != null && !kdeSession.isEmpty();
X11_DISABLE_OVERRIDE_FLAG =
GetPropertyAction.privilegedGetProperty("x11.disable.override.flag", isKDE ? "true" : "false").equalsIgnoreCase("true");
X11_DISABLE_OVERRIDE_XWINDOWPEER =
GetPropertyAction.privilegedGetProperty("x11.disable.override.xwindowpeer", "false").equalsIgnoreCase("true");
}
void preInit(XCreateWindowParams params) {
target = (Component)params.get(TARGET);
windowType = ((Window)target).getType();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@@ -179,14 +179,7 @@ class VMState {
}
synchronized boolean hasListener(VMListener listener) {
Iterator<WeakReference<VMListener>> iter = listeners.iterator();
while (iter.hasNext()) {
WeakReference<VMListener> ref = iter.next();
if (listener.equals(ref.get())) {
return true;
}
}
return false;
return listeners.contains(listener);
}
synchronized void removeListener(VMListener listener) {

View File

@@ -22,204 +22,273 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This module tracks classes that have been prepared, so as to
* be able to report which have been unloaded. On VM start-up
* and whenever new classes are loaded, all prepared classes'
* signatures are attached as JVMTI tag to the class object.
* Class unloading is tracked by registering
* ObjectFree callback on class objects. When this happens, we find
* the signature of the unloaded class(es) and report them back
* to the event handler to synthesize class-unload-events.
* be able to compute which have been unloaded. On VM start-up
* all prepared classes are put in a table. As class prepare
* events come in they are added to the table. After an unload
* event or series of them, the VM can be asked for the list
* of classes; this list is compared against the table keep by
* this module, any classes no longer present are known to
* have been unloaded.
*
* For efficient access, classes are keep in a hash table.
* Each slot in the hash table has a linked list of KlassNode.
*
* Comparing current set of classes is compared with previous
* set by transferring all classes in the current set into
* a new table, any that remain in the old table have been
* unloaded.
*/
#include "util.h"
#include "bag.h"
#include "classTrack.h"
#define NOT_TAGGED 0
/* ClassTrack hash table slot count */
#define CT_HASH_SLOT_COUNT 263 /* Prime which eauals 4k+3 for some k */
typedef struct KlassNode {
jclass klass; /* weak global reference */
char *signature; /* class signature */
struct KlassNode *next; /* next node in this slot */
} KlassNode;
/*
* The JVMTI tracking env to keep track of klass tags for class-unloads
* Hash table of prepared classes. Each entry is a pointer
* to a linked list of KlassNode.
*/
static jvmtiEnv* trackingEnv;
static KlassNode **table;
/*
* A bag containing all the deleted classes' signatures. Must be accessed under
* classTrackLock.
* Return slot in hash table to use for this class.
*/
struct bag* deletedSignatures;
/*
* Lock to keep integrity of deletedSignatures.
*/
static jrawMonitorID classTrackLock;
/*
* Invoke the callback when classes are freed, find and record the signature
* in deletedSignatures. Those are only used in addPreparedClass() by the
* same thread.
*/
static void JNICALL
cbTrackingObjectFree(jvmtiEnv* jvmti_env, jlong tag)
static jint
hashKlass(jclass klass)
{
debugMonitorEnter(classTrackLock);
if (deletedSignatures == NULL) {
debugMonitorExit(classTrackLock);
return;
}
*(char**)bagAdd(deletedSignatures) = (char*)jlong_to_ptr(tag);
debugMonitorExit(classTrackLock);
jint hashCode = objectHashCode(klass);
return abs(hashCode) % CT_HASH_SLOT_COUNT;
}
/*
* Called after class unloads have occurred.
* The signatures of classes which were unloaded are returned.
* Transfer a node (which represents klass) from the current
* table to the new table.
*/
static void
transferClass(JNIEnv *env, jclass klass, KlassNode **newTable) {
jint slot = hashKlass(klass);
KlassNode **head = &table[slot];
KlassNode **newHead = &newTable[slot];
KlassNode **nodePtr;
KlassNode *node;
/* Search the node list of the current table for klass */
for (nodePtr = head; node = *nodePtr, node != NULL; nodePtr = &(node->next)) {
if (isSameObject(env, klass, node->klass)) {
/* Match found transfer node */
/* unlink from old list */
*nodePtr = node->next;
/* insert in new list */
node->next = *newHead;
*newHead = node;
return;
}
}
/* we haven't found the class, only unloads should have happenned,
* so the only reason a class should not have been found is
* that it is not prepared yet, in which case we don't want it.
* Asset that the above is true.
*/
/**** the HotSpot VM doesn't create prepare events for some internal classes ***
JDI_ASSERT_MSG((classStatus(klass) &
(JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY))==0,
classSignature(klass));
***/
}
/*
* Delete a hash table of classes.
* The signatures of classes in the table are returned.
*/
static struct bag *
deleteTable(JNIEnv *env, KlassNode *oldTable[])
{
struct bag *signatures = bagCreateBag(sizeof(char*), 10);
jint slot;
if (signatures == NULL) {
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"signatures");
}
for (slot = 0; slot < CT_HASH_SLOT_COUNT; slot++) {
KlassNode *node = oldTable[slot];
while (node != NULL) {
KlassNode *next;
char **sigSpot;
/* Add signature to the signature bag */
sigSpot = bagAdd(signatures);
if (sigSpot == NULL) {
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"signature bag");
}
*sigSpot = node->signature;
/* Free weak ref and the node itself */
JNI_FUNC_PTR(env,DeleteWeakGlobalRef)(env, node->klass);
next = node->next;
jvmtiDeallocate(node);
node = next;
}
}
jvmtiDeallocate(oldTable);
return signatures;
}
/*
* Called after class unloads have occurred. Creates a new hash table
* of currently loaded prepared classes.
* The signatures of classes which were unloaded (not present in the
* new table) are returned.
*/
struct bag *
classTrack_processUnloads(JNIEnv *env)
{
debugMonitorEnter(classTrackLock);
if (deletedSignatures == NULL) {
// Class tracking not initialized, nobody's interested.
debugMonitorExit(classTrackLock);
return NULL;
KlassNode **newTable;
struct bag *unloadedSignatures;
unloadedSignatures = NULL;
newTable = jvmtiAllocate(CT_HASH_SLOT_COUNT * sizeof(KlassNode *));
if (newTable == NULL) {
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY, "classTrack table");
} else {
(void)memset(newTable, 0, CT_HASH_SLOT_COUNT * sizeof(KlassNode *));
WITH_LOCAL_REFS(env, 1) {
jint classCount;
jclass *classes;
jvmtiError error;
int i;
error = allLoadedClasses(&classes, &classCount);
if ( error != JVMTI_ERROR_NONE ) {
jvmtiDeallocate(newTable);
EXIT_ERROR(error,"loaded classes");
} else {
/* Transfer each current class into the new table */
for (i=0; i<classCount; i++) {
jclass klass = classes[i];
transferClass(env, klass, newTable);
}
jvmtiDeallocate(classes);
/* Delete old table, install new one */
unloadedSignatures = deleteTable(env, table);
table = newTable;
}
} END_WITH_LOCAL_REFS(env)
}
struct bag* deleted = deletedSignatures;
deletedSignatures = bagCreateBag(sizeof(char*), 10);
debugMonitorExit(classTrackLock);
return deleted;
return unloadedSignatures;
}
/*
* Add a class to the prepared class table.
* Add a class to the prepared class hash table.
* Assumes no duplicates.
*/
void
classTrack_addPreparedClass(JNIEnv *env_unused, jclass klass)
classTrack_addPreparedClass(JNIEnv *env, jclass klass)
{
jint slot = hashKlass(klass);
KlassNode **head = &table[slot];
KlassNode *node;
jvmtiError error;
jvmtiEnv* env = trackingEnv;
if (gdata && gdata->assertOn) {
// Check this is not already tagged.
jlong tag;
error = JVMTI_FUNC_PTR(trackingEnv, GetTag)(env, klass, &tag);
if (error != JVMTI_ERROR_NONE) {
EXIT_ERROR(error, "Unable to GetTag with class trackingEnv");
if (gdata->assertOn) {
/* Check this is not a duplicate */
for (node = *head; node != NULL; node = node->next) {
if (isSameObject(env, klass, node->klass)) {
JDI_ASSERT_FAILED("Attempting to insert duplicate class");
break;
}
}
JDI_ASSERT(tag == NOT_TAGGED);
}
char* signature;
error = classSignature(klass, &signature, NULL);
node = jvmtiAllocate(sizeof(KlassNode));
if (node == NULL) {
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"KlassNode");
}
error = classSignature(klass, &(node->signature), NULL);
if (error != JVMTI_ERROR_NONE) {
jvmtiDeallocate(node);
EXIT_ERROR(error,"signature");
}
error = JVMTI_FUNC_PTR(trackingEnv, SetTag)(env, klass, ptr_to_jlong(signature));
if (error != JVMTI_ERROR_NONE) {
jvmtiDeallocate(signature);
EXIT_ERROR(error,"SetTag");
if ((node->klass = JNI_FUNC_PTR(env,NewWeakGlobalRef)(env, klass)) == NULL) {
jvmtiDeallocate(node->signature);
jvmtiDeallocate(node);
EXIT_ERROR(AGENT_ERROR_NULL_POINTER,"NewWeakGlobalRef");
}
}
static jboolean
setupEvents()
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_object_free_events = 1;
jvmtiError error = JVMTI_FUNC_PTR(trackingEnv, AddCapabilities)(trackingEnv, &caps);
if (error != JVMTI_ERROR_NONE) {
return JNI_FALSE;
}
jvmtiEventCallbacks cb;
memset(&cb, 0, sizeof(cb));
cb.ObjectFree = cbTrackingObjectFree;
error = JVMTI_FUNC_PTR(trackingEnv, SetEventCallbacks)(trackingEnv, &cb, sizeof(cb));
if (error != JVMTI_ERROR_NONE) {
return JNI_FALSE;
}
error = JVMTI_FUNC_PTR(trackingEnv, SetEventNotificationMode)(trackingEnv, JVMTI_ENABLE, JVMTI_EVENT_OBJECT_FREE, NULL);
if (error != JVMTI_ERROR_NONE) {
return JNI_FALSE;
}
return JNI_TRUE;
/* Insert the new node */
node->next = *head;
*head = node;
}
/*
* Called once to initialize class-tracking.
* Called once to build the initial prepared class hash table.
*/
void
classTrack_initialize(JNIEnv *env)
{
deletedSignatures = NULL;
classTrackLock = debugMonitorCreate("Deleted class tag lock");
trackingEnv = getSpecialJvmti();
if (trackingEnv == NULL) {
EXIT_ERROR(AGENT_ERROR_INTERNAL, "Failed to allocate tag-tracking jvmtiEnv");
}
WITH_LOCAL_REFS(env, 1) {
jint classCount;
jclass *classes;
jvmtiError error;
jint i;
if (!setupEvents()) {
EXIT_ERROR(AGENT_ERROR_INTERNAL, "Unable to setup ObjectFree tracking");
}
error = allLoadedClasses(&classes, &classCount);
if ( error == JVMTI_ERROR_NONE ) {
table = jvmtiAllocate(CT_HASH_SLOT_COUNT * sizeof(KlassNode *));
if (table != NULL) {
(void)memset(table, 0, CT_HASH_SLOT_COUNT * sizeof(KlassNode *));
for (i=0; i<classCount; i++) {
jclass klass = classes[i];
jint status;
jint wanted =
(JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY);
jint classCount;
jclass *classes;
jvmtiError error;
jint i;
error = allLoadedClasses(&classes, &classCount);
if ( error == JVMTI_ERROR_NONE ) {
for (i = 0; i < classCount; i++) {
jclass klass = classes[i];
jint status;
jint wanted = JVMTI_CLASS_STATUS_PREPARED | JVMTI_CLASS_STATUS_ARRAY;
status = classStatus(klass);
if ((status & wanted) != 0) {
classTrack_addPreparedClass(env, klass);
/* We only want prepared classes and arrays */
status = classStatus(klass);
if ( (status & wanted) != 0 ) {
classTrack_addPreparedClass(env, klass);
}
}
} else {
jvmtiDeallocate(classes);
EXIT_ERROR(AGENT_ERROR_OUT_OF_MEMORY,"KlassNode");
}
jvmtiDeallocate(classes);
} else {
EXIT_ERROR(error,"loaded classes array");
}
jvmtiDeallocate(classes);
} else {
EXIT_ERROR(error,"loaded classes array");
}
} END_WITH_LOCAL_REFS(env)
}
/*
* Called to activate class-tracking when a listener registers for EI_GC_FINISH.
*/
void
classTrack_activate(JNIEnv *env)
{
debugMonitorEnter(classTrackLock);
deletedSignatures = bagCreateBag(sizeof(char*), 1000);
debugMonitorExit(classTrackLock);
}
static jboolean
cleanDeleted(void *signatureVoid, void *arg)
{
char* sig = *(char**)signatureVoid;
jvmtiDeallocate(sig);
return JNI_TRUE;
}
/*
* Called when agent detaches.
*/
void
classTrack_reset(void)
{
debugMonitorEnter(classTrackLock);
if (deletedSignatures != NULL) {
bagEnumerateOver(deletedSignatures, cleanDeleted, NULL);
bagDestroyBag(deletedSignatures);
deletedSignatures = NULL;
}
debugMonitorExit(classTrackLock);
}
}

View File

@@ -45,12 +45,6 @@ classTrack_addPreparedClass(JNIEnv *env, jclass klass);
void
classTrack_initialize(JNIEnv *env);
/*
* Activates class tracking.
*/
void
classTrack_activate(JNIEnv *env);
/*
* Reset class tracking.
*/

View File

@@ -1625,9 +1625,6 @@ installHandler(HandlerNode *node,
node->handlerID = external? ++requestIdCounter : 0;
error = eventFilterRestricted_install(node);
if (node->ei == EI_GC_FINISH) {
classTrack_activate(getEnv());
}
if (error == JVMTI_ERROR_NONE) {
insert(getHandlerChain(node->ei), node);
}

View File

@@ -1742,7 +1742,7 @@ isMethodObsolete(jmethodID method)
}
/* Get the jvmti environment to be used with tags */
jvmtiEnv *
static jvmtiEnv *
getSpecialJvmti(void)
{
jvmtiEnv *jvmti;

View File

@@ -414,6 +414,4 @@ void createLocalRefSpace(JNIEnv *env, jint capacity);
void saveGlobalRef(JNIEnv *env, jobject obj, jobject *pobj);
void tossGlobalRef(JNIEnv *env, jobject *pobj);
jvmtiEnv* getSpecialJvmti(void);
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2013, 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
@@ -28,14 +28,8 @@
* @run main SystemBgColorTest
*/
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.SystemColor;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
import java.awt.*;
import java.awt.image.*;
public class SystemBgColorTest {
public static final int TESTW = 10;
@@ -115,20 +109,12 @@ public class SystemBgColorTest {
}
public static void test(Image src, BufferedImage dst, Color bg) {
Graphics2D g = (Graphics2D) dst.getGraphics();
g.setComposite(AlphaComposite.Src);
Graphics g = dst.getGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, TESTW, TESTH);
g.drawImage(src, 0, 0, bg, null);
int dstRGB = dst.getRGB(0, 0);
int bgRGB = bg.getRGB();
if (!dst.getColorModel().hasAlpha()) {
bgRGB |= 0xFF000000;
}
if (dstRGB != bgRGB) {
System.err.println("Actual: " + Integer.toHexString(dstRGB));
System.err.println("Expected: " + Integer.toHexString(bgRGB));
error("bad bg pixel for: " + bg);
if (dst.getRGB(0, 0) != bg.getRGB()) {
error("bad bg pixel for: "+bg);
}
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 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
@@ -21,7 +21,6 @@
* questions.
*/
import java.awt.AWTException;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
@@ -32,21 +31,15 @@ import java.awt.Robot;
/**
* @test
* @key headful
* @bug 8201364 8232433
* @bug 8201364
* @summary Component.getLocation() should returns correct location if
* Component.setBounds() was ignored by the OS
*/
public final class LocationAtScreenCorner {
public static void main(final String[] args) throws Exception {
test(true);
test(false);
}
private static void test(final boolean undecorated) throws AWTException {
Robot robot = new Robot();
Frame frame = new Frame();
frame.setUndecorated(undecorated);
frame.setSize(200, 200);
frame.setLocationRelativeTo(null);
frame.setVisible(true);

View File

@@ -1,46 +0,0 @@
/*
* Copyright 2000-2020 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import javax.swing.*;
import java.awt.*;
/**
* @test
* @summary Regression test for JBR-2210 (JVM crashes on Windows with Japanese locale and UTF-8 enconding)
* @run main/othervm -Duser.language=ja -Duser.region=JP -Dfile.encoding=UTF-8 JapaneseLocaleTest
*/
/*
* Description:
* Test checks that the JVM does not crash on with Japanese locale and UTF-8 enconding by JFrame creation.
*/
public class JapaneseLocaleTest {
private static JFrame frame;
public static void main(String[] args) throws Exception{
try {
EventQueue.invokeAndWait(JapaneseLocaleTest::initFrame);
}
finally {
EventQueue.invokeAndWait(() ->frame.dispose());
}
}
private static void initFrame(){
frame = new JFrame();
frame.setVisible(true);
}
}

View File

@@ -166,7 +166,7 @@ class DragSourceFrame extends JFrame implements DragGestureListener {
void initUI() {
this.setLocation(0, 0);
JPanel contentPane = new JPanel(null);
contentPane.setPreferredSize(new Dimension(50, 50));
contentPane.setPreferredSize(new Dimension(100, 100));
sourcePanel = new JPanel() {
@Override
@@ -174,10 +174,10 @@ class DragSourceFrame extends JFrame implements DragGestureListener {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setColor(this.getBackground());
g2.fillRect(0, 0, 50, 50);
g2.fillRect(0, 0, 100, 100);
}
};
sourcePanel.setBounds(0, 0, 50,50);
sourcePanel.setBounds(0, 0, 100, 100);
sourcePanel.setEnabled(true);
sourcePanel.setBackground(Color.white);
@@ -291,7 +291,7 @@ class DropTargetFrame extends JFrame {
void initUI(Point frameLocation) {
this.setLocation(frameLocation);
JPanel contentPane = new JPanel(null);
contentPane.setPreferredSize(new Dimension(200,200));
contentPane.setPreferredSize(new Dimension(400, 400));
dtPanel = new JPanel() {
@Override
@@ -299,11 +299,11 @@ class DropTargetFrame extends JFrame {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setColor(this.getBackground());
g2.fillRect(0, 0, 100,100);
g2.fillRect(0, 0, 200, 200);
}
};
dtPanel.setBounds(50,50, 100, 100);
dtPanel.setBounds(100, 100, 200, 200);
dtPanel.setEnabled(true);
dtPanel.setBackground(Color.white);
dtPanel.setDropTarget(new DropTarget(dtPanel, DnDConstants.ACTION_COPY_OR_MOVE, new DropTargetAdapter() {

View File

@@ -71,19 +71,19 @@ public abstract class JBCefApp {
@Override
protected String[] applyPlatformSettings(CefSettings settings) {
String ALT_CEF_FRAMEWORK_DIR = System.getenv("ALT_CEF_FRAMEWORK_DIR");
String ALT_CEF_BROWSER_SUBPROCESS = System.getenv("ALT_CEF_BROWSER_SUBPROCESS");
if (ALT_CEF_FRAMEWORK_DIR == null || ALT_CEF_BROWSER_SUBPROCESS == null) {
String ALT_CEF_HELPER_DIR = System.getenv("ALT_CEF_HELPER_DIR");
if (ALT_CEF_FRAMEWORK_DIR == null || ALT_CEF_HELPER_DIR == null) {
String CONTENTS_PATH = System.getProperty("java.home") + "/..";
if (ALT_CEF_FRAMEWORK_DIR == null) {
ALT_CEF_FRAMEWORK_DIR = CONTENTS_PATH + "/Frameworks/Chromium Embedded Framework.framework";
}
if (ALT_CEF_BROWSER_SUBPROCESS == null) {
ALT_CEF_BROWSER_SUBPROCESS = CONTENTS_PATH + "/Helpers/jcef Helper.app/Contents/MacOS/jcef Helper";
if (ALT_CEF_HELPER_DIR == null) {
ALT_CEF_HELPER_DIR = CONTENTS_PATH + "/Helpers";
}
}
return new String[] {
"--framework-dir-path=" + normalize(ALT_CEF_FRAMEWORK_DIR),
"--browser-subprocess-path=" + normalize(ALT_CEF_BROWSER_SUBPROCESS),
"--browser-subprocess-path=" + normalize(ALT_CEF_HELPER_DIR) + "/jcef Helper.app/Contents/MacOS/jcef Helper",
"--disable-in-process-stack-traces"
};
}

View File

@@ -1,97 +0,0 @@
/*
* Copyright 2000-2020 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import static java.awt.event.KeyEvent.VK_A;
/**
* @test
* @summary Tests that height of JEditorPane with zero margins on top and bottom is update when text is set
* @run main/othervm ZeroMargin
*/
public class ZeroMargin implements Runnable {
private JFrame f;
private JEditorPane htmlPane;
private JEditorPane rtfPane;
private JEditorPane plainPane;
public static void main(String[] args) throws Exception {
ZeroMargin test = new ZeroMargin();
try {
var r = new Robot();
SwingUtilities.invokeAndWait(test);
r.waitForIdle();
r.keyPress(VK_A);
r.delay(500);
if (test.htmlPane.getHeight() == 0) {
throw new RuntimeException("Error: Height of JEditorPane with text/html type did not update");
}
if (test.rtfPane.getHeight() == 0) {
throw new RuntimeException("Error: Height of JEditorPane with text/rtf type did not update");
}
if (test.plainPane.getHeight() == 0) {
throw new RuntimeException("Error: Height of JEditorPane with text/plain type did not update");
}
} finally {
SwingUtilities.invokeAndWait(() ->test.f.dispose());
}
}
private void initEditorPane(JEditorPane pane, KeyAdapter adapter) {
pane.setEditable(false);
pane.setOpaque(false);
pane.setMargin(new Insets(0, 0, 0, 0));
pane.addKeyListener(adapter);
}
@Override
public void run() {
f = new JFrame();
htmlPane = new JEditorPane("text/html", "");
rtfPane = new JEditorPane("text/rtf", "");
plainPane = new JEditorPane("text/plain", "");
KeyAdapter adapter = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
super.keyPressed(e);
if (e.getKeyCode() == VK_A) {
htmlPane.setText("<html><body>html string</body></html>");
rtfPane.setText("{\\rtf1 rtf string}");
plainPane.setText("plain string");
}
}
};
initEditorPane(htmlPane, adapter);
initEditorPane(rtfPane, adapter);
initEditorPane(plainPane, adapter);
f.add(htmlPane, BorderLayout.NORTH);
f.add(rtfPane, BorderLayout.CENTER);
f.add(plainPane, BorderLayout.SOUTH);
f.setSize(300, 200);
f.setVisible(true);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}

View File

@@ -219,7 +219,6 @@ java/awt/Graphics/CopyScaledArea/CopyScaledAreaTest.java
java/awt/Graphics/LineClipTest.java JRE-898 macosx-all
java/awt/Graphics2D/CopyAreaOOB.java 7001973 windows-all,macosx-all,linux-all
java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8197796 generic-all
java/awt/Graphics2D/DrawString/LCDTextSrcEa.java 8223543 generic-all
java/awt/Graphics2D/DrawString/RotTransText.java 8197797 generic-all
java/awt/Graphics2D/DrawString/TextRenderingTest.java 8169464 windows-all
java/awt/Graphics2D/FillTexturePaint/FillTexturePaint.java 8169463 windows-all
@@ -551,7 +550,7 @@ java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all,windows-all,linux-all
java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170 macosx-all,windows-all
java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.html 8148041 linux-all
java/awt/MouseInfo/GetPointerInfoTest.java 8130741 macosx-all
java/awt/MouseInfo/GetPointerInfoTest.java 8158798 windows-all
java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java 7124230 generic-all
java/awt/Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java 8155744 windows-all,linux-all
java/awt/Multiscreen/WindowGCChangeTest/WindowGCChangeTest.html 8168132 macosx-all,linux-all
@@ -824,7 +823,6 @@ com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
# jdk_security
sun/security/lib/cacerts/VerifyCACerts.java 8240268 generic-all
sun/security/pkcs11/ec/TestKeyFactory.java 8026976 generic-all
sun/security/pkcs11/Secmod/AddTrustedCert.java 8180837 generic-all
sun/security/pkcs11/tls/TestKeyMaterial.java 8180837 generic-all
@@ -904,7 +902,7 @@ javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.j
javax/swing/JFrame/8016356/bug8016356.java 8169955 windows-all
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all
javax/swing/JInternalFrame/5066752/bug5066752.java 8207850 macosx-all,windows-all
javax/swing/JInternalFrame/8020708/bug8020708.java 8226230 linux-all,windows-all
javax/swing/JInternalFrame/8020708/bug8020708.java 8226230 linux-all
javax/swing/JInternalFrame/8069348/bug8069348.java 8208570 macosx-all,windows-all,linux-all
javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java 8203918 windows-all,linux-all
javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 8194944 macosx-all,windows-all,linux-all
@@ -1010,7 +1008,7 @@ javax/swing/UIDefaults/8133926/InternalFrameIcon.java
javax/swing/UIDefaults/8149879/InternalResourceBundle.java 8199054 windows-all
javax/swing/UITest/UITest.java 8198392 generic-all
javax/swing/border/Test6981576.java 8198339 generic-all
javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all,windows-all,linux-all
javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all,windows-all
javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765 macosx-all,linux-all
javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java 8198394 generic-all
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8194945 macosx-all,linux-all,windows-all
@@ -1251,5 +1249,5 @@ javax/swing/LookAndFeel/8145547/DemandGTK.java
javax/swing/LookAndFeel/8146276/NimbusGlueTest.java JBR-1977 linux-aarch64
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java JBR-1977 linux-aarch64
jb/java/jcef/JCEFStartupTest.java JBR-1996 linux-i386,windows-x86
jb/java/jcef/JCEFStartupTest.java JBR-1996,JBR-2094 macosx-all,linux-i386,windows-x86
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTest.java nobug windows-6.1 not supported on Windows 7