Compare commits

..

412 Commits

Author SHA1 Message Date
Alexey Ushakov
396b5c6e35 Merge branch 'new_fonts' of github.com:/JetBrains/JetBrainsRuntime into new_fonts 2019-10-18 20:19:32 +03:00
Alexey Ushakov
0a99632956 JBR-1925 JetBrainsMono fonts update to v0.20
Updated the fonts to v0.20
2019-10-18 20:11:22 +03:00
Alexey Ushakov
89797f94c9 JBR-1925 JetBrainsMono fonts update to v0.20
Updated the fonts to v0.20
2019-10-18 20:02:54 +03:00
Vitaly Provodin
90a36251b6 JBR-1821: Notarize JBR bundles as a standalone app (follow up) 2019-10-18 20:23:59 +07:00
Kirill Kirichenko
5a29d4ade9 JBR-1874 Cursor not changing from 'default' to 'text'. Additional fix after reopening. 2019-10-18 10:43:30 +03:00
Alexey Ushakov
a0b235eb24 Revert "JBR-1756 use CoreText for all font rendering on Catalina"
This reverts commit acdc0ea3
2019-10-17 20:16:16 +03:00
Alexey Ushakov
20546081aa Revert "JBR-1863, JBR-1868 correct advances on Catalina"
This reverts commit d5868e8f
2019-10-17 20:16:16 +03:00
Elena Sayapina
b99c1e7b5c JBR-1417 Regression test update, fixed focus issue on a certain TC agents by adding frame.toFront() 2019-10-16 19:42:25 +07:00
Vitaly Provodin
aebc0cdb79 JBR-1821: Notarize JBR bundles as a standalone app 2019-10-16 17:05:06 +07:00
Elena Sayapina
d757108517 JBR-1417 Regression test update, additional focus check was added 2019-10-16 13:20:11 +07:00
Elena Sayapina
6ea9530d9f JBR-1417 Regression test update, fixed test compilation, added missed import 2019-10-16 12:22:27 +07:00
Elena Sayapina
9fe5c778d9 JBR-1417 Regression test update, made fail check more straightforward 2019-10-15 19:09:57 +07:00
Konstantin Bulenkov
529d5c8bcc Remove JetBrains Mono Italic until UX-973 is fixed 2019-10-12 14:57:33 +03:00
Vitaly Provodin
9331ecada6 updated JTreg exclude list 2019-10-11 18:17:55 +07:00
Vitaly Provodin
8781991e67 updated JTreg exclude list 2019-10-11 18:17:00 +07:00
Eugene Petrenko
7a24f5a493 project setup improvements
git ignore .idea and cmake build folders folder under /jb
make configure script unix executable to support ./configure runs
add section for building on macOS
2019-10-10 12:24:41 +02:00
Eugene Petrenko
82dcb03358 cds - add more logging to -Xshare:dump errors
log exception along with "Preload Warning: Verification failed" warning messages
advanced debug logging to diagnose listed class was not defined error from -Xshare:dump
more detailed error logging from the Xshare:dump phase
2019-10-10 12:24:41 +02:00
Eugene Petrenko
691e7d46ed Support AppCDS on Windows via a variation of the older JDK fix 8185145
8185145: AppCDS custom loader support on Mac OS X
2019-10-10 12:24:41 +02:00
Calvin Cheung
51ec616d23 8185145: AppCDS custom loader support on Mac OS X
Reviewed-by: dholmes, gziemski
2019-10-10 12:24:41 +02:00
Vitaly Provodin
b3a41ba6d9 updated JTreg exclude list 2019-10-10 09:09:50 +07:00
Vitaly Provodin
2fb4c904ab Revert "cds - log exception along with "Preload Warning: Verification failed" warning messages"
This reverts commit c3839647
2019-10-05 10:43:18 +07:00
Vitaly Provodin
ab1e8dc136 Revert "add section for building on macOS"
This reverts commit 6b7ccbdc
2019-10-05 10:43:09 +07:00
Vitaly Provodin
e480592b39 Revert "cds - advanced debug logging to diagnose listed class was not defined error from -Xshare:dump"
This reverts commit 48478ca6
2019-10-05 10:43:00 +07:00
Vitaly Provodin
99dae8d59e Revert "cds - more detailed error logging from the Xshare:dump phase"
This reverts commit b74750d8
2019-10-05 10:42:51 +07:00
Vitaly Provodin
2e672f6c2f updated JTreg exclude list 2019-10-05 06:35:26 +07:00
Vitaly Provodin
a31ba4ca30 Merge remote-tracking branch 'origin/master' 2019-10-05 06:35:19 +07:00
Alexey Ushakov
1e900726f9 JBR-1721 Cant open project on macOS 10.15
Removed workaround for early Catalina betas
2019-10-04 13:58:57 +03:00
Dmitry Batrak
6f60cad1a9 JBR-1879 Wrong symbols in evaluate expression dialog
add clarifying comment to code
2019-10-03 11:57:33 +03:00
Eugene Petrenko
b74750d845 cds - more detailed error logging from the Xshare:dump phase 2019-10-03 11:35:49 +07:00
Eugene Petrenko
48478ca6e2 cds - advanced debug logging to diagnose listed class was not defined error from -Xshare:dump 2019-10-03 11:35:48 +07:00
Eugene Petrenko
6b7ccbdccc add section for building on macOS 2019-10-03 11:35:48 +07:00
Eugene Petrenko
c3839647c6 cds - log exception along with "Preload Warning: Verification failed" warning messages 2019-10-03 11:35:47 +07:00
Alexey Ushakov
a7b4c9449a JBR-1885 JetBrainsMono fonts update to v0.19
Updated the fonts to v0.19. Bundled italic fonts
2019-10-01 22:52:11 +03:00
Vitaly Provodin
380c17456c moving test/jdk/jb/java/awt/font/TextLayout to test/jdk/jb/java/awt/Font/TextLayout 2019-10-01 10:06:39 +07:00
Dmitry Batrak
ba7496606d JBR-1879 Wrong symbols in evaluate expression dialog
a better check that font used by GDI matches the font used by JRE
2019-09-30 14:47:16 +03:00
Dmitry Batrak
1ee493a1f9 JBR-1879 Wrong symbols in evaluate expression dialog
rollback fix for JBR-1777
2019-09-30 14:46:51 +03:00
Dmitry Batrak
fc25d3598c test case for JBR-1875 2019-09-27 15:11:32 +03:00
Dmitry Batrak
598452f079 JBR-1875 Modal dialogs text partly lost
This reverts JBR-1838 (Backport fix for JDK-8226513 from OpenJDK)
2019-09-27 15:11:00 +03:00
Vitaly Provodin
c49e042535 updated JTreg exclude list 2019-09-27 08:34:44 +07:00
Alexey Ushakov
94a4eb7002 JBR-1874 Cursor not changing from 'default' to 'text'
Prevent OS from changing cursor
2019-09-26 12:58:52 +03:00
Alexey Ushakov
fa160d2d7d JBR-1872 Backport JDK-8217731 Font rendering and glyph spacing has changed from jdk-8 to jdk-11
The fix backported with some minor modifications
2019-09-25 17:42:50 +03:00
Vitaly Provodin
c0397fbade updated JTreg exclude list 2019-09-25 16:51:32 +07:00
Dennis Ushakov
d5868e8fe1 JBR-1863, JBR-1868 correct advances on Catalina 2019-09-24 19:56:24 +03:00
Dennis Ushakov
e40bb508e3 JBR-1850: on macOS fonts should be sorted by weight to ensure proper population of the families 2019-09-24 18:48:51 +03:00
Denis Konoplev
c92af06680 Fix package name 2019-09-24 18:01:45 +03:00
Vitaly Provodin
178708f1cb updated JTreg exclude list 2019-09-23 16:49:54 +07:00
Vitaly Provodin
2e2cae243c updated JTreg exclude list 2019-09-20 17:09:23 +07:00
Vitaly Provodin
7a2a7986be updated JTreg exclude list 2019-09-20 14:09:41 +07:00
Artem Bochkarev
5839539379 JBR-1851: check NSArray length
and make more exception-safe
and minor optimization for logging (cache jobjects)
2019-09-17 18:28:32 +03:00
Vitaly Provodin
1b04112158 updated JTreg exclude list 2019-09-17 10:35:38 +07:00
Denis Fokin
a5dcce7541 JBR-1844 Settings window header color is not changed when switching and applying a theme 2019-09-16 12:54:00 +03:00
Vitaly Provodin
976c97f409 updated JTreg exclude list 2019-09-16 15:50:50 +07:00
Vitaly Provodin
4ef573bfb7 updated JTreg exclude list 2019-09-14 06:19:23 +07:00
Artem Bochkarev
0efbe5d9b9 JBR-1762: fixed review comments 2019-09-13 18:54:55 +03:00
Artem Bochkarev
7a2ccfc521 JBR-1762: request focus of immediate parent when dispose popup
because requesting focus for frame-parent causes to close whole popup chain
2019-09-13 18:54:49 +03:00
Artem Bochkarev
969255904b JBR-1841: allow deferred disabling of InputMethods-support 2019-09-13 16:05:01 +03:00
Vitaly Provodin
27d2f21f65 updated JTreg exclude list 2019-09-12 14:41:54 +07:00
Alexey Ushakov
7f032e3fe7 JBR-1840 Update new fonts up to v0.18
Updated new fonts
2019-09-12 00:48:40 +03:00
Dmitry Batrak
6b50fc8871 IDEA-222435 Backport fix for JDK-8226513 from OpenJDK
apply fix from OpenJDK
2019-09-11 11:36:27 +03:00
Dmitry Batrak
81d989b511 IDEA-222435 Backport fix for JDK-8226513 from OpenJDK
revert fixes for JBR-934 and JBR-1604
2019-09-11 11:34:39 +03:00
Dennis Ushakov
acdc0ea38e JBR-1756 use CoreText for all font rendering on Catalina 2019-09-10 10:46:32 +03:00
Artem Bochkarev
4cd8e27964 JBR-1788: use old codepath of CFileDialog (with completionHandler) when running under mojave (or previous)
fixed JBR-1788: File Chooser on Mac is in the center of the screen
2019-09-09 19:51:01 +03:00
Artem Bochkarev
8445f53d85 JBR-1668: add hardcoded default values for preferences node NSServicesStatus 2019-09-09 19:09:49 +03:00
Anton Tarasov
eaa04303a7 JBR-1834 [linux] runtime hidpi switch is broken 2019-09-09 17:29:44 +03:00
Vitaly Provodin
29c8d3fecf updated JTreg exclude list 2019-09-06 14:48:30 +07:00
Elena Sayapina
41e89505be JBR-1417 Added new regression test (JBR 11 does not support chain of popups) 2019-09-05 17:56:56 +07:00
Artem Bochkarev
30d479fbd4 JBR-1515: obtain shortcut from OS to check inside AWTView.performKeyEquivalent 2019-09-05 13:06:30 +03:00
Anton Tarasov
4399dc382c JBR-1824 export NSWindow::setIgnoresMouseEvents to java internal API 2019-09-05 12:56:32 +03:00
Alexey Ushakov
e21bc70e8f JBR-1756 San Francisco rendering is broken on Catalina
Added performance test with random glyphs
2019-09-04 15:59:32 +03:00
Vitaly Provodin
08ea095216 updated JTreg exclude list 2019-09-04 16:34:27 +07:00
Dmitry Batrak
7884d54f48 JBR-1777 Wrong glyphs are rendered for Roboto font
refactoring following JR-CR-483
2019-09-04 09:43:35 +03:00
Konstantin Bulenkov
483234fe7d Revert "Update JetBrains Mono to 0.17"
This reverts commit 0fb5c9ed
2019-09-02 16:27:35 +02:00
Dmitry Batrak
6790353282 JBR-1805 Hard to read font rendering for Courier New
updating fix for JBR-1777
2019-09-02 12:15:55 +03:00
Konstantin Bulenkov
0fb5c9ed61 Update JetBrains Mono to 0.17 2019-08-30 15:52:11 +03:00
Vitaly Provodin
5a63351d2a updated JTreg exclude list 2019-08-30 16:44:58 +07:00
Anton Tarasov
eae772aca9 JBR-1802 com/sun/java/accessibility/util/8051626/Bug8051626.java: access denied ("java.lang.RuntimePermission" "getClassLoader") 2019-08-30 12:13:54 +03:00
Vitaly Provodin
b3c4cc9e52 updated JTreg exclude list 2019-08-30 10:10:28 +07:00
Sergey Malenkov
57e46e5dcd Rollback to d4b529ad49 2019-08-29 23:02:04 +03:00
Sergey Malenkov
ba69b0d47d Revert all attempts to fix JBR-1076 2019-08-29 20:59:47 +03:00
Dmitry Batrak
e1c6172e9a JBR-1777 Wrong glyphs are rendered for Roboto font 2019-08-28 17:06:25 +03:00
Anton Tarasov
322526458a JBR-1795 Project opened from Welcome screen goes to backgound after loading 2019-08-27 22:41:19 +03:00
Anton Tarasov
8ae0be8eb6 JBR-1609 Jupyter Notebook eventually causes IDEA to become unresponsive on Mac OSX 2019-08-26 17:24:33 +03:00
Anton Tarasov
4b09614a0e JBR-1786 Weird white border for IDE window 2019-08-26 16:52:15 +03:00
Alexey Ushakov
08ae9ff034 JBR-1778 Font in editor incorrect (always italics)
More unique patterns for 'Anka/Coder'
2019-08-26 16:40:47 +03:00
Alexey Ushakov
251068294e JBR-1778 Font in editor incorrect (always italics)
'Anka/Coder' font support
2019-08-26 15:56:25 +03:00
Denis Fokin
cce5c34181 Exports break windows build because lack of packages 2019-08-26 13:53:51 +03:00
Alexey Ushakov
ec241e4a0a JBR-1778 Font in editor incorrect (always italics)
Added some more patterns to bold and italic detection code
2019-08-23 15:12:07 +03:00
Denis Fokin
f42e6bb30b JBR-1784 File dialogs aren't themed on macOS 2019-08-23 14:39:57 +03:00
Denis Fokin
b3dacc9146 JBR-1779 Can't assign and use Force Touch in 2019.1 2019-08-23 12:55:18 +03:00
Denis Fokin
a2059db21b Export eawt packages 2019-08-23 12:55:18 +03:00
Alexey Ushakov
5119eeee12 JBR-1778 Font in editor incorrect (always italics)
Added -it pattern into italic detection code
2019-08-22 18:59:59 +03:00
Anton Tarasov
d9dfc3c6c5 JBR-1770 [windows] frame does not open as maximized 2019-08-21 14:42:38 +03:00
Artem Bochkarev
1acada7cac JBR-1771: fixed compilation errors (macosx-x86_64-normal-server-fastdebug) 2019-08-21 09:50:38 +03:00
Artem Bochkarev
ec9bd95bfe JBR-1721: don't use completion handler to obtain results from NSOpenPanel
it doesn't invoked in catalina, move handler's logic just after runModal
2019-08-20 17:19:21 +03:00
Dmitry Batrak
5d35e72065 JBR-1761 Printing a comment block in landscape mode results in oddly rotated italic letters 2019-08-20 11:49:58 +03:00
Artem Bochkarev
cf7d535b03 Merge branch 'system_hotkeys' 2019-08-19 18:41:57 +03:00
Egor Ushakov
c959b23697 JBR-1655 Disable "WARNING: An illegal reflective access operation has occurred" - use property jdk.module.illegalAccess.silent 2019-08-16 14:46:55 +03:00
Vitaly Provodin
bdd644eaac updated JTreg exclude list 2019-08-16 09:45:52 +07:00
Dennis Ushakov
d45a8d2113 faster font family loading & lazy font family population
1. NSFont.familyName is faster than loading allFamilyNames
2. Prebuilt list of system fonts
3. Cleanup San Francisco family loading
4. Avoid calling expensive native getWidth on font when creating font family, load styles only when they would be used.
2019-08-15 15:22:19 +03:00
Artem Bochkarev
15f7368309 JBR-1668: add hardcoded descriptions of system actions
and minor fixes

fix memory management
2019-08-14 20:39:34 +03:00
Alexey Ushakov
aa13c8b4ea JBR-1690 Bundle new fonts
Test correction
2019-08-13 15:56:12 +03:00
Alexey Ushakov
83843f9124 JBR-1690 Bundle new fonts
Removed excessive fonts
2019-08-13 14:51:44 +03:00
Alexey Ushakov
ed806bf652 Revert "8194873: right ALT key hotkeys no longer work in Swing components Reviewed-by: serb, psadhukhan"
This reverts commit 05e1a1b2
2019-08-11 13:43:52 +03:00
Alexey Ushakov
56b69b2813 Reverted fix of JDK-8041928: MouseEvent.getModifiersEx gives wrong result because it breaks AltGr shortcuts 2019-08-11 13:43:52 +03:00
Denis Fokin
da03ef94f8 JBR-448 Keyboard shortcuts do not work the same way on different layouts (mac) 2019-08-09 13:49:44 +03:00
Alexey Ushakov
76abb69262 JBR-1690 Bundle new fonts
Update family name for JetBrainsMono-Thin
2019-08-08 17:37:38 +03:00
Alexey Ushakov
2a2e1cfb36 JBR-1690 Bundle new fonts
Updated bundled fonts
2019-08-07 12:35:59 +03:00
Anton Tarasov
12de3e287e JBR-1693 difficult to input Japanese text with "Fast" Key Repeat 2019-08-02 20:17:58 +03:00
Dmitry Batrak
9cc5cbc99b JBR-1714 Italic text is displayed using incorrect glyphs on Windows
improved fix - it keeps generating synthetic italic for system fonts which exist in plain variant only
2019-08-02 17:15:11 +03:00
Dmitry Batrak
46e4cdfcbd JBR-1714 Italic text is displayed using incorrect glyphs on Windows 2019-08-02 15:30:23 +03:00
Vitaly Provodin
897a8fc34e updated JTreg exclude list 2019-08-02 11:30:51 +07:00
Denis Fokin
52405e5dfa JBR-1712 java/awt/Frame/NormalToIconified/NormalToIconifiedTest.java: Frame is not in ICONIFIED state 2019-08-01 12:24:48 +03:00
Alexey Ushakov
bcae402dc8 JBR-1699 Use platform font rendering for bundled fonts on MacOS
Removed unnecessary method
2019-07-31 17:09:36 +02:00
Alexey Ushakov
c423003bd4 JBR-1699 Use platform font rendering for bundled fonts on MacOS
Use different family for specific font faces. Refactoring
2019-07-31 13:18:47 +02:00
Artem Bochkarev
9dbcf194c9 JBR-1668: minor fixes
fixed review comments
2019-07-31 13:54:03 +03:00
Vitaly Provodin
7b27b1b042 updated JTreg exclude list 2019-07-31 14:43:33 +07:00
Vitaly Provodin
7911ed796c updated JTreg exclude list 2019-07-30 17:59:52 +07:00
Alexey Ushakov
df8927dbb7 JBR-1702 Update to 11.0.4 openjdk sourcebase
Added info about docker image name
2019-07-30 11:33:59 +02:00
Alexey Ushakov
a86bde7a19 JBR-1702 Update to 11.0.4 openjdk sourcebase
Updated docker image build script
2019-07-30 11:26:10 +02:00
Anton Tarasov
2ea40c8d84 JBR-1429 [followup] Scale is huge due to GDK_SCALE 2019-07-29 21:46:16 +03:00
Alexey Ushakov
a159468873 Updated gradle script to run unit tests with updated JBR 2019-07-29 18:05:40 +02:00
Alexey Ushakov
8c86ad3e96 JBR-1699 Use platform font rendering for bundled fonts on MacOS
Used CFont instead of TrueTypeFont for bundled fonts on mac
2019-07-29 18:05:40 +02:00
Anton Tarasov
1c3477df2e JBR-1429 Scale is huge due to GDK_SCALE 2019-07-29 19:01:05 +03:00
Denis Fokin
25ca06766f JBR-1696 Focus lost after "Add File to Git" dialog is shown 2019-07-29 12:10:20 +03:00
Alexey Ushakov
42d83e8388 Merge pull request #8 from bell-sw/update_11.0.4
Update 11.0.4
2019-07-29 10:53:05 +02:00
Vitaly Provodin
e4a3889cf0 JBR-1618: fixed misprint, added saving screenshots in case of failure 2019-07-29 14:28:06 +07:00
Vitaly Provodin
2b0ad27393 updated JTreg exclude list 2019-07-29 14:14:53 +07:00
Alexey Ushakov
0d2326ff34 JBR-1690 Bundle new fonts 2019-07-28 23:47:07 +02:00
Alexey Ushakov
114b8af38f JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Corrected lookup for bold fonts
2019-07-28 23:47:07 +02:00
Alexey Ushakov
62f9d1f46a JBR-1645 javax/swing/JTextArea/TestTabSize.java: Tab width calculation wrong
Corrected idea font filter
2019-07-28 23:09:31 +02:00
Dmitry Batrak
0429e74e9d JBR-1689 Incorrect painting of long strings on linux
correct operator precedence
2019-07-26 14:36:46 +03:00
Dmitry Batrak
e12c1d6f0d JBR-1689 Incorrect painting of long strings on linux 2019-07-25 15:50:46 +03:00
andrew
984ee6de6d Added tag jdk-11.0.4-ga for changeset 6a4d57474e1c 2019-07-24 18:24:03 +03:00
jnimeh
baa0bcc47b 8222678: Improve TLS negotiation
Reviewed-by: mullan, rhalade, mschoene
2019-07-24 18:21:10 +03:00
igerasim
a974a4bbf8 8221518: Normalize normalization
Reviewed-by: chegar, igerasim, ahgross, rhalade
2019-07-24 18:21:09 +03:00
jnimeh
f4ad93af52 8221345: Better Poly1305 support
Reviewed-by: apetcher, mschoene, rhalade
2019-07-24 18:21:08 +03:00
serb
1d5b16fd63 8220517: Enhanced GIF support
Reviewed-by: aivanov, ssahoo, mschoene, prr
2019-07-24 18:21:07 +03:00
jnimeh
40cfdce94b 8219775: Certificate validation improvements
Reviewed-by: ascarpino, ssahoo, skoivu
2019-07-24 18:21:06 +03:00
serb
1cccea91e9 8218876: Improve PNG support options
Reviewed-by: prr, rhalade, mschoene
2019-07-24 18:21:05 +03:00
xuelei
21a7269ceb 8218873: Improve JSSE endpoint checking
Reviewed-by: mullan, ahgross, rhalade
2019-07-24 18:21:04 +03:00
coffeys
58b8ccc854 8218863: Better endpoint checks
Reviewed-by: xuelei, ahgross, jnimeh, mullan, rhalade
2019-07-24 18:21:03 +03:00
igerasim
64566ca44c 8217563: Improve realm maintenance
Reviewed-by: mullan, mschoene, valeriep
2019-07-24 18:21:02 +03:00
mullan
de2d07fe1f 8216381: More limited privilege usage
Reviewed-by: ahgross, coffeys, rhalade
2019-07-24 18:21:00 +03:00
smarks
c65f663dcb 8213432: Better copies of CopiesList
Reviewed-by: rriggs, skoivu, ahgross, robm, rhalade, jeff
2019-07-24 18:20:59 +03:00
igerasim
da3730d6ce 8213431: Improve file protocol handling
Reviewed-by: chegar, dfuchs, igerasim, rhalade, weijun
2019-07-24 18:20:58 +03:00
igerasim
262d1ddf1f 8212328: Exceptional throw cases
Reviewed-by: smarks, rriggs, igerasim, ahgross, skoivu
2019-07-24 18:20:57 +03:00
naoto
1de7835d1d 8226876: Assertion in sun/util/locale/provider/CalendarDataUtility on Windows after JDK-8218960
Reviewed-by: clanger
2019-07-24 18:20:56 +03:00
clanger
677d4d3eb1 8226880: Backport of JDK-8208698 (Improved ECC Implementation) should not bring parts of JDK-8205476 (KeyAgreement#generateSecret is not reset for ECDH based algorithm)
Reviewed-by: andrew
2019-07-24 18:20:55 +03:00
mbaesken
a0d84192bb 8225402: events logging in deoptimization.cpp should go to deopt-log
Reviewed-by: mdoerr, stuefe, coleenp
2019-07-24 18:20:54 +03:00
mbaesken
8af0800269 8218811: replace open by os::open in hotspot coding
Reviewed-by: dholmes, iklam, stuefe
2019-07-24 18:20:53 +03:00
aph
869aabd8b2 8225716: G1 GC: Undefined behaviour in G1BlockOffsetTablePart::block_at_or_preceding
Reviewed-by: kbarrett, tschatzl
2019-07-24 18:20:52 +03:00
erikj
eaba1a6346 8222913: Add Jib support for VERSION_EXTRA*
Reviewed-by: tbell, mikael
2019-07-24 18:20:51 +03:00
fyang
7c16f77492 8224828: aarch64: rflags is not correct after safepoint poll
Reviewed-by: aph, adinn
Contributed-by: Xiang Yuan <yuanxiang4@huawei.com>
2019-07-24 18:20:50 +03:00
apetcher
5d9faf7c80 8208698: Improved ECC Implementation
Summary: New implementation of ECDH and ECDSA forsome prime-order curves
Reviewed-by: ascarpino
2019-07-24 18:20:49 +03:00
mgronlun
f2d4934d48 8220293: Deadlock in JFR string pool
Reviewed-by: rehn, egahlin
2019-07-24 18:20:48 +03:00
rraghavan
8b14351736 8202414: Unsafe write after primitive array creation may result in array length change
Summary: Avoided collecting unaligned stores in Initialize node by making can_capture_store return false for same
Reviewed-by: dlong, kvn, vlivanov
2019-07-24 18:20:47 +03:00
erikj
1c86964a86 8210837: Add libXrandr-devel to the Linux devkits
Reviewed-by: prr, mikael
2019-07-24 18:20:46 +03:00
jjiang
a959da2d69 8212562: To remove lib/security from test/jdk/TEST.groups
Summary: Remove lib/security from test group jdk_security3
Reviewed-by: coffeys
2019-07-24 18:20:45 +03:00
clanger
618061de22 8224727: Problem list test security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java
Reviewed-by: rhalade
2019-07-24 18:20:44 +03:00
rhalade
f904e0178e 8202651: Test ComodoCA.java fails
Reviewed-by: mullan
2019-07-24 18:20:43 +03:00
aph
e1cda1822f 8224880: AArch64: java/javac error with AllocatePrefetchDistance
Reviewed-by: adinn
2019-07-24 18:20:42 +03:00
aph
7c19f7a134 8224671: AArch64: mauve System.arraycopy test failure
Reviewed-by: adinn
2019-07-24 18:20:41 +03:00
ysuenaga
8ef4fe8295 8163805: hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java failed with timed out
Reviewed-by: cjplummer, jcbeyler
2019-07-24 18:20:40 +03:00
ysuenaga
2f2d0406ac 8223665: SA: debugd options should follow jhsdb style
Reviewed-by: dholmes, sspitsyn, ysuenaga, jcbeyler
Contributed-by: Osamu Sakamoto <sakamoto.osamu@nttcom.co.jp>
2019-07-24 18:20:39 +03:00
aivanov
558f0efc8c 8217707: JNICALL declaration breaks Splash screen functions
Reviewed-by: prr, stuefe
2019-07-24 18:20:38 +03:00
ljiang
19ae35dd6f 8218781: Localized names for Japanese era Reiwa in COMPAT provider
Reviewed-by: naoto
2019-07-24 18:20:37 +03:00
goetz
692d03cede 8221470: Print methods in exception messages in java-like Syntax.
Reviewed-by: dholmes, mdoerr, coleenp
2019-07-24 18:20:36 +03:00
itakiguchi
219844961a 8211841: [testbug] sun/nio/cs/OLD/TestIBMDB.java does not compile (aix)
Reviewed-by: alanb, goetz
2019-07-24 18:20:35 +03:00
itakiguchi
87023a078c 8213614: DnD operation change feature does not work with 64bit big endian CPU
Reviewed-by: serb
2019-07-24 18:20:34 +03:00
serb
49d3fc810e 8208996: X11 icon window color handing bug
Reviewed-by: serb
Contributed-by: takiguc@linux.vnet.ibm.com
2019-07-24 18:20:33 +03:00
mbaesken
915a162c8a 8221915: cleanup ticks related coding in os_perf_aix.cpp [aix]
Reviewed-by: mdoerr
2019-07-24 18:20:32 +03:00
mbalao
8954790601 8220513: Wrapper Key may get deleted when closing sessions in SunPKCS11 crypto provider
Summary: Do not close the session holding the Wrapper Key while in use. Delete the Wrapper Key when no longer needed.
Reviewed-by: valeriep
2019-07-24 18:20:31 +03:00
valeriep
bb857b8557 8216597: SIGBUS in Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo after JDK-6913047
Summary: changed variable declaration type to byte* from long* to fix SIGBUS error
Reviewed-by: ascarpino
2019-07-24 18:20:30 +03:00
mbalao
8edb0464c1 8217088: Disable JDK-6913047 fix (SunPKCS11 memory leak) after JDK-8216597 (SIGBUS error in getNativeKeyInfo)
Summary: Disable JDK-6913047 fix (SunPKCS11 memory leak) temporarily until JDK-8216597 (SIGBUS error in getNativeKeyInfo) is fixed.
Reviewed-by: mullan
2019-07-24 18:20:29 +03:00
mbalao
28a73b545d 6913047: Long term memory leak when using PKCS11 and JCE exceeds 32 bit process address space
Summary: Extract cryptographic keys within NSS PKCS11 software tokens for memory management purposes.
Reviewed-by: valeriep
2019-07-24 18:20:28 +03:00
ysuenaga
e812af9f42 8213015: Inconsistent settings between JFR.configure and -XX:FlightRecorderOptions
Reviewed-by: mgronlun, egahlin
2019-07-24 18:20:27 +03:00
egahlin
a9e8af6270 8213617: JFR should record the PID of the recorded process
Reviewed-by: mgronlun
2019-07-24 18:20:26 +03:00
mgronlun
2c3a64f901 8215284: Reduce noise induced by periodic task getFileSize()
Reviewed-by: redestad, egahlin
2019-07-24 18:20:24 +03:00
sgehwolf
ea3ed16d6d 8224474: harfbuzz 2.3.1 code fails to compile with gcc 4.4.7
Summary: Move GCC pragmas outside functions
Reviewed-by: clanger, aph
2019-07-24 18:20:23 +03:00
mbaesken
529d816862 8221535: add steal tick related information to hs_error file [linux]
Reviewed-by: dholmes, goetz
2019-07-24 18:20:22 +03:00
mbaesken
d79c9e4957 8220781: linux-s390 : os::get_summary_cpu_info gives bad output
Reviewed-by: dholmes, lucy
2019-07-24 18:20:21 +03:00
rhalade
7d45943917 8223499: Remove two DocuSign root certificates that are expiring
Reviewed-by: mullan
2019-07-24 18:20:20 +03:00
itakiguchi
3ba9e9e4d1 8211826: StringIndexOutOfBoundsException happens via GetStringUTFRegion()
Reviewed-by: serb
2019-07-24 18:20:19 +03:00
itakiguchi
7ef6ea624e 8212676: AWT SystemColor setting on CDE
Reviewed-by: serb
2019-07-24 18:20:18 +03:00
rhalade
f737bc3621 8222136: Remove two Comodo root CA certificates that are expiring
Reviewed-by: mullan
2019-07-24 18:20:17 +03:00
weijun
25a31564d8 8217690: Update public suffix version
Reviewed-by: mullan
2019-07-24 18:20:16 +03:00
aivanov
83c4ae980d 8221263: [TEST_BUG] RemotePrinterStatusRefresh test is hard to use
Reviewed-by: serb, prr
2019-07-24 18:20:15 +03:00
naoto
824c573811 8218960: CONFIG level logging statements printed in CLDRCalendarDataProviderImpl.java even when default log Level is INFO
Reviewed-by: nishjain, rriggs
2019-07-24 18:20:14 +03:00
nishjain
fe6d5b2a52 8214935: Upgrade IANA LSR data
Reviewed-by: rriggs, naoto
2019-07-24 18:20:13 +03:00
pbansal
6e4fabb087 8214765: All TrayIcon MessageType icons does not show up with gtk3 option set
Reviewed-by: serb, psadhukhan
2019-07-24 18:20:12 +03:00
pmuthuswamy
9301dc410d 8214468: jQuery UI upgrade from 1.11.4 to 1.12.1
Reviewed-by: hannesw
2019-07-24 18:20:11 +03:00
prr
b05477ba7c 8213213: Remove src/java.desktop/unix/classes/sun/awt/X11/keysym2ucs.h
Reviewed-by: serb
2019-07-24 18:20:10 +03:00
clanger
47af566600 8223597: jdk/nio/zipfs/ZipFSTester.java RuntimeException: CHECK_FAILED! (getAttribute.crc <entries20> failed 6af4413c vs 0 ...)
Reviewed-by: redestad, lancea
2019-07-24 18:20:09 +03:00
shade
47ccf390c3 8219574: Minimal VM build failure after JDK-8219414
Reviewed-by: jgeorge, dholmes, cjplummer
2019-07-24 18:20:08 +03:00
Alexey Ushakov
b4f5bf8bd3 JBR-1399 Improve font discovery and loading by introducing font cache
Added unit test
2019-07-24 17:20:07 +02:00
ysuenaga
d7551500de 8219414: SA: jhsdb jsnap throws UnmappedAddressException with core generated by gcore
Reviewed-by: cjplummer, jgeorge
2019-07-24 18:20:07 +03:00
sgehwolf
05b725a6da 8215342: [Zero] Build fails after JDK-8200613
Reviewed-by: shade, jgeorge
Contributed-by: Christophe Phillips <chphilli@redhat.com>
2019-07-24 18:20:06 +03:00
jgeorge
7deb1789d3 8200613: SA: jstack throws UnmappedAddressException with a CDS core file
Summary: Dump the closed archive heap space into the corefile on Linux by setting bit 2 of the coredump_filter file to dump the file backed private mappings.
Reviewed-by: iklam, cjplummer, kevinw, coleenp
2019-07-24 18:20:05 +03:00
jgeorge
ffc8f45780 8215026: Incorrect amount of memory unmapped with ImageFileReader::close()
Summary: Use map_size() instead of _index_size as the amount of memory to be unmapped while closing an image file
Reviewed-by: alanb, jlaskey
2019-07-24 18:20:04 +03:00
shade
9bc95fb2f0 8215374: 32-bit build failures after JDK-8181143 (Introduce diagnostic flag to abort VM on too long VM operations)
Reviewed-by: roland
2019-07-24 18:20:03 +03:00
shade
6547132b8a 8181143: Introduce diagnostic flag to abort VM on too long VM operations
Reviewed-by: rkennke, zgu, dholmes, stuefe, rehn
2019-07-24 18:20:02 +03:00
gromero
46c6cf5f35 8210320: PPC64: Fix uninitialized variable in C1 LIR assembler code
Reviewed-by: mbaesken, shade, mdoerr
2019-07-24 18:20:01 +03:00
rriggs
d889bab9fb 8220166: Performance regression in deserialization (4-6% in SPECjbb)
Reviewed-by: shade, dholmes, alanb
2019-07-24 18:20:00 +03:00
itakiguchi
61d8496cfd 8212677: X11 default visual support for IM status window on VNC
Reviewed-by: serb, naoto
2019-07-24 18:19:59 +03:00
dcherepanov
b20bd86a21 8221244: Unexpected behavior of PropertyDescription.getReadMethod for boolean properties
Reviewed-by: serb
2019-07-24 18:19:58 +03:00
prr
6479da50e2 8210886: Remove references in xwindows.md to non-existent files.
Reviewed-by: serb, dmarkov
2019-07-24 18:19:57 +03:00
serb
b66591c77e 8220495: Update GIFlib library to the 5.1.8
Reviewed-by: prr
2019-07-24 18:19:56 +03:00
aivanov
724e964295 8221412: lookupPrintServices() does not always update the list of Windows remote printers
Reviewed-by: prr, serb
2019-07-24 18:19:55 +03:00
sveerabhadra
39039c2416 8212202: [Windows] Exception if no printers are installed.
Reviewed-by: prr
2019-07-24 18:19:54 +03:00
prr
a1f9c32ddf 8210782: Upgrade HarfBuzz to the latest 2.3.1
Reviewed-by: serb, ihse, erikj
2019-07-24 18:19:53 +03:00
clanger
ca0d576263 8223555: Cleanups in cacerts tests
Reviewed-by: xuelei
2019-07-24 18:19:52 +03:00
redestad
3d7557d7e2 8222532: (zipfs) Performance regression when writing ZipFileSystem entries in parallel
Reviewed-by: lancea, clanger, alanb
2019-07-24 18:19:51 +03:00
kaddepalli
3e0db035b2 8218674: HTML Tooltip with "img=src" on component doesn't show
Summary: Make sure image is scaled appropriately if synchronous loading flag is set.
Reviewed-by: serb, psadhukhan
2019-07-24 18:19:50 +03:00
jlahoda
9243823fbd 8218152: [javac] fails and exits with no error if a bad annotation processor provided
Summary: Handle exceptions thrown while loading annotation processors.
Reviewed-by: jlahoda
Contributed-by: groeges@uk.ibm.com
2019-07-24 18:19:49 +03:00
ysuenaga
6dbdd87a32 8219566: JFR did not collect call stacks when MaxJavaStackTraceDepth is set to zero
Reviewed-by: egahlin, mgronlun
2019-07-24 18:19:47 +03:00
rhalade
b0a1a1a634 8222137: Remove T-Systems root CA certificate
Reviewed-by: mullan
2019-07-24 18:19:46 +03:00
bae
2a1e510c1f 8139178: Wrong fontMetrics when printing in Landscape (OpenJDK)
Reviewed-by: prr
2019-07-24 18:19:45 +03:00
dl
3f7c8dd3e7 8222930: ConcurrentSkipListMap.clone() shares size variable between original and clone
Reviewed-by: martin, smarks
Contributed-by: Adam Farley8 <adam.farley@uk.ibm.com>, Martin Buchholz <martinrb@google.com>
2019-07-24 18:19:44 +03:00
neliasso
c1d1494573 8219448: split-if update_uses accesses stale idom data
Reviewed-by: thartmann, kvn
2019-07-24 18:19:43 +03:00
vlivanov
e871dc0abf 8215757: C2: PhaseIdealLoop::create_new_if_for_predicate() computes wrong IDOM
Reviewed-by: kvn, roland
2019-07-24 18:19:42 +03:00
prr
9ae04eada2 8210880: Remove HPKeysym.h from JDK sources
Reviewed-by: serb, dmarkov
2019-07-24 18:19:41 +03:00
lmesnik
1e11f3a6d8 8221437: assert(java_lang_invoke_ResolvedMethodName::vmtarget(resolved_method()) == m()) failed: Should not change after link resolution
Reviewed-by: coleenp, sspitsyn
2019-07-24 18:19:40 +03:00
jgeorge
e0ad91db68 8204308: SA: serviceability/sa/TestInstanceKlassSize*.java fails when running in CDS mode
Summary: Use longs instead of ints while computing the identity hash of klass symbols
Reviewed-by: coleenp, lfoltan, jiangli, shade
2019-07-24 18:19:39 +03:00
sgehwolf
4a032cf6c5 8221639: [i386] expand_exec_shield_cs_limit workaround is undefined code after JDK-8199717
Summary: Only perform this optimization for x86_64
Reviewed-by: dholmes, andrew
2019-07-24 18:19:38 +03:00
rhalade
246655a960 8216577: Add GlobalSign's R6 Root certificate
Reviewed-by: mullan, robm
2019-07-24 18:19:37 +03:00
gromero
2020112807 8223395: PPC64: Improve comments in the JVM signal handler to match ISA text
Reviewed-by: mdoerr
2019-07-24 18:19:36 +03:00
gromero
5c53f38ec6 8221175: Fix bad function case for controlled JVM crash on PPC64 big-endian
Reviewed-by: chrisphi, stuefe, goetz
2019-07-24 18:19:35 +03:00
mdoerr
e5e0f0ae3b 8216556: Unnecessary liveness computation with JVMTI
Reviewed-by: redestad, dlong, kvn
2019-07-24 18:19:34 +03:00
gromero
58162a4803 8223266: PPC64: Check for branch to illegal address before checking for mem serialization
Reviewed-by: goetz, mdoerr
2019-07-24 18:19:33 +03:00
lfoltan
6333b9f008 8205611: Improve the wording of LinkageErrors to include module and class loader information
Summary: Clean up the wording of loader constraint violations to include the module and class loader information.
Reviewed-by: coleenp, goetz, hseigel
2019-07-24 18:19:32 +03:00
itakiguchi
1c67381903 8212678: Windows IME related patch
Reviewed-by: serb, naoto
2019-07-24 18:19:31 +03:00
sgroeger
bf3d9b9891 8222027: java/util/logging/LogManager/TestLoggerNames.java generates intermittent ClassCastException
Summary: Make a strong reference to TestLogger and dont fetch it from LogManager
Reviewed-by: dfuchs
2019-07-24 18:19:30 +03:00
itakiguchi
5042274cad 8220281: IBM-858 alias name is missing on IBM00858 charset
Summary: Add aliases into IBM charsets
Reviewed-by: naoto
2019-07-24 18:19:29 +03:00
mullan
ae613356ea 8218618: Program fails when using JDK addressed by UNC path and using Security Manager
Reviewed-by: weijun
2019-07-24 18:19:28 +03:00
smarks
5fbb52191d 8221924: get(null) on single-entry unmodifiable Map returns null instead of throwing NPE
Reviewed-by: redestad, lancea
2019-07-24 18:19:27 +03:00
lzhai
7d8c539268 8206955: MethodHandleProxies.asInterfaceInstance does not support default methods
Summary: Cache default method handles.
Reviewed-by: mchung, plevart
2019-07-24 18:19:26 +03:00
prr
6a25123067 8221304: Problem list java/awt/FontMetrics/MaxAdvanceIsMax.java
Reviewed-by: serb
2019-07-24 18:19:25 +03:00
mbalao
2f022325b0 8218854: FontMetrics.getMaxAdvance may be less than the maximum FontMetrics.charWidth
Summary: Consider algorithmic bold in FontMetrics.getMaxAdvance value and update obliqueness.
Reviewed-by: prr, serb
2019-07-24 18:19:24 +03:00
clanger
134e8c4798 8222522: Add configure options for Mac Bundle creation
Reviewed-by: erikj
2019-07-24 18:19:23 +03:00
clanger
e3771f75b0 8221880: Better customization for Windows RC properties FileDescription and ProductName
Reviewed-by: erikj
2019-07-24 18:19:22 +03:00
mullan
523988e12d 8222133: Add temporary exceptions for root certs that are due to expire soon
Reviewed-by: xuelei
2019-07-24 18:19:21 +03:00
mullan
03bf56e8ff 8222089: [TESTBUG] sun/security/lib/cacerts/VerifyCACerts.java fails due to cert within 90-day expiry window
Reviewed-by: xuelei
2019-07-24 18:19:20 +03:00
igerasim
c562fdce46 8170494: JNI exception pending in PlainDatagramSocketImpl.c
Reviewed-by: clanger, vtewari
2019-07-24 18:19:19 +03:00
shade
cea2506581 8217879: hs_err should print more instructions in hex dump
Reviewed-by: stuefe, coleenp, dholmes, lucy, stefank
2019-07-24 18:19:18 +03:00
shade
fc656b75b4 8222410: java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile hangs when "nc" does not accept "-U"
Reviewed-by: alanb
2019-07-24 18:19:17 +03:00
shade
ba24a55e7a 8222397: x86_32 tests with UseSHA1Intrinsics SEGV due to garbled registers
Reviewed-by: kvn, dsamersoff
2019-07-24 18:19:16 +03:00
hannesw
562b7623e5 8209914: javadoc search sometimes generates bad URIs
Reviewed-by: jjg
2019-07-24 18:19:15 +03:00
prr
bee63f6b8f 8218020: Fix version number in mesa.md 3rd party legal file
Reviewed-by: serb, psadhukhan
2019-07-24 18:19:14 +03:00
vlivanov
4331f72e0a 8188133: C2: Static field accesses in clinit can trigger deoptimizations
Reviewed-by: kvn
2019-07-24 18:19:13 +03:00
clanger
b680502d78 8215472: (zipfs) Cleanups in implementation classes of jdk.zipfs and tests
Reviewed-by: redestad, lancea
2019-07-24 18:19:12 +03:00
amlu
29c3b8035a 8211266: [TESTBUG] ZipFSTester.java failed intermittently in ZipFSTester.checkRead(): bound must be positive
Reviewed-by: lancea
2019-07-24 18:19:11 +03:00
sherman
487a0cb89f 8210899: (zipfs) ZipFileSystem.EntryOutputStreamCRC32 mistakenly set the crc32 value into size field
Reviewed-by: bpb
2019-07-24 18:19:10 +03:00
bulasevich
1fcdac97ed 8217647: JFR: recordings on 32-bit systems unreadable
Reviewed-by: egahlin
Contributed-by: boris.ulasevich@bell-sw.com, markus.gronlund@oracle.com
2019-07-24 18:19:09 +03:00
lfoltan
d8796fc895 8216970: condy causes JVM crash
Summary: Fix issue with ConstantPool::constant_tag_at to correctly handle a condy whose return type is an array.
Reviewed-by: acorn, hseigel, jrose
2019-07-24 18:19:08 +03:00
shade
6606ee93d5 8222032: x86_32 fails with "wrong size of mach node" on AVX-512 machine
Reviewed-by: kvn, vlivanov
2019-07-24 18:19:07 +03:00
shade
0081bdd6bc 8221917: serviceability/sa/TestPrintMdo.java fails on 32-bit platforms
Reviewed-by: cjplummer, dholmes
2019-07-24 18:19:06 +03:00
pbansal
ed99711837 8220349: The fix done for JDK-8214253 have caused issues in JTree behaviour
Reviewed-by: serb, prr
2019-07-24 18:19:05 +03:00
mdoerr
580ea2b861 8221833: Readability check in Symbol::is_valid not performed for some addresses
Reviewed-by: zgu, coleenp
2019-07-24 18:19:04 +03:00
mdoerr
f8bf5b94da 8220441: [PPC64] Clobber memory effect missing for memory barriers in atomics
Reviewed-by: simonis, goetz
2019-07-24 18:19:03 +03:00
mdoerr
e5f579f928 8218991: s390: Add intrinsic for GHASH algorithm
Reviewed-by: lucy, simonis
2019-07-24 18:19:02 +03:00
mdoerr
50cdd824b8 8220625: tools/javac/classreader/8171132/BadConstantValue.java failed with "did not see expected error"
Reviewed-by: clanger
2019-07-24 18:19:01 +03:00
clanger
2dcc5f045b 8221610: Resurrect (legacy) JRE bundle target
Reviewed-by: erikj, azeller
2019-07-24 18:19:00 +03:00
erikj
90de3b119f 8210519: build/releaseFile/CheckSource.java failed additional sources found
Reviewed-by: mikael, dholmes, ihse
2019-07-24 18:18:59 +03:00
goetz
9ae5bc1fce 8219918: ProblemList hotspot tests failing in SAP testing.
Reviewed-by: dholmes
2019-07-24 18:18:58 +03:00
clanger
d32a958776 8217311: Improve Exception thrown when MulticastSocket.setInterface fails on AIX(Unix)
Reviewed-by: sgroeger, alanb, mbaesken, chegar
2019-07-24 18:18:57 +03:00
shade
f2126682e8 8221870: use driver to run CtwRunner in applications/ctw tests
Reviewed-by: shade, epavlova
2019-07-24 18:18:56 +03:00
clanger
a56c9bd36d 8219915: [TESTBUG] Fix test langtools/tools/javac/processing/model/completionfailure/SymbolsDontCumulate.java in Standalone mode
Reviewed-by: jlahoda
2019-07-24 18:18:55 +03:00
alanb
47f63ddec9 8207340: (fs) UnixNativeDispatcher close and readdir usages should be fixed
Summary: Replace readdir_r with readdir, use RESTARTABLE for close only on aix.
Reviewed-by: bpb
2019-07-24 18:18:54 +03:00
bpb
d4f23f6cab 8202794: Native Unix code should use readdir rather than readdir_r
8207748: Fix for 8202794 breaks tier1 builds
Summary: Replace uses of readdir_r with readdir.
Reviewed-by: alanb, bsrbnd, kbarrett, darcy
2019-07-24 18:18:53 +03:00
ngasson
043686d649 8220707: [TESTBUG] serviceability/sa/TestHeapDumpForLargeArray.java fails with jtreg -vmoption:-Xmx < 8g
Reviewed-by: clanger, sballal, jcbeyler
2019-07-24 18:18:52 +03:00
ghaug
29985b6c0d 8221479: Fix JFR profiling on s390
Reviewed-by: mdoerr, clanger
2019-07-24 18:18:51 +03:00
kbarrett
9c77effb3b 8202353: os::readdir should use readdir instead of readdir_r
Summary: Summary: os::readdir uses POSIX readdir, drop buffer arg, fix JFR uses.
Reviewed-by: coleenp, tschatzl, bsrbnd
2019-07-24 18:18:50 +03:00
simonis
734bb46798 8221483: TestOopCmp.java fails due to "Multiple garbage collectors selected"
Reviewed-by: kvn, mdoerr
2019-07-24 18:18:48 +03:00
simonis
36bf031da8 8221083: [ppc64] Wrong oop compare in C1-generated code
Reviewed-by: mdoerr, goetz
2019-07-24 18:18:47 +03:00
gromero
af31a2f634 8220794: PPC64: Fix signal handler for SIGSEGV on branch to illegal address
Reviewed-by: stuefe, goetz
2019-07-24 18:18:46 +03:00
shade
d4d2409947 8221400: java/lang/String/StringRepeat.java test requests too much heap
Reviewed-by: stuefe, alanb
2019-07-24 18:18:45 +03:00
shade
1bf1546703 8221401: java/math/BigInteger/LargeValueExceptions.java test should be disabled on 32-bit platforms
Reviewed-by: stuefe, bpb
2019-07-24 18:18:44 +03:00
shade
8c7c75195f 8220198: Lots of com/sun/crypto/provider/Cipher tests fail on x86_32 due to missing SHA512 stubs
Reviewed-by: kvn, thartmann
2019-07-24 18:18:43 +03:00
rkennke
4b5e87f162 8220714: C2 Compilation failure when accessing off-heap memory using Unsafe
Reviewed-by: vlivanov, roland
2019-07-24 18:18:42 +03:00
mbaesken
a30a8852f4 8215296: do not disable c99 on Solaris
Reviewed-by: dholmes, ihse, goetz, clanger
2019-07-24 18:18:41 +03:00
roland
7a42b99514 8220374: C2: LoopStripMining doesn't strip as expected
Reviewed-by: rkennke, thartmann, mdoerr
2019-07-24 18:18:40 +03:00
aph
735bb0b81c 8219006: AArch64: Register corruption in slow subtype check
Reviewed-by: adinn
2019-07-24 18:18:39 +03:00
clanger
10f57c2915 8200286: (testbug) MOptionTest test fails with java.lang.AssertionError: Classfiles too old!
Reviewed-by: stuefe, jjg
2019-07-24 18:18:38 +03:00
adinn
328b2c647c 8209414: AArch64: method handle invocation does not respect JVMTI interp_only mode
Reviewed-by: adinn
Contributed-by: nick.gasson@arm.com
2019-07-24 18:18:37 +03:00
mbalao
0748a9b63f 8219011: Implement MacroAssembler::warn method on AArch64
Reviewed-by: adinn
2019-07-24 18:18:36 +03:00
dbuck
8a789d61a9 8217564: idempotent protection missing in crc32c.h
Summary: added include guard to crc32c.h
Reviewed-by: dcubed
2019-07-24 18:18:35 +03:00
mbaesken
94bfa56922 8215707: [macosx] fix pthread_getschedparam and pthread_setschedparam calls
Reviewed-by: clanger, dholmes
2019-07-24 18:18:34 +03:00
roland
eabc7977a7 8219335: "failed: unexpected type" assert failure in ConnectionGraph::split_unique_types() with unsafe accesses
Reviewed-by: thartmann, kvn
2019-07-24 18:18:33 +03:00
mbaesken
0aa1c20cf1 8219746: Provide virtualization related info in the hs_error file on linux ppc64 / ppc64le
Reviewed-by: dholmes, lucy, mdoerr
2019-07-24 18:18:32 +03:00
stuefe
cac4760d87 8212828: (process) Provide a way for Runtime.exec to use posix_spawn on linux
Reviewed-by: alanb, rriggs
Contributed-by: david.lloyd@redhat.com
2019-07-24 18:18:31 +03:00
iklam
a82a3ffbf1 8212205: VM asserts after CDS archive has been unmapped
Reviewed-by: dholmes, jiangli, hseigel, stuefe
2019-07-24 18:18:30 +03:00
aivanov
f68b3043dc 8217263: Automate DashOffset test
Reviewed-by: prr, serb
2019-07-24 18:18:29 +03:00
coleenp
0134ec0a23 8210457: JVM crash in ResolvedMethodTable::add_method(Handle)
Summary: Add a function to call NSME in ResolvedMethodTable to replace deleted methods.
Reviewed-by: sspitsyn
2019-07-24 18:18:28 +03:00
aph
44a2d03996 8209415: Fix JVMTI test failure HS202
Summary: Fix test for static method in exception throw handler
Reviewed-by: adinn
2019-07-24 18:18:26 +03:00
tschatzl
10ce765c20 8218063: JDK-8218060 breaks build for S390
Summary: Reinstated function removed by JDK-8218060 and properly ifdef'ed it.
Reviewed-by: shade, eosterlund
2019-07-24 18:18:25 +03:00
tschatzl
af40b4e1d0 8218060: JDK-8217786 breaks build due to remaining unused function
Summary: Remove unused function.
Reviewed-by: eosterlund
2019-07-24 18:18:24 +03:00
mbaesken
4ea6839dee 8217786: Provide virtualization related info in the hs_error file on linux s390x
Reviewed-by: dholmes, stuefe
2019-07-24 18:18:23 +03:00
mbaesken
aa80960737 8216355: missing NULL checks in libnet in interface iteration and potential resource leak in getMacAddress
Reviewed-by: clanger, rwestberg
2019-07-24 18:18:22 +03:00
mbaesken
907ee46e59 8219112: name_and_sig_as_C_string usages in frame_s390 miss ResourceMark
Reviewed-by: shade, lucy
2019-07-24 18:18:21 +03:00
mbaesken
410c7daa75 8219460: ppc: adjust NativeGeneralJump::insert_unconditional to stack allocated MacroAssembler
Reviewed-by: mdoerr
2019-07-24 18:18:20 +03:00
pbansal
1373e65863 8214112: The whole text in target JPasswordField image are not selected
Reviewed-by: serb, psadhukhan
2019-07-24 18:18:19 +03:00
kevinw
8780ac4183 8209951: Problematic sparc intrinsic: com.sun.crypto.provider.CipherBlockChaining
Reviewed-by: kvn, thartmann
Contributed-by: fairoz.matte@oracle.com
2019-07-24 18:18:18 +03:00
pbansal
8086cff234 8214111: There is no icon in all JOptionPane target image
Reviewed-by: serb, psadhukhan
2019-07-24 18:18:17 +03:00
apetcher
a8b0f565e4 8208648: ECC Field Arithmetic Enhancements
Summary: interal library enhancements to support ECC implementatation
Reviewed-by: jnimeh
2019-07-24 18:18:16 +03:00
nishjain
bca035a384 8213294: Upgrade IANA LSR data
Reviewed-by: naoto
2019-07-24 18:18:15 +03:00
dmarkov
0d3048339f 8214109: XToolkit is not correctly displayed color on 16-bit high color setting
Reviewed-by: serb, prr
2019-07-24 18:18:14 +03:00
pbansal
fc674452a2 8214252: Expanded & Collapsed nodes of a JTree look the same on GTK3
Reviewed-by: serb, psadhukhan
2019-07-24 18:18:13 +03:00
pbansal
533913d0b4 8214253: Tooltip is transparent rather than having a black background
Reviewed-by: serb, psadhukhan
2019-07-24 18:18:12 +03:00
ssadetsky
d86ba25b1d 8218473: JOptionPane display issue with GTKLookAndFeel
Reviewed-by: prr, serb
2019-07-24 18:18:11 +03:00
ssadetsky
372397a76c 8218479: JTextPane display issue with GTKLookAndFeel
Reviewed-by: prr, serb
2019-07-24 18:18:10 +03:00
shade
b8f0618681 8220718: Missing ResourceMark in nmethod::metadata_do
Reviewed-by: mdoerr, zgu
2019-07-24 18:18:09 +03:00
sgehwolf
4c85b20f95 8220353: [TESTBUG] TestRegisterRestoring uses SafepointALot without UnlockDiagnosticVMOptions
Reviewed-by: thartmann, shade
2019-07-24 18:18:08 +03:00
mdoerr
ba474bcfdd 8219584: Try to dump error file by thread which causes safepoint timeout
Reviewed-by: stuefe, dholmes, kvn
2019-07-24 18:18:07 +03:00
mullan
660fd8a3c8 8217878: ENVELOPING XML signature no longer works in JDK 11
8218629: XML Digital Signature throws NAMESPACE_ERR exception on OpenJDK 11, works 8/9/10
Summary: Backout and restore previous XML signature marshalling implementation
Reviewed-by: weijun
2019-07-24 18:18:06 +03:00
xuelei
c38615fdca 8216045: The size of key_exchange may be wrong on FFDHE
Reviewed-by: jnimeh
2019-07-24 18:18:05 +03:00
dfuchs
366bd6c3c4 8217094: HttpClient SSL race if a socket IOException is raised before ALPN is available
Summary: The patch makes suer that the SSLFlowDelegate's ALPN CF is always completed
Reviewed-by: chegar
2019-07-24 18:18:04 +03:00
serb
ab67248c83 8210739: Calling JSpinner's setFont with null throws NullPointerException
Reviewed-by: psadhukhan
2019-07-24 18:18:03 +03:00
apetcher
396bcd7653 8201317: X25519/X448 code improvements
Summary: Minor code/comment improvements
Reviewed-by: xuelei
2019-07-24 18:18:01 +03:00
vromero
179c440804 8210197: javac can't tell during speculative attribution if a diamond expression is creating an anonymous inner class or not
Reviewed-by: mcimadamore
2019-07-24 18:18:00 +03:00
xuelei
1021dce957 8219389: Delegated task created by SSLEngine throws BufferUnderflowException
Reviewed-by: ascarpino
2019-07-24 18:17:59 +03:00
ascarpino
9d9687bace 8215790: Delegated task created by SSLEngine throws java.nio.BufferUnderflowException
Reviewed-by: jnimeh
2019-07-24 18:17:58 +03:00
xuelei
d832e2dcde 8215443: The use of TransportContext.fatal() leads to bad coding style
Reviewed-by: ascarpino
2019-07-24 18:17:57 +03:00
stefank
266d389c19 8218733: SA: CollectedHeap provides broken implementation for used() and capacity()
Reviewed-by: shade, jgeorge, eosterlund
2019-07-24 18:17:56 +03:00
fyang
5000cf32d2 8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
Reviewed-by: aph
2019-07-24 18:17:55 +03:00
ascarpino
af3ebd40ab 8220165: Encryption using GCM results in RuntimeException- input length out of bound
Reviewed-by: valeriep
2019-07-24 18:17:54 +03:00
dholmes
b57830deaf 8217765: Internal Error (javaCalls.cpp:61) guarantee(thread->can_call_java()) failed
Reviewed-by: rehn, redestad, coleenp
2019-07-24 18:17:53 +03:00
jcm
df40e259ea 8213825: assert(false) failed: Non-balanced monitor enter/exit! Likely JNI locking
Summary: skip sfpt optimization for Load is removed for Java Object's Markword Load.
Reviewed-by: kvn, dlong
2019-07-24 18:17:52 +03:00
aivanov
96c225a86e 8215123: Crash in runtime image built with jlink --compress=2
Reviewed-by: ihse, alanb
2019-07-24 18:17:51 +03:00
jgeorge
12515379ef 8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching
Summary: While doing a ptrace attach, do not attach to threads which are in the process of exiting or are zombies -- skip these threads.
Reviewed-by: jcbeyler, ysuenaga
2019-07-24 18:17:50 +03:00
mullan
6d3266e7f8 8195793: Remove GTE CyberTrust Global Root
Reviewed-by: rhalade
2019-07-24 18:17:49 +03:00
mdoerr
3f8ff03d63 8219582: PPC: Crash after C1 checkcast patched and GC
Reviewed-by: akozlov, goetz
2019-07-24 18:17:47 +03:00
jjiang
44b995832b 8211971: Move security/cacerts/VerifyCACerts.java and security/CheckBlacklistedCerts.java
Summary: Move lib/security tests to sun/security/lib
Reviewed-by: weijun
2019-07-24 18:17:46 +03:00
weijun
f0f7032ffc 8211969: test/jdk/lib/security/CheckBlacklistedCerts.java searching for wrong paths
Reviewed-by: mullan
2019-07-24 18:17:45 +03:00
mikael
26b4b71251 8211350: Remove jprt support
Reviewed-by: dholmes, erikj, mchung, alanb, jjg
2019-07-24 18:17:44 +03:00
simonis
8a4f73dec9 8213515: Improve freetype detection on linux/ppc64/ppc64le/s390x
Reviewed-by: shade, ihse, stuefe
2019-07-24 18:17:43 +03:00
rraghavan
2ef26c346d 8210803: Compilation failure in codeBlob.cpp for Windows 32-bit
Summary: Added ordinary operator delete declaration within class
Reviewed-by: kvn, rlichten, thartmann
2019-07-24 18:17:42 +03:00
itakiguchi
f1bfb4b93a 8217880: AIX build issue after JDK-8214533
Reviewed-by: goetz, ihse, mbaesken
2019-07-24 18:17:41 +03:00
itakiguchi
9e461b9cfb 8214533: IBM-29626C is required for AIX default charset
Reviewed-by: alanb, rriggs
2019-07-24 18:17:40 +03:00
itakiguchi
9645d6d6ce 8212794: IBM-964 is required for AIX default charset
Reviewed-by: rriggs, ihse, alanb
2019-07-24 18:17:39 +03:00
itakiguchi
9fec4ab8bc 8213618: IBM970 charset has missing entry and remove unexpected entries
Reviewed-by: srl, martin
2019-07-24 18:17:38 +03:00
sherman
bb3abaeddc 8208634: Add x-IBM-1129 charset
Reviewed-by: alanb, sherman
Contributed-by: enasser@in.ibm.com
2019-07-24 18:17:36 +03:00
itakiguchi
7618bc21e4 8211393: Memory leak issue on awt_InputMethod.c
Reviewed-by: naoto, clanger
2019-07-24 18:17:35 +03:00
sveerabhadra
e89edc17b0 8190361: Incorrect version info in jaccessinspector.exe and jaccesswalker.exe
Reviewed-by: prr, mhalder
2019-07-24 18:17:34 +03:00
serb
6f9ee713ac 8211435: Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: null source
Reviewed-by: dmarkov, lbourges, kaddepalli, prr
2019-07-24 18:17:33 +03:00
ascarpino
b27c65bd65 8201633: Problems with AES-GCM native acceleration
Reviewed-by: valeriep
2019-07-24 18:17:32 +03:00
valeriep
e497ff5f18 8179098: Crypto AES/ECB encryption/decryption performance regression (introduced in jdk9b73)
Summary: Do bounds check per encryption/decryption call instead of per block
Reviewed-by: ascarpino, redestad
2019-07-24 18:17:31 +03:00
hseigel
e1127f6887 8215398: -Xlog option usage => Invalid decorator '\temp\app_cds.log'.
Summary: On Windows, do not treat ':' as a delimeter when it's in a string such as "C:..."
Reviewed-by: dholmes, sspitsyn
2019-07-24 18:17:30 +03:00
iignatyev
6e1a192696 8174691: [TESTBUG] A number of native hotspot unit tests fail when executed in stand-alone mode
Reviewed-by: kvn, tschatzl
2019-07-24 18:17:29 +03:00
cushon
6c38912958 8210483: AssertionError in DeferredAttr at setOverloadKind caused by JDK-8203679
Reviewed-by: mcimadamore, vromero
2019-07-24 18:17:27 +03:00
jlahoda
08265c8a8a 8209055: c.s.t.javac.code.DeferredCompletionFailureHandler seems to use WeakHashMap incorrectly
Summary: Do not keep speculative Symbols in DeferredCompletionFailureHandler.
Reviewed-by: jjg, vromero
2019-07-24 18:17:25 +03:00
shade
c5dd604ef8 8209573: [TESTBUG] gc/epsilon/TestMemoryMXBeans should retry on failure
Reviewed-by: kvn, pliden
2019-07-24 18:17:24 +03:00
roland
d781571d7e 8205574: Loop predication "assert(f <= 1 && f >= 0) failed Incorrect frequency"
Reviewed-by: kvn
2019-07-24 18:17:23 +03:00
clanger
be04489104 8219710: Bump update version for OpenJDK: jdk11.0.4
Reviewed-by: goetz
2019-07-24 18:17:22 +03:00
bell-sw
80855b3dd9 resolving a simple merge conflict. two different methods was put in one place, letting them to coexist 2019-07-24 18:17:07 +03:00
itakiguchi
8f571a5887 8213232: Unix/X11 setCompositionEnableNative issue
Reviewed-by: serb

 Conflicts:
	src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
2019-07-24 18:17:06 +03:00
bell-sw
176aed1c33 minor merge conflict around Xrandr #include again 2019-07-24 18:17:05 +03:00
simonis
dbf59696bb 8213944: Fix AIX build after the removal of Xrandr.h and add a configure check for it
Reviewed-by: shade, erikj, stuefe, ihse, goetz

 Conflicts:
	src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
2019-07-24 18:17:04 +03:00
bell-sw
83b360a88a minor merge conflict. deleting Xrandr #include as the header was deleted 2019-07-24 18:17:03 +03:00
prr
624aa68718 8210863: Remove Xrandr include files from JDK sources
Reviewed-by: serb

 Conflicts:
	src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
2019-07-24 18:17:02 +03:00
avu
6b799847b0 8213292: Input freezes after MacOS key-selector (press&hold) usage on macOS Mojave
Reviewed-by: serb

 (Commiting empty update to make merge robot happy)
 The change is already in place (with additional IS_OSX_GT10_13 treatment):
        https://github.com/JetBrains/JetBrainsRuntime/commit/c358cff1
        https://github.com/bell-sw/jdk11u-openjdk/commit/e83307ae
2019-07-24 18:17:01 +03:00
bell-sw
6d47616124 Merge resolution. Reverting the change in freetypeScaler.c as it has no sence for JetBrainsRuntime:
the affected variable 'renderFlags' was moved to 'FTScalerContext.loadFlags': https://github.com/JetBrains/JetBrainsRuntime/commit/0456745a
  and deleted as not used soon: https://github.com/JetBrains/JetBrainsRuntime/commit/431e1442
The of JDK-8214002 fix (if algorithmic styling is required then we do not request bitmap) is already in place.
2019-07-24 18:17:01 +03:00
itakiguchi
d233632c35 8214002: Cannot use italic font style if the font has embedded bitmap
Reviewed-by: prr

 Conflicts:
	src/java.desktop/share/native/libfontmanager/freetypeScaler.c
2019-07-24 18:17:00 +03:00
bell-sw
c676a05f0a trivial merge conflict resolution 2019-07-24 18:16:59 +03:00
erikj
43ce2bb92a 8210283: Support git as an SCM alternative in the build
Reviewed-by: ihse, ehelin

Conflicts:
	.gitignore
2019-07-24 18:16:58 +03:00
twisti
37ba62c6c3 8210008: custom extension for make/SourceRevision.gmk
Reviewed-by: erikj
2019-07-24 18:16:57 +03:00
bell-sw
805e7dbc44 trivial merge conflict resolution 2019-07-24 18:16:56 +03:00
serb
6d4928a1e6 8208702: javax/swing/reliability/HangDuringStaticInitialization.java may hang on macos
Reviewed-by: prr, denis

Conflicts:
	src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
	src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m
2019-07-24 18:16:54 +03:00
Denis Fokin
1a5ba408a1 JBR-1670 Force restore focus on tempLost 2019-07-18 21:13:29 +03:00
Anton Tarasov
461b0b5cd4 JBR-1669 IDE-managed HiDPI mode is broken 2019-07-18 17:01:45 +03:00
Artem Bochkarev
6bbe7102e2 JBR-1668: read system keyboard shortcuts
initial support for OS X
2019-07-18 15:13:53 +03:00
Elena Sayapina
0900a705bc IDEA-165950 Added new regression test (National keyboard layouts support) 2019-07-18 15:57:15 +07:00
Anton Tarasov
fe97147ea2 JBR-1650 [followup] propagate custom decoration title bar height to native 2019-07-15 12:42:11 +03:00
Dmitry Batrak
bdd52c4c89 add couple of files to .gitignore to be able to use my own project setup 2019-07-09 10:37:45 +03:00
Anton Tarasov
5511e8eae8 JBR-1650 [followup] propagate custom decoration title bar height to native 2019-07-08 22:19:47 +03:00
Anton Tarasov
f6fc65d014 JBR-1650 propagate custom decoration title bar height to native 2019-07-08 18:52:01 +03:00
Vitaly Provodin
eb493ef1bf updated JTreg exclude list 2019-07-08 14:34:52 +07:00
Alexey Ushakov
da86fbacae JBR-1647 [fwp to 11] JBR-1639 Unexpected crash when I update my MacBook Pro to MacOS Version 10.15 Beta (19A501i)
Removed usage of coretext in HarfBuzz
2019-07-05 16:50:28 +03:00
Denis Fokin
4e7c0b5e50 JBR-1515 Regression test jb/sun/awt/macos/MoveFocusShortcutTest.java fails on macOS
All system CMD shortcuts were forbidden.
2019-07-05 12:44:02 +03:00
Vitaly Provodin
b210facd6b updated JTreg exclude list 2019-07-04 11:40:58 +07:00
Denis Fokin
3801db7e12 JBR-1515 Regression test jb/sun/awt/macos/MoveFocusShortcutTest.java fails on macOS
Now we prevent Mac OS from handling the shortcut. We can enumerate windows on IDE level.
2019-07-03 19:58:56 +03:00
Alexey Ushakov
22efc1419c JBR-1634 Some swing gtk regression tests fail with "java.lang.InternalError: Unable to load native GTK libraries"
Added check on gtk3 version
2019-07-03 17:47:01 +03:00
Artem Bochkarev
b7acd7f6f6 JBR-1573: restore current input context after cleanup 2019-07-03 13:02:03 +03:00
Denis Fokin
2646c8bb5b Wrong selector 2019-07-02 21:24:32 +03:00
Denis Fokin
c276444bee JBR-1635 Native file dialog does not work as an oppositeWindow properly 2019-07-01 18:26:46 +03:00
Vitaly Provodin
4c7870a3b4 updated JTreg exclude list 2019-06-29 05:37:45 +07:00
Denis Fokin
4e1330dfb2 JBR-1515 Regression test jb/sun/awt/macos/MoveFocusShortcutTest.java fails on macOS
In my environment the test stopped sending double WINDOW_GAINED_FOCUS events.
The test still fails because of the Cmd-` shortcut effect.
2019-06-28 21:02:10 +03:00
Vitaly Provodin
2ca8f09c02 updated JTreg exclude list 2019-06-28 21:09:15 +07:00
Vitaly Provodin
a71b0a3e0d updated JTreg exclude list 2019-06-27 10:52:50 +07:00
Alexey Ushakov
cef29e8100 JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Restored old behaviour of registerFontsInDir as it does not affect idea bundled fonts
2019-06-26 16:19:45 +03:00
Anton Tarasov
9e768377db JBR-1629 Maximized window cut at the right and bottom 2019-06-26 14:39:46 +03:00
Denis Fokin
68c2fd0e3b JBR-1515 Regression test jb/sun/awt/macos/MoveFocusShortcutTest.java fails on macOS
The problem is still reproducible, but the fix is the part of the solution
2019-06-26 14:00:52 +03:00
Vitaly Provodin
7967532f3f updated JTreg exclude list 2019-06-26 16:43:39 +07:00
Vitaly Provodin
73f993d10c updated JTreg exclude list 2019-06-25 10:15:04 +07:00
Alexey Ushakov
e838103a24 JBR-1624 Fonts rendering is broken in the 2019.2 EAP (Fira Code)
Lower priority for idea bundled fonts to pickup platform ones
(if installed)
2019-06-24 23:30:57 +03:00
Anton Tarasov
e7ca6db66b JBR-1492 Not able to start Intellij Idea 2017.2.5 with modified vmoptions 2019-06-24 14:29:50 +03:00
Vitaly Provodin
d9656a178b updated JTreg exclude list 2019-06-23 07:54:43 +07:00
Vitaly Provodin
5f6351b0c4 updated JTreg exclude list 2019-06-23 07:40:54 +07:00
Vitaly Provodin
c3a0ec902d updated JTreg exclude list 2019-06-22 06:01:31 +07:00
Anton Tarasov
567d96c428 Merge remote-tracking branch 'origin/master' 2019-06-20 21:02:12 +03:00
Anton Tarasov
1666f05b23 JBR-1617 revert fixes for app icon 2019-06-20 21:01:34 +03:00
Egor Ushakov
ae823a660b JBR-1615 Slow ClassLoaderReferenceImpl.findType 2019-06-20 17:52:15 +03:00
Denis Fokin
f6a31f444c Revert: JBR-1583 Fight MAC OS X "Please call TIS/TSM in main thread!!!" message 2019-06-20 14:15:19 +03:00
Dmitry Batrak
a1b4cd964a JBR-1604 Tooltip with package's info is cut 2019-06-19 17:15:15 +03:00
Elena Sayapina
5845719fe5 updated JTreg exclude list 2019-06-17 16:49:18 +07:00
alexsch
dae56a9e8b JBR-1066: fixed ScreenMenuMemoryLeakTest
re-apply fix that was reverted in 2a92eec5:
8158325: [macosx] Memory leak in com.apple.laf.ScreenMenu
Reviewed-by: azvegint, alexsch
Contributed-by: Robin Stevens <robin.stevens@scz.be>

NOTE: fix 8158325 caused 'JBR-922 Actions from system menu does not work on jdk9 runtime', 'IDEA-183063 MacOS: popups are closing, main menu actions will not open when running under Oracle 1.8.152 JDK'. This fix was reapplied because it is correct and bugs aren't reproduced now.

(cherry picked from commit 0a4920f61d)
2019-06-14 16:36:53 +07:00
Anton Tarasov
9cc97b0c00 [followup] JBR-1351 Borderless UI: Bold frame around IDEA window appears on non-HiDPI display 2019-06-13 20:15:41 +03:00
Denis Fokin
936dc2c40b JBR-1583 Fight MAC OS X "Please call TIS/TSM in main thread!!!" message
Crash is fixed
2019-06-11 12:59:53 +03:00
Anton Tarasov
db6c43b6f4 JBR-1414 DnD on linux (XToolkit) does not honor HIDPI scale 2019-06-10 19:11:43 +03:00
Artem Bochkarev
bd9a95d6fb JRE-220: fixed 'terminal Ctrl+C is not working'
cherry-picked from a8c7db34
2019-06-08 14:28:34 +07:00
Denis Fokin
8d9bac395e JBR-1583 Fight MAC OS X "Please call TIS/TSM in main thread!!!" message 2019-06-07 16:27:58 +03:00
Anton Tarasov
f652c790f4 Merge remote-tracking branch 'origin/master' 2019-06-07 15:21:58 +03:00
Anton Tarasov
8e59bb2f09 JBR-1582 IDEA EAP icon has low resolution on Mac 2019-06-07 15:21:28 +03:00
77 changed files with 4892 additions and 427 deletions

View File

@@ -43,7 +43,7 @@ $ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
## Linux (Ubuntu 18.10 desktop)
```
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev install libcups2-dev libfontconfig1-dev libasound2-dev
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev
$ cd JetBrainsRuntime
$ sh ./configure --disable-warnings-as-errors
@@ -54,7 +54,15 @@ $ make images
#### TBD
## OSX
#### TBD
install Xcode console tools, autoconf (via homebrew)
run
```
sh ./configure --prefix=$(pwd)/build --disable-warnings-as-errors
make images
```
## Contribution
We will be happy to receive your pull requests. Before you submit one, please sign our Contributor License Agreement (CLA) https://www.jetbrains.com/agreements/cla/

0
configure vendored Normal file → Executable file
View File

2
jb/project/jdk-cmake/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.idea
cmake-build-*

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,120 @@
#!/bin/bash
APP_DIRECTORY=$1
APPL_USER=$2
APPL_PASSWORD=$3
APP_NAME=$4
BUNDLE_ID=$5
FAKE_ROOT="${6:-fake-root}"
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
echo "Usage: $0 AppDirectory Username Password"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
function publish-log() {
id=$1
file=$2
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
}
function altool-upload() {
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
OLD_HOME="$HOME"
export HOME="$FAKE_ROOT/home"
export TMPDIR="$FAKE_ROOT/tmp"
mkdir -p "$HOME"
mkdir -p "$TMPDIR"
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
# Reduce amount of downloads, cache transporter libraries
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
if [[ -f "$shared_itmstransporter" ]]; then
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
fi
# For some reason altool prints everything to stderr, not stdout
set +e
xcrun altool --notarize-app \
--username "$APPL_USER" --password "$APPL_PASSWORD" \
--primary-bundle-id "$BUNDLE_ID" \
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
unset TMPDIR
export HOME="$OLD_HOME"
set -e
}
#immediately exit script with an error if a command fails
set -euo pipefail
file="$APP_NAME.zip"
log "Zipping $file..."
rm -rf "$file"
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY/Contents" "$file"
log "Notarizing $file..."
rm -rf "altool.init.out" "altool.check.out"
altool-upload "$file"
rm -rf "$file"
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
if [ -z "$notarization_info" ]; then
log "Faile to read RequestUUID from altool.init.out"
exit 10
fi
PATH="$PATH:/usr/local/bin/"
log "Notarization request sent, awaiting response"
spent=0
while true; do
# For some reason altool prints everything to stderr, not stdout
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
log "Current status: $status"
if [ "$status" = "invalid" ]; then
log "Notarization failed"
ec=1
elif [ "$status" = "success" ]; then
log "Notarization succeeded"
ec=0
else
if [ "$status" != "in progress" ]; then
log "Unknown notarization status, waiting more, altool output:"
cat "altool.check.out"
fi
if [[ $spent -gt 60 ]]; then
log "Waiting time out (apx 60 minutes)"
ec=2
break
fi
sleep 60
((spent += 1))
continue
fi
developer_log="developer_log.json"
log "Fetching $developer_log"
# TODO: Replace cut with trim or something better
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
wget "$url" -O "$developer_log" && cat "$developer_log" || true
if [ $ec != 0 ]; then
log "Publishing $developer_log"
publish-log "$notarization_info" "$developer_log"
fi
break
done
cat "altool.check.out"
rm -rf "altool.init.out" "altool.check.out"
exit $ec

View File

@@ -0,0 +1,93 @@
#!/bin/bash
APP_DIRECTORY=$1
JB_CERT=$2
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
echo "Usage: $0 AppDirectory CertificateID"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
#immediately exit script with an error if a command fails
set -euo pipefail
# Cleanup files left from previous sign attempt (if any)
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
log "Signing libraries and executables..."
# -perm +111 searches for executables
for f in \
"Contents/Home/bin" \
"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 \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
log "Signing libraries in jars in $PWD"
# todo: add set -euo pipefail; into the inner sh -c
# `-e` prevents `grep -q && printf` loginc
# with `-o pipefail` there's no input for 'while' loop
find "$APP_DIRECTORY" -name '*.jar' \
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
while IFS= read -r -d $'\0' file; do
log "Processing libraries in $file"
rm -rf jarfolder jar.jar
mkdir jarfolder
filename="${file##*/}"
log "Filename: $filename"
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
find jarfolder \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
(cd jarfolder; zip -q -r -o ../jar.jar .)
mv jar.jar "$file"
done
rm -rf jarfolder jar.jar
log "Signing other files..."
for f in \
"Contents/MacOS"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
#log "Signing executable..."
#codesign --timestamp \
# -v -s "$JB_CERT" --options=runtime \
# --force \
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
log "Signing whole app..."
codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--force \
--entitlements entitlements.xml "$APP_DIRECTORY"
log "Verifying java is not broken"
find "$APP_DIRECTORY" \
-type f -name 'java' -perm +111 -exec {} -version \;

View File

@@ -0,0 +1,121 @@
#!/bin/bash
#immediately exit script with an error if a command fails
set -euo pipefail
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true
INPUT_FILE=$1
EXPLODED=$2.exploded
USERNAME=$3
PASSWORD=$4
CODESIGN_STRING=$5
NOTARIZE=$6
BUNDLE_ID=$7
cd "$(dirname "$0")"
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
log "Deleting $EXPLODED ..."
if test -d "$EXPLODED"; then
find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
fi
rm -rf "$EXPLODED"
mkdir "$EXPLODED"
log "Unzipping $INPUT_FILE to $EXPLODED ..."
tar -xzvf "$INPUT_FILE" --directory $EXPLODED --exclude "jmods"
rm "$INPUT_FILE"
BUILD_NAME="$(ls "$EXPLODED")"
#log "$INPUT_FILE unzipped and removed"
log "$INPUT_FILE extracted and removed"
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
find "$APPLICATION_PATH/Contents/Home/bin" \
-maxdepth 1 -type f -name '*.jnilib' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Linking $file"
b="$(basename "$file" .jnilib)"
ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
fi
done
find "$APPLICATION_PATH/Contents/" \
-maxdepth 1 -type f -name '*.txt' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Moving $file"
mv "$file" "$APPLICATION_PATH/Contents/Resources"
fi
done
non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
if [[ $non_plist -gt 0 ]]; then
log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
exit 1
fi
log "Unlocking keychain..."
# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
attempt=1
limit=3
set +e
while [[ $attempt -le $limit ]]; do
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
ec=$?
if [[ $ec -ne 0 ]]; then
((attempt += 1))
if [ $attempt -eq $limit ]; then
set -e
fi
log "Signing failed, wait for 30 sec and try to sign again"
sleep 30
else
log "Signing done"
codesign -v "$APPLICATION_PATH" -vvvvv
log "Check sign done"
((attempt += limit))
fi
done
set -e
if [ "$NOTARIZE" = "yes" ]; then
log "Notarizing..."
# shellcheck disable=SC1090
source "$HOME/.notarize_token"
APP_NAME=$(echo ${INPUT_FILE} | awk -F"." '{ print $1 }')
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
FAKE_ROOT="$(pwd)/fake-root"
mkdir -p "$FAKE_ROOT"
echo "Notarization will use fake root: $FAKE_ROOT"
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME" "$BUNDLE_ID" "$FAKE_ROOT"
rm -rf "$FAKE_ROOT"
set +e
log "Stapling..."
xcrun stapler staple "$APPLICATION_PATH"
else
log "Notarization disabled"
log "Stapling disabled"
fi
log "Zipping $BUILD_NAME to $INPUT_FILE ..."
(
cd "$EXPLODED"
ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
log "Finished zipping"
)
rm -rf "$EXPLODED"
log "Done"

View File

@@ -543,12 +543,9 @@ endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
HARFBUZZ_CFLAGS += -DHAVE_SOLARIS_ATOMIC_OPS
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
HARFBUZZ_CFLAGS += -DHAVE_CORETEXT
endif
ifneq ($(OPENJDK_TARGET_OS), macosx)
LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
endif
LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-coretext.cc
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += harfbuzz/hb-ft.cc

View File

@@ -274,9 +274,9 @@ void ClassListParser::error(const char *msg, ...) {
// This function is used for loading classes for customized class loaders
// during archive dumping.
InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS) {
#if !(defined(_LP64) && (defined(LINUX)|| defined(SOLARIS)))
// The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit
//
#if !(defined(_LP64) && (defined(LINUX)|| defined(SOLARIS) || defined(__APPLE__) || defined(_WINDOWS) ))
// The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit and
// (3) MacOSX/64-bit and (4) Windows/64-bit
// This #if condition should be in sync with the areCustomLoadersSupportedForCDS
// method in test/lib/jdk/test/lib/Platform.java.
error("AppCDS custom class loaders not supported on this platform");
@@ -364,7 +364,11 @@ Klass* ClassListParser::load_current_class(TRAPS) {
if (!HAS_PENDING_EXCEPTION && (obj != NULL)) {
klass = java_lang_Class::as_Klass(obj);
} else { // load classes in bootclasspath/a
tty->print_cr("Class %s was not loaded from the system classloader", this->current_class_name());
if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
CLEAR_PENDING_EXCEPTION;
}
@@ -373,6 +377,7 @@ Klass* ClassListParser::load_current_class(TRAPS) {
if (k != NULL) {
klass = k;
} else {
tty->print_cr("Class %s is not found from SystemDictionary::resolve_or_null(..) == null", this->current_class_name());
if (!HAS_PENDING_EXCEPTION) {
THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
}

View File

@@ -270,6 +270,7 @@ InstanceKlass* ClassLoaderExt::load_class(Symbol* name, const char* path, TRAPS)
ClassFileStream* stream = NULL;
ClassPathEntry* e = find_classpath_entry_from_cache(path, CHECK_NULL);
if (e == NULL) {
tty->print_cr("Preload Warning: ClassPathEntry is not found for class %s and path %s", class_name, path);
return NULL;
}
{
@@ -336,12 +337,14 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path
struct stat st;
if (os::stat(path, &st) != 0) {
// File or directory not found
tty->print_cr("Preload Warning: Source path %s is not found", path);
return NULL;
}
ClassPathEntry* new_entry = NULL;
new_entry = create_class_path_entry(path, &st, false, false, CHECK_NULL);
if (new_entry == NULL) {
tty->print_cr("Preload Warning: The create_class_path_entry() call for path %s returned NULL", path);
return NULL;
}
ccpe._path = strdup(path);
@@ -351,5 +354,14 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path
}
Klass* ClassLoaderExt::load_one_class(ClassListParser* parser, TRAPS) {
return parser->load_current_class(THREAD);
Klass* result = parser->load_current_class(THREAD);
if (result == NULL) {
tty->print_cr("Preload Warning: Class %s was not loaded", parser->current_class_name());
if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
}
}
return result;
}

View File

@@ -1736,10 +1736,16 @@ int MetaspaceShared::preload_classes(const char* class_list_path, TRAPS) {
while (parser.parse_one_line()) {
Klass* klass = ClassLoaderExt::load_one_class(&parser, THREAD);
if (HAS_PENDING_EXCEPTION) {
if (klass == NULL &&
(PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassNotFoundException())) {
// print a warning only when the pending exception is class not found
tty->print_cr("Preload Warning: Cannot find %s", parser.current_class_name());
if (klass == NULL) {
if (PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassNotFoundException()) {
// print a warning only when the pending exception is class not found
tty->print_cr("Preload Warning: Cannot find %s", parser.current_class_name());
} else {
tty->print_cr("Preload Warning: Exception loading class %s", parser.current_class_name());
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
}
}
CLEAR_PENDING_EXCEPTION;
}
@@ -1787,6 +1793,11 @@ bool MetaspaceShared::try_link_class(InstanceKlass* ik, TRAPS) {
ResourceMark rm;
tty->print_cr("Preload Warning: Verification failed for %s",
ik->external_name());
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
CLEAR_PENDING_EXCEPTION;
ik->set_in_error_state();
_has_error_classes = true;

View File

@@ -82,11 +82,11 @@ public class AquaImageFactory {
}
static Image getGenericJavaIcon() {
return java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
return checkValidOrStub(java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
public Image run() {
return com.apple.eawt.Application.getApplication().getDockIconImage();
}
});
}));
}
static String getPathToThisApplication() {
@@ -496,4 +496,23 @@ public class AquaImageFactory {
public static Color getSelectionInactiveForegroundColorUIResource() {
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
}
private static class EmptyImage {
static final BufferedImage INSTANCE;
static {
INSTANCE = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics g = INSTANCE.createGraphics();
g.setColor(new Color(0, 0, 0, 0));
g.fillRect(0, 0, 16, 16);
g.dispose();
}
}
// [tav] a workaround for JBR-1492
private static Image checkValidOrStub(Image image) {
if (image == null || image.getWidth(null) <= 0 || image.getHeight(null) <= 0) {
return EmptyImage.INSTANCE;
}
return image;
}
}

View File

@@ -110,6 +110,7 @@ final class ScreenMenu extends Menu
final Component[] items = fInvoker.getMenuComponents();
if (needsUpdate(items, childHashArray)) {
removeAll();
fItems.clear();
if (count <= 0) return;
childHashArray = new int[count];
@@ -246,7 +247,7 @@ final class ScreenMenu extends Menu
synchronized (getTreeLock()) {
super.addNotify();
if (fModelPtr == 0) {
fInvoker.addContainerListener(this);
fInvoker.getPopupMenu().addContainerListener(this);
fInvoker.addComponentListener(this);
fPropertyListener = new ScreenMenuPropertyListener(this);
fInvoker.addPropertyChangeListener(fPropertyListener);
@@ -281,7 +282,7 @@ final class ScreenMenu extends Menu
if (fModelPtr != 0) {
removeMenuListeners(fModelPtr);
fModelPtr = 0;
fInvoker.removeContainerListener(this);
fInvoker.getPopupMenu().removeContainerListener(this);
fInvoker.removeComponentListener(this);
fInvoker.removePropertyChangeListener(fPropertyListener);
}
@@ -302,11 +303,10 @@ final class ScreenMenu extends Menu
@Override
public void componentRemoved(final ContainerEvent e) {
final Component child = e.getChild();
final MenuItem sm = fItems.get(child);
final MenuItem sm = fItems.remove(child);
if (sm == null) return;
remove(sm);
fItems.remove(sm);
}
/**

View File

@@ -36,7 +36,7 @@ import java.awt.geom.Rectangle2D;
// For some reason the JNI IsInstanceOf was not working correctly
// so we are checking the class specifically. If we subclass this
// we need to modify the native code in CFontWrapper.m
public final class CFont extends PhysicalFont implements FontSubstitution {
public final class CFont extends PhysicalFont implements FontSubstitution, FontWithDerivedItalic {
/* CFontStrike doesn't call these methods so they are unimplemented.
* They are here to meet the requirements of PhysicalFont, needed
@@ -266,4 +266,8 @@ public final class CFont extends PhysicalFont implements FontSubstitution {
", familyName: " + familyName + ", style: " + style +
" } aka: " + super.toString();
}
public Font2D createItalic() {
return this.createItalicVariant(true);
}
}

View File

@@ -27,6 +27,7 @@ package sun.font;
import java.awt.*;
import java.io.File;
import java.io.FilenameFilter;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
@@ -34,13 +35,11 @@ import java.util.HashMap;
import java.util.Hashtable;
import java.util.Locale;
import java.util.TreeMap;
import java.util.Vector;
import javax.swing.plaf.FontUIResource;
import sun.awt.FontConfiguration;
import sun.awt.HeadlessToolkit;
import sun.awt.util.ThreadGroupUtils;
import sun.lwawt.macosx.*;
public final class CFontManager extends SunFontManager {
@@ -141,6 +140,18 @@ public final class CFontManager extends SunFontManager {
}
}
@Override
protected void registerJREFonts() {
String[] files = AccessController.doPrivileged((PrivilegedAction<String[]>) () ->
new File(jreFontDirName).list(getTrueTypeFilter()));
if (files != null) {
for (String f : files) {
loadNativeDirFonts(jreFontDirName + File.separator + f);
}
}
}
protected void registerFontsInDir(final String dirName, boolean useJavaRasterizer,
int fontRank, boolean defer, boolean resolveSymLinks) {
@@ -162,42 +173,16 @@ public final class CFontManager extends SunFontManager {
private native void loadNativeFonts();
void registerFont(String fontName, String fontFamilyName) {
// Use different family for specific font faces
String newFontFamily = jreFamilyMap.get(fontName);
if (newFontFamily != null) {
fontFamilyName = newFontFamily;
}
final CFont font = new CFont(fontName, fontFamilyName);
registerGenericFont(font);
}
void registerItalicDerived() {
FontFamily[] famArr = FontFamily.getAllFontFamilies();
for (int i=0; i<famArr.length; i++) {
FontFamily family = famArr[i];
Font2D f2dPlain = family.getFont(Font.PLAIN);
if (f2dPlain != null && !(f2dPlain instanceof CFont)) continue;
Font2D f2dBold = family.getFont(Font.BOLD);
if (f2dBold != null && !(f2dBold instanceof CFont)) continue;
Font2D f2dItalic = family.getFont(Font.ITALIC);
if (f2dItalic != null && !(f2dItalic instanceof CFont)) continue;
Font2D f2dBoldItalic = family.getFont(Font.BOLD|Font.ITALIC);
if (f2dBoldItalic != null && !(f2dBoldItalic instanceof CFont)) continue;
CFont plain = (CFont)f2dPlain;
CFont bold = (CFont)f2dBold;
CFont italic = (CFont)f2dItalic;
CFont boldItalic = (CFont)f2dBoldItalic;
if (bold == null) bold = plain;
if (plain == null && bold == null) continue;
if (italic != null && boldItalic != null) continue;
if (plain != null && italic == null) {
registerGenericFont(plain.createItalicVariant(true), true);
}
if (bold != null && boldItalic == null) {
registerGenericFont(bold.createItalicVariant(true), true);
}
}
}
Object waitForFontsToBeLoaded = new Object();
private boolean loadedAllFonts = false;
@@ -211,7 +196,6 @@ public final class CFontManager extends SunFontManager {
public Object run() {
if (!loadedAllFonts) {
loadNativeFonts();
registerItalicDerived();
loadedAllFonts = true;
}
return null;

View File

@@ -1262,9 +1262,10 @@ public class LWWindowPeer
return false;
}
// if (platformWindow.rejectFocusRequest(cause)) {
// return false;
// }
if (platformWindow.rejectFocusRequest(cause)) {
rejectFocusRequest.run();
return false;
}
AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget());
KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor()
@@ -1307,7 +1308,7 @@ public class LWWindowPeer
// In case the toplevel is active but not focused, change focus directly,
// as requesting native focus on it will not have effect.
} else if (getTarget() == currentActive && !getTarget().hasFocus()) {
} else if (getTarget() == currentActive && !getTarget().isFocused()) {
changeFocusedWindow(true, opposite, lightweightRequest);
return true;
}

View File

@@ -44,6 +44,12 @@ final class CCursorManager extends LWCursorManager {
return theInstance;
}
private static void resetCurrentCursor() {
if (theInstance != null) {
theInstance.currentCursor = null;
}
}
private volatile Cursor currentCursor;
private CCursorManager() { }

View File

@@ -30,6 +30,7 @@
#import <JavaRuntimeSupport/JavaRuntimeSupport.h>
#import <Carbon/Carbon.h>
#import "jni_util.h"
#import "ThreadUtilities.h"
#import "AWTView.h"
#import "AWTWindow.h"
@@ -63,6 +64,7 @@ static BOOL shouldUsePressAndHold() {
return shouldUsePressAndHold;
}
extern bool isSystemShortcut_NextWindowInApplication(NSUInteger modifiersMask, NSString * chars);
@implementation AWTView
@@ -361,9 +363,7 @@ static BOOL shouldUsePressAndHold() {
NSUInteger deviceIndependentModifierFlagsMask =
[event modifierFlags] & NSDeviceIndependentModifierFlagsMask;
return ((deviceIndependentModifierFlagsMask == NSCommandKeyMask)
|| (deviceIndependentModifierFlagsMask == (NSCommandKeyMask & NSShiftKeyMask)))
&& [[event characters] isEqualToString:@"`"];
return isSystemShortcut_NextWindowInApplication(deviceIndependentModifierFlagsMask, [event characters]);
}
/**
@@ -436,6 +436,28 @@ static BOOL shouldUsePressAndHold() {
[AWTToolkit scrollStateWithEvent: event]);
CHECK_NULL(jEvent);
AWTWindow *awtWindow = (AWTWindow*)[event window];
if (![AWTWindow isAWTWindow: awtWindow]) {
NSLog(@"awt Window is not an AWTWindow instance");
return;
}
AWTWindow* aDelegate = (AWTWindow*)[awtWindow delegate];
jobject platformWindow = [aDelegate.javaPlatformWindow jObjectWithEnv:env];
if (platformWindow == nil) {
NSLog(@"Platform window is nil");
return;
}
static JNF_CLASS_CACHE(jc_PlatformWindow, "sun/lwawt/macosx/CPlatformWindow");
if (!JNFIsInstanceOf(env, platformWindow, &jc_PlatformWindow)) {
NSLog(@"Platform window is not an instance of CPlatformWindow");
}
static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
static JNF_MEMBER_CACHE(jm_deliverMouseEvent, jc_PlatformView, "deliverMouseEvent", "(Lsun/lwawt/macosx/NSEvent;)V");
jobject jlocal = (*env)->NewLocalRef(env, m_cPlatformView);

View File

@@ -73,6 +73,7 @@
// NSWindow overrides delegate methods
- (BOOL) canBecomeKeyWindow;
- (void) becomeKeyWindow;
- (BOOL) canBecomeMainWindow;
- (BOOL) worksWhenModal;
- (void)sendEvent:(NSEvent *)event;

View File

@@ -97,10 +97,19 @@ static NSPoint lastTopLeftPoint;
return [(AWTWindow*)[self delegate] worksWhenModal]; \
} \
\
- (void)cursorUpdate:(NSEvent *)event { \
/* Prevent cursor updates from OS side */ \
} \
\
- (void)sendEvent:(NSEvent *)event { \
[(AWTWindow*)[self delegate] sendEvent:event]; \
[super sendEvent:event]; \
}
} \
\
- (void)becomeKeyWindow { \
[super becomeKeyWindow]; \
[(AWTWindow*)[self delegate] becomeKeyWindow]; \
} \
@implementation AWTWindow_Normal
AWT_NS_WINDOW_IMPLEMENTATION
@@ -529,6 +538,17 @@ AWT_ASSERT_APPKIT_THREAD;
return self.isEnabled && (IS(self.styleBits, SHOULD_BECOME_KEY) || [self isSimpleWindowOwnedByEmbeddedFrame]);
}
- (void) becomeKeyWindow {
AWT_ASSERT_APPKIT_THREAD;
// Reset current cursor in CCursorManager such that any following mouse update event
// restores the correct cursor to the frame context specific one.
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_CLASS_CACHE(jc_CCursorManager, "sun/lwawt/macosx/CCursorManager");
static JNF_STATIC_MEMBER_CACHE(sjm_resetCurrentCursor, jc_CCursorManager, "resetCurrentCursor", "()V");
JNFCallStaticVoidMethod(env, sjm_resetCurrentCursor);
}
- (BOOL) canBecomeMainWindow {
AWT_ASSERT_APPKIT_THREAD;
if (!self.isEnabled) {
@@ -981,6 +1001,16 @@ JNF_COCOA_ENTER(env);
NSView *contentView = OBJC(contentViewPtr);
NSRect frameRect = NSMakeRect(x, y, w, h);
AWTWindow *owner = [OBJC(ownerPtr) delegate];
BOOL isIgnoreMouseEvents = NO;
static JNF_MEMBER_CACHE(jf_target, jc_CPlatformWindow, "target", "Ljava/awt/Window;");
jobject awtWindow = JNFGetObjectField(env, obj, jf_target);
if (awtWindow != NULL) {
static JNF_CLASS_CACHE(jc_Window, "java/awt/Window");
static JNF_MEMBER_CACHE(jm_isIgnoreMouseEvents, jc_Window, "isIgnoreMouseEvents", "()Z");
isIgnoreMouseEvents = JNFCallBooleanMethod(env, awtWindow, jm_isIgnoreMouseEvents) == JNI_TRUE ? YES : NO;
(*env)->DeleteLocalRef(env, awtWindow);
}
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow
@@ -990,7 +1020,12 @@ JNF_COCOA_ENTER(env);
contentView:contentView];
// the window is released is CPlatformWindow.nativeDispose()
if (window) [window.nsWindow retain];
if (window) {
[window.nsWindow retain];
if (isIgnoreMouseEvents) {
[window.nsWindow setIgnoresMouseEvents:YES];
}
}
}];
JNF_COCOA_EXIT(env);

View File

@@ -187,8 +187,9 @@ canChooseDirectories:(BOOL)inChooseDirectories
};
[thePanel beginSheetModalForWindow:fOwner completionHandler:^(NSInteger result) {
onComplete(result == NSFileHandlingPanelOKButton, YES);
onComplete(result == NSFileHandlingPanelOKButton, YES);
}];
[NSApp runModalForWindow:thePanel];
}
else

View File

@@ -59,17 +59,8 @@ extern jint* gButtonDownMasks;
#define kCFCoreFoundationVersionNumber10_13_Max 1499
#endif
#ifndef kCFCoreFoundationVersionNumber10_14_Max
#define kCFCoreFoundationVersionNumber10_14_Max 1599
#endif
#ifndef IS_OSX_GT10_13
#define IS_OSX_GT10_13 (floor(kCFCoreFoundationVersionNumber) > \
kCFCoreFoundationVersionNumber10_13_Max)
#endif
#ifndef IS_OSX_GT10_14
#define IS_OSX_GT10_14 (floor(kCFCoreFoundationVersionNumber) > \
kCFCoreFoundationVersionNumber10_14_Max)
#endif

View File

@@ -0,0 +1,781 @@
#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
#import "CRobotKeyCode.h"
#import "java_awt_event_KeyEvent.h"
#include <jni.h>
#include "jni_util.h"
extern JavaVM *jvm;
enum LOG_LEVEL {
LL_TRACE,
LL_DEBUG,
LL_INFO,
LL_WARNING,
LL_ERROR
};
void plog(int logLevel, const char *formatMsg, ...) {
if (!jvm)
return;
if (logLevel < LL_TRACE || logLevel > LL_ERROR || formatMsg == NULL)
return;
// TODO: check whether current logLevel is enabled in PlatformLogger
static jobject loggerObject = NULL;
static jclass clazz = NULL;
static jmethodID midTrace = NULL, midDebug = NULL, midInfo = NULL, midWarn = NULL, midError = NULL;
if (loggerObject == NULL) {
JNIEnv* env;
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void**)&env, NULL);
jclass shkClass = (*env)->FindClass(env, "java/awt/desktop/SystemHotkey");
if (shkClass == NULL)
return;
jfieldID fieldId = (*env)->GetStaticFieldID(env, shkClass, "ourLog", "Lsun/util/logging/PlatformLogger;");
if (fieldId == NULL)
return;
loggerObject = (*env)->GetStaticObjectField(env, shkClass, fieldId);
loggerObject = (*env)->NewGlobalRef(env, loggerObject);
clazz = (*env)->GetObjectClass(env, loggerObject);
if (clazz == NULL) {
NSLog(@"plogImpl: can't find PlatformLogger class");
return;
}
midTrace = (*env)->GetMethodID(env, clazz, "finest", "(Ljava/lang/String;)V");
midDebug = (*env)->GetMethodID(env, clazz, "fine", "(Ljava/lang/String;)V");
midInfo = (*env)->GetMethodID(env, clazz, "info", "(Ljava/lang/String;)V");
midWarn = (*env)->GetMethodID(env, clazz, "warning", "(Ljava/lang/String;)V");
midError = (*env)->GetMethodID(env, clazz, "severe", "(Ljava/lang/String;)V");
}
jmethodID mid = midTrace;
switch (logLevel) {
case LL_DEBUG: mid = midDebug; break;
case LL_INFO: mid = midInfo; break;
case LL_WARNING: mid = midWarn; break;
case LL_ERROR: mid = midError; break;
}
if (mid == NULL) {
NSLog(@"plogImpl: undefined log-method for level %d", logLevel);
return;
}
va_list args;
va_start(args, formatMsg);
const int bufSize = 512;
char buf[bufSize];
vsnprintf(buf, bufSize, formatMsg, args);
va_end(args);
JNIEnv* env;
jstring jstr;
(*jvm)->AttachCurrentThreadAsDaemon(jvm, (void**)&env, NULL);
jstr = (*env)->NewStringUTF(env, buf);
(*env)->CallVoidMethod(env, loggerObject, mid, jstr);
(*env)->DeleteLocalRef(env, jstr);
}
static const char * toCString(id obj) {
return obj == nil ? "nil" : [NSString stringWithFormat:@"%@", obj].UTF8String;
}
// Copy of java.awt.event.KeyEvent.[MODIFIER]_DOWN_MASK
static const int AWT_SHIFT_DOWN_MASK = 1 << 6;
static const int AWT_CTRL_DOWN_MASK = 1 << 7;
static const int AWT_META_DOWN_MASK = 1 << 8;
static const int AWT_ALT_DOWN_MASK = 1 << 9;
static int symbolicHotKeysModifiers2java(int mask) {
// NOTE: these masks doesn't coincide with macos events masks
// and can be used only to parse data from settings domain "com.apple.symbolichotkeys"
const int MACOS_SHIFT_MASK = 0x020000;
const int MACOS_CONTROL_MASK = 0x040000;
const int MACOS_OPTION_MASK = 0x080000;
const int MACOS_CMD_MASK = 0x100000;
int result = 0;
if (mask & MACOS_SHIFT_MASK)
result |= AWT_SHIFT_DOWN_MASK;
if (mask & MACOS_CONTROL_MASK)
result |= AWT_CTRL_DOWN_MASK;
if (mask & MACOS_OPTION_MASK)
result |= AWT_ALT_DOWN_MASK;
if (mask & MACOS_CMD_MASK)
result |= AWT_META_DOWN_MASK;
return result;
}
static NSString * getAppleSymbolicHotKeysDescription(int hotKeyId) {
static NSDictionary * hotkeyId2DescMap = nil;
if (hotkeyId2DescMap == nil) {
hotkeyId2DescMap = [NSDictionary dictionaryWithObjectsAndKeys:
@"Move focus to the menu bar", [NSNumber numberWithInt:7],
@"Move focus to the Dock", [NSNumber numberWithInt:8],
@"Move focus to active or next window", [NSNumber numberWithInt:9],
@"Move focus to window toolbar", [NSNumber numberWithInt:10],
@"Move focus to floating window", [NSNumber numberWithInt:11],
@"Change the way Tab moves focus", [NSNumber numberWithInt:13],
@"Turn zoom on or off", [NSNumber numberWithInt:15],
@"Zoom in", [NSNumber numberWithInt:17],
@"Zoom out", [NSNumber numberWithInt:19],
@"Reverse Black and White", [NSNumber numberWithInt:21],
@"Turn image smoothing on or off", [NSNumber numberWithInt:23],
@"Increase Contrast", [NSNumber numberWithInt:25],
@"Decrease Contrast", [NSNumber numberWithInt:26],
@"Move focus to the next window in application", [NSNumber numberWithInt:27],
@"Save picture of screen as file", [NSNumber numberWithInt:28],
@"Copy picture of screen to clipboard", [NSNumber numberWithInt:29],
@"Save picture of selected area as file", [NSNumber numberWithInt:30],
@"Copy picture of selected area to clipboard", [NSNumber numberWithInt:31],
@"All Windows", [NSNumber numberWithInt:32],
@"Application Windows", [NSNumber numberWithInt:33],
@"All Windows (Slow)", [NSNumber numberWithInt:34],
@"Application Windows (Slow)", [NSNumber numberWithInt:35],
@"Desktop", [NSNumber numberWithInt:36],
@"Desktop (Slow)", [NSNumber numberWithInt:37],
@"Move focus to the window drawer", [NSNumber numberWithInt:51],
@"Turn Dock Hiding On/Off", [NSNumber numberWithInt:52],
@"Move focus to the status menus", [NSNumber numberWithInt:57],
@"Turn VoiceOver on / off", [NSNumber numberWithInt:59],
@"Select the previous input source", [NSNumber numberWithInt:60],
@"Select the next source in the Input Menu", [NSNumber numberWithInt:61],
@"Dashboard", [NSNumber numberWithInt:62],
@"Dashboard (Slow)", [NSNumber numberWithInt:63],
@"Show Spotlight search field", [NSNumber numberWithInt:64],
@"Show Spotlight window", [NSNumber numberWithInt:65],
@"Dictionary MouseOver", [NSNumber numberWithInt:70],
@"Hide and show Front Row", [NSNumber numberWithInt:73],
@"Activate Spaces", [NSNumber numberWithInt:75],
@"Activate Spaces (Slow)", [NSNumber numberWithInt:76],
@"Spaces Left", [NSNumber numberWithInt:79],
@"Spaces Right", [NSNumber numberWithInt:81],
@"Spaces Down", [NSNumber numberWithInt:83],
@"Spaces Up", [NSNumber numberWithInt:85],
@"Show Help Menu", [NSNumber numberWithInt:91],
@"Show Help Menu", [NSNumber numberWithInt:92],
@"Show Help Menu", [NSNumber numberWithInt:98],
@"Switch to Space 1", [NSNumber numberWithInt:118],
@"Switch to Space 2", [NSNumber numberWithInt:119],
@"Switch to Space 3", [NSNumber numberWithInt:120],
@"Switch to Space 4", [NSNumber numberWithInt:121],
@"Show Launchpad", [NSNumber numberWithInt:160],
@"Show Accessibility Controls", [NSNumber numberWithInt:162],
@"Show Notification Center", [NSNumber numberWithInt:163],
@"Turn Do-Not-Disturb On/Off", [NSNumber numberWithInt:175],
@"Turn focus following On/Off", [NSNumber numberWithInt:179],
nil
];
[hotkeyId2DescMap retain];
}
return [hotkeyId2DescMap objectForKey : [NSNumber numberWithInt : hotKeyId]];
}
@interface DefaultParams: NSObject
@property (assign) BOOL enabled;
@property (strong) NSString *key_equivalent;
+(DefaultParams *) create:(NSString *)key_equivalent enabled:(BOOL)enabled;
@end
@implementation DefaultParams
+(DefaultParams *) create:(NSString *)key_equivalent enabled:(BOOL)enabled {
DefaultParams * result = [[[DefaultParams alloc] init] autorelease];
result.enabled = enabled;
result.key_equivalent = key_equivalent;
return result;
}
@end
static NSMutableDictionary * createDefaultParams();
static int NSModifiers2java(int mask) {
int result = 0;
if (mask & shiftKey)
result |= AWT_SHIFT_DOWN_MASK;
if (mask & controlKey)
result |= AWT_CTRL_DOWN_MASK;
if (mask & optionKey)
result |= AWT_ALT_DOWN_MASK;
if (mask & cmdKey)
result |= AWT_META_DOWN_MASK;
return result;
}
static int javaModifiers2NS(int jmask) {
int result = 0;
if (jmask & AWT_SHIFT_DOWN_MASK)
result |= NSShiftKeyMask;
if (jmask & AWT_CTRL_DOWN_MASK)
result |= NSControlKeyMask;
if (jmask & AWT_ALT_DOWN_MASK)
result |= NSAlternateKeyMask;
if (jmask & AWT_META_DOWN_MASK)
result |= NSCommandKeyMask;
return result;
}
typedef bool (^ Visitor)(int, const char *, int, const char *, int);
static void visitServicesShortcut(Visitor visitorBlock, NSString * key_equivalent, NSString * desc) {
// @ - command
// $ - shift
// ^ - control
// ~ - alt(option)
const bool modIsSHIFT = [key_equivalent containsString:@"$"];
const bool modIsCONTROL = [key_equivalent containsString:@"^"];
const bool modIsOPTION = [key_equivalent containsString:@"~"];
const bool modIsCMD = [key_equivalent containsString:@"@"];
int modifiers = 0;
if (modIsSHIFT)
modifiers |= AWT_SHIFT_DOWN_MASK;
if (modIsCONTROL)
modifiers |= AWT_CTRL_DOWN_MASK;
if (modIsOPTION)
modifiers |= AWT_ALT_DOWN_MASK;
if (modIsCMD)
modifiers |= AWT_META_DOWN_MASK;
NSCharacterSet * excludeSet = [NSCharacterSet characterSetWithCharactersInString:@"@$^~"];
NSString * keyChar = [key_equivalent stringByTrimmingCharactersInSet:excludeSet];
visitorBlock(-1, keyChar.UTF8String, modifiers, desc.UTF8String, -1);
}
void readSystemHotkeysImpl(Visitor visitorBlock) {
// 1. read from com.apple.symbolichotkeys.plist (domain with custom (user defined) shortcuts)
@try {
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
NSDictionary<NSString *,id> * shk = [defaults persistentDomainForName:@"com.apple.symbolichotkeys"];
if (shk != nil) {
// AppleSymbolicHotKeys = {
// 10 = {
// enabled = 1;
// value = {
// parameters = (
// 65535,
// 96,
// 8650752
// );
// type = standard;
// };
// };
// ......
// }
id hotkeys = [shk valueForKey:@"AppleSymbolicHotKeys"];
if (hotkeys == nil)
plog(LL_DEBUG, "key AppleSymbolicHotKeys doesn't exist in domain com.apple.symbolichotkeys");
else if (![hotkeys isKindOfClass:[NSDictionary class]])
plog(LL_DEBUG, "object for key 'AppleSymbolicHotKeys' isn't NSDictionary (class=%s)", [hotkeys className].UTF8String);
else {
for (id keyObj in hotkeys) {
if (![keyObj isKindOfClass:[NSString class]]) {
plog(LL_DEBUG, "key '%s' isn't instance of NSString (class=%s)", toCString(keyObj), [keyObj className].UTF8String);
continue;
}
NSString *hkNumber = keyObj;
id hkDesc = hotkeys[hkNumber];
if (![hkDesc isKindOfClass:[NSDictionary class]]) {
plog(LL_DEBUG, "hotkey descriptor '%s' isn't instance of NSDictionary (class=%s)", toCString(hkDesc), [hkDesc className].UTF8String);
continue;
}
NSDictionary<id, id> *sdict = hkDesc;
id objValue = sdict[@"value"];
if (objValue == nil)
continue;
if (![objValue isKindOfClass:[NSDictionary class]]) {
plog(LL_DEBUG, "property 'value' %s isn't instance of NSDictionary (class=%s)", toCString(objValue), [objValue className].UTF8String);
continue;
}
id objEnabled = sdict[@"enabled"];
BOOL enabled = objEnabled != nil && [objEnabled boolValue] == YES;
if (!enabled)
continue;
NSDictionary * value = objValue;
id objParams = value[@"parameters"];
if (![objParams isKindOfClass:[NSArray class]]) {
plog(LL_DEBUG, "property 'parameters' %s isn't instance of NSArray (class=%s)", toCString(objParams), [objParams className].UTF8String);
continue;
}
NSArray *parameters = objParams;
if ([parameters count] < 3) {
plog(LL_DEBUG, "too small lenght of parameters %d", [parameters count]);
continue;
}
id p0 = parameters[0];
id p1 = parameters[1];
id p2 = parameters[2];
if (![p0 isKindOfClass:[NSNumber class]] || ![p1 isKindOfClass:[NSNumber class]] || ![p2 isKindOfClass:[NSNumber class]]) {
plog(LL_DEBUG, "some of parameters isn't instance of NSNumber (%s, %s, %s)", [p0 className].UTF8String, [p1 className].UTF8String, [p2 className].UTF8String);
continue;
}
//parameter 1: ASCII code of the character (or 65535 - hex 0xFFFF - for non-ASCII characters).
//parameter 2: the keyboard key code for the character.
//Parameter 3: the sum of the control, command, shift and option keys. these are bits 17-20 in binary: shift is bit 17, control is bit 18, option is bit 19, and command is bit 20.
// 0x020000 => "Shift",
// 0x040000 => "Control",
// 0x080000 => "Option",
// 0x100000 => "Command"
int asciiCode = p0 == nil ? 0xFFFF : [p0 intValue];
int vkeyCode = p1 == nil ? -1 : [p1 intValue];
int modifiers = p2 == nil ? 0 : [p2 intValue];
char keyCharBuf[64];
const char * keyCharStr = keyCharBuf;
if (asciiCode >= 0 && asciiCode <= 0xFF) {
sprintf(keyCharBuf, "%c", asciiCode);
} else
keyCharStr = NULL;
NSString * description = getAppleSymbolicHotKeysDescription([hkNumber intValue]);
visitorBlock(vkeyCode, keyCharStr, symbolicHotKeysModifiers2java(modifiers), description == nil ? NULL : description.UTF8String, [hkNumber intValue]);
}
}
} else {
plog(LL_DEBUG, "domain com.apple.symbolichotkeys doesn't exist");
}
// 2. read from Pbs (domain with services shortcuts)
NSMutableDictionary * allDefParams = createDefaultParams();
NSDictionary<NSString *,id> * pbs = [defaults persistentDomainForName:@"pbs"];
if (pbs) {
// NSServicesStatus = {
// "com.apple.Terminal - Open man Page in Terminal - openManPage" = {
// "key_equivalent" = "@$m";
// };
// "com.apple.Terminal - Search man Page Index in Terminal - searchManPages" = {
// "enabled_context_menu" = 0;
// "enabled_services_menu" = 0;
// "key_equivalent" = "@$a";
// "presentation_modes" = {
// ContextMenu = 0;
// ServicesMenu = 0;
// };
// };
// };
// }
NSDictionary<NSString *, id> *services = [pbs valueForKey:@"NSServicesStatus"];
if (services) {
for (NSString *key in services) {
id value = services[key];
if (![value isKindOfClass:[NSDictionary class]]) {
plog(LL_DEBUG, "'%s' isn't instance of NSDictionary (class=%s)", toCString(value), [value className].UTF8String);
continue;
}
// NOTE: unchanged default params will not appear here, check allDefParams at the end of this loop
DefaultParams * defParams = [allDefParams objectForKey:key];
[allDefParams removeObjectForKey:key];
NSDictionary<NSString *, id> *sdict = value;
NSString *key_equivalent = sdict[@"key_equivalent"];
if (!key_equivalent && defParams != nil) {
key_equivalent = defParams.key_equivalent;
}
if (!key_equivalent)
continue;
NSString *enabled = sdict[@"enabled_services_menu"];
if (enabled != nil && [enabled boolValue] == NO) {
continue;
}
if (enabled == nil && defParams != nil && !defParams.enabled) {
continue;
}
visitServicesShortcut(visitorBlock, key_equivalent, key);
}
}
}
// Iterate through rest of allDefParams
for (NSString* key in allDefParams) {
DefaultParams * defParams = allDefParams[key];
if (!defParams.enabled) {
continue;
}
visitServicesShortcut(visitorBlock, defParams.key_equivalent, key);
}
#ifdef USE_CARBON_CopySymbolicHotKeys
// 3. read from core services
CFArrayRef registeredHotKeys;
if(CopySymbolicHotKeys(&registeredHotKeys) == noErr) {
CFIndex count = CFArrayGetCount(registeredHotKeys);
for(CFIndex i = 0; i < count; i++) {
CFDictionaryRef hotKeyInfo = CFArrayGetValueAtIndex(registeredHotKeys, i);
CFNumberRef hotKeyCode = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyCode);
CFNumberRef hotKeyModifiers = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyModifiers);
CFBooleanRef hotKeyEnabled = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyEnabled);
int64_t vkeyCode = -1;
CFNumberGetValue(hotKeyCode, kCFNumberSInt64Type, &vkeyCode);
int64_t keyModifiers = 0;
CFNumberGetValue(hotKeyModifiers, kCFNumberSInt64Type, &keyModifiers);
Boolean enabled = CFBooleanGetValue(hotKeyEnabled);
if (!enabled)
continue;
visitorBlock(vkeyCode, NULL, NSModifiers2java(keyModifiers), NULL, -1);
}
CFRelease(registeredHotKeys);
}
#endif // USE_CARBON_CopySymbolicHotKeys
}
@catch (NSException *exception) {
NSLog(@"readSystemHotkeys: catched exception, reason '%@'", exception.reason);
}
}
bool isSystemShortcut_NextWindowInApplication(NSUInteger modifiersMask, NSString * chars) {
const int shortcutUid_NextWindowInApplication = 27;
static NSString * shortcutCharacter = nil;
static int shortcutMask = 0;
if (shortcutCharacter == nil) {
readSystemHotkeysImpl(
^bool(int vkeyCode, const char * keyCharStr, int jmodifiers, const char * descriptionStr, int hotkeyUid) {
if (hotkeyUid != shortcutUid_NextWindowInApplication)
return true;
if (keyCharStr != NULL) {
shortcutCharacter = [[NSString stringWithFormat:@"%s", keyCharStr] retain];
shortcutMask = javaModifiers2NS(jmodifiers);
}
return false;
}
);
if (shortcutCharacter == nil) {
shortcutCharacter = @"`";
shortcutMask = NSCommandKeyMask;
}
}
return ((modifiersMask == shortcutMask)
|| (modifiersMask == (shortcutMask & NSShiftKeyMask)))
&& [chars isEqualToString:shortcutCharacter];
}
void Java_java_awt_desktop_SystemHotkeyReader_readSystemHotkeys(JNIEnv* env, jobject reader) {
jclass clsReader = (*env)->GetObjectClass(env, reader);
jmethodID methodAdd = (*env)->GetMethodID(env, clsReader, "add", "(ILjava/lang/String;ILjava/lang/String;)V");
readSystemHotkeysImpl(
^bool(int vkeyCode, const char * keyCharStr, int jmodifiers, const char * descriptionStr, int hotkeyUid){
jstring jkeyChar = keyCharStr == NULL ? NULL : (*env)->NewStringUTF(env, keyCharStr);
jstring jdesc = descriptionStr == NULL ? NULL : (*env)->NewStringUTF(env, descriptionStr);
(*env)->CallVoidMethod(
env, reader, methodAdd, (jint)vkeyCode, jkeyChar, (jint)jmodifiers, jdesc
);
return true;
}
);
}
jint Java_java_awt_desktop_SystemHotkeyReader_osx2java(JNIEnv* env, jclass clazz, jint osxKeyCode) {
static NSDictionary * osx2javaMap = nil;
if (osx2javaMap == nil) {
osx2javaMap = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_BACK_SPACE], [NSNumber numberWithInt:OSX_Delete],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_TAB], [NSNumber numberWithInt:OSX_kVK_Tab],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ENTER], [NSNumber numberWithInt:OSX_kVK_Return],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_CLEAR], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadClear],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_SHIFT], [NSNumber numberWithInt:OSX_Shift],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_CONTROL], [NSNumber numberWithInt:OSX_Control],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ALT], [NSNumber numberWithInt:OSX_Option],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ALT_GRAPH], [NSNumber numberWithInt:OSX_RightOption],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_CAPS_LOCK], [NSNumber numberWithInt:OSX_CapsLock],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ESCAPE], [NSNumber numberWithInt:OSX_Escape],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_SPACE], [NSNumber numberWithInt:OSX_kVK_Space],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_PAGE_UP], [NSNumber numberWithInt:OSX_PageUp],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_PAGE_DOWN], [NSNumber numberWithInt:OSX_PageDown],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_END], [NSNumber numberWithInt:OSX_End],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_HOME], [NSNumber numberWithInt:OSX_Home],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_LEFT], [NSNumber numberWithInt:OSX_LeftArrow],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_UP], [NSNumber numberWithInt:OSX_UpArrow],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_RIGHT], [NSNumber numberWithInt:OSX_RightArrow],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_DOWN], [NSNumber numberWithInt:OSX_DownArrow],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_COMMA], [NSNumber numberWithInt:OSX_kVK_ANSI_Comma],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_MINUS], [NSNumber numberWithInt:OSX_kVK_ANSI_Minus],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_PERIOD], [NSNumber numberWithInt:OSX_kVK_ANSI_Period],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_SLASH], [NSNumber numberWithInt:OSX_kVK_ANSI_Slash],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_0], [NSNumber numberWithInt:OSX_kVK_ANSI_0],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_1], [NSNumber numberWithInt:OSX_kVK_ANSI_1],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_2], [NSNumber numberWithInt:OSX_kVK_ANSI_2],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_3], [NSNumber numberWithInt:OSX_kVK_ANSI_3],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_4], [NSNumber numberWithInt:OSX_kVK_ANSI_4],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_5], [NSNumber numberWithInt:OSX_kVK_ANSI_5],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_6], [NSNumber numberWithInt:OSX_kVK_ANSI_6],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_7], [NSNumber numberWithInt:OSX_kVK_ANSI_7],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_8], [NSNumber numberWithInt:OSX_kVK_ANSI_8],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_9], [NSNumber numberWithInt:OSX_kVK_ANSI_9],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_SEMICOLON], [NSNumber numberWithInt:OSX_kVK_ANSI_Semicolon],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_EQUALS], [NSNumber numberWithInt:OSX_kVK_ANSI_Equal],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_A], [NSNumber numberWithInt:OSX_kVK_ANSI_A],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_B], [NSNumber numberWithInt:OSX_kVK_ANSI_B],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_C], [NSNumber numberWithInt:OSX_kVK_ANSI_C],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_D], [NSNumber numberWithInt:OSX_kVK_ANSI_D],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_E], [NSNumber numberWithInt:OSX_kVK_ANSI_E],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F], [NSNumber numberWithInt:OSX_kVK_ANSI_F],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_G], [NSNumber numberWithInt:OSX_kVK_ANSI_G],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_H], [NSNumber numberWithInt:OSX_kVK_ANSI_H],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_I], [NSNumber numberWithInt:OSX_kVK_ANSI_I],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_J], [NSNumber numberWithInt:OSX_kVK_ANSI_J],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_K], [NSNumber numberWithInt:OSX_kVK_ANSI_K],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_L], [NSNumber numberWithInt:OSX_kVK_ANSI_L],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_M], [NSNumber numberWithInt:OSX_kVK_ANSI_M],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_N], [NSNumber numberWithInt:OSX_kVK_ANSI_N],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_O], [NSNumber numberWithInt:OSX_kVK_ANSI_O],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_P], [NSNumber numberWithInt:OSX_kVK_ANSI_P],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_Q], [NSNumber numberWithInt:OSX_kVK_ANSI_Q],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_R], [NSNumber numberWithInt:OSX_kVK_ANSI_R],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_S], [NSNumber numberWithInt:OSX_kVK_ANSI_S],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_T], [NSNumber numberWithInt:OSX_kVK_ANSI_T],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_U], [NSNumber numberWithInt:OSX_kVK_ANSI_U],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_V], [NSNumber numberWithInt:OSX_kVK_ANSI_V],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_W], [NSNumber numberWithInt:OSX_kVK_ANSI_W],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_X], [NSNumber numberWithInt:OSX_kVK_ANSI_X],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_Y], [NSNumber numberWithInt:OSX_kVK_ANSI_Y],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_Z], [NSNumber numberWithInt:OSX_kVK_ANSI_Z],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_OPEN_BRACKET], [NSNumber numberWithInt:OSX_kVK_ANSI_LeftBracket],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_BACK_SLASH], [NSNumber numberWithInt:OSX_kVK_ANSI_Backslash],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_CLOSE_BRACKET], [NSNumber numberWithInt:OSX_kVK_ANSI_RightBracket],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD0], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad0],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD1], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad1],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD2], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad2],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD3], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad3],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD4], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad4],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD5], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad5],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD6], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad6],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD7], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad7],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD8], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad8],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_NUMPAD9], [NSNumber numberWithInt:OSX_kVK_ANSI_Keypad9],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_MULTIPLY], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadMultiply],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_ADD], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadPlus],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_SUBTRACT], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadMinus],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_DECIMAL], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadDecimal],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_DIVIDE], [NSNumber numberWithInt:OSX_kVK_ANSI_KeypadDivide],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F1], [NSNumber numberWithInt:OSX_F1],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F2], [NSNumber numberWithInt:OSX_F2],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F3], [NSNumber numberWithInt:OSX_F3],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F4], [NSNumber numberWithInt:OSX_F4],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F5], [NSNumber numberWithInt:OSX_F5],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F6], [NSNumber numberWithInt:OSX_F6],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F7], [NSNumber numberWithInt:OSX_F7],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F8], [NSNumber numberWithInt:OSX_F8],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F9], [NSNumber numberWithInt:OSX_F9],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F10], [NSNumber numberWithInt:OSX_F10],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F11], [NSNumber numberWithInt:OSX_F11],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F12], [NSNumber numberWithInt:OSX_F12],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_DELETE], [NSNumber numberWithInt:OSX_ForwardDelete],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_HELP], [NSNumber numberWithInt:OSX_Help],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_META], [NSNumber numberWithInt:OSX_Command],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_BACK_QUOTE], [NSNumber numberWithInt:OSX_kVK_ANSI_Grave],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_QUOTE], [NSNumber numberWithInt:OSX_kVK_ANSI_Quote],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F13], [NSNumber numberWithInt:OSX_F13],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F14], [NSNumber numberWithInt:OSX_F14],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F15], [NSNumber numberWithInt:OSX_F15],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F16], [NSNumber numberWithInt:OSX_F16],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F17], [NSNumber numberWithInt:OSX_F17],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F18], [NSNumber numberWithInt:OSX_F18],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F19], [NSNumber numberWithInt:OSX_F19],
[NSNumber numberWithInt:java_awt_event_KeyEvent_VK_F20], [NSNumber numberWithInt:OSX_F20],
nil
];
[osx2javaMap retain];
}
id val = [osx2javaMap objectForKey : [NSNumber numberWithInt : osxKeyCode]];
if (nil != val)
return [val intValue];
return java_awt_event_KeyEvent_VK_UNDEFINED;
}
jstring Java_java_awt_desktop_SystemHotkey_osxKeyCodeDescription(JNIEnv* env, jclass clazz, jint osxKeyCode) {
static NSDictionary * osxCode2DescMap = nil;
if (osxCode2DescMap == nil) {
osxCode2DescMap = [NSDictionary dictionaryWithObjectsAndKeys:
@"A", [NSNumber numberWithInt:kVK_ANSI_A],
@"S", [NSNumber numberWithInt:kVK_ANSI_S],
@"D", [NSNumber numberWithInt:kVK_ANSI_D],
@"F", [NSNumber numberWithInt:kVK_ANSI_F],
@"H", [NSNumber numberWithInt:kVK_ANSI_H],
@"G", [NSNumber numberWithInt:kVK_ANSI_G],
@"Z", [NSNumber numberWithInt:kVK_ANSI_Z],
@"X", [NSNumber numberWithInt:kVK_ANSI_X],
@"C", [NSNumber numberWithInt:kVK_ANSI_C],
@"V", [NSNumber numberWithInt:kVK_ANSI_V],
@"B", [NSNumber numberWithInt:kVK_ANSI_B],
@"Q", [NSNumber numberWithInt:kVK_ANSI_Q],
@"W", [NSNumber numberWithInt:kVK_ANSI_W],
@"E", [NSNumber numberWithInt:kVK_ANSI_E],
@"R", [NSNumber numberWithInt:kVK_ANSI_R],
@"Y", [NSNumber numberWithInt:kVK_ANSI_Y],
@"T", [NSNumber numberWithInt:kVK_ANSI_T],
@"1", [NSNumber numberWithInt:kVK_ANSI_1],
@"2", [NSNumber numberWithInt:kVK_ANSI_2],
@"3", [NSNumber numberWithInt:kVK_ANSI_3],
@"4", [NSNumber numberWithInt:kVK_ANSI_4],
@"6", [NSNumber numberWithInt:kVK_ANSI_6],
@"5", [NSNumber numberWithInt:kVK_ANSI_5],
@"Equal", [NSNumber numberWithInt:kVK_ANSI_Equal],
@"9", [NSNumber numberWithInt:kVK_ANSI_9],
@"7", [NSNumber numberWithInt:kVK_ANSI_7],
@"Minus", [NSNumber numberWithInt:kVK_ANSI_Minus],
@"8", [NSNumber numberWithInt:kVK_ANSI_8],
@"0", [NSNumber numberWithInt:kVK_ANSI_0],
@"RightBracket", [NSNumber numberWithInt:kVK_ANSI_RightBracket],
@"O", [NSNumber numberWithInt:kVK_ANSI_O],
@"U", [NSNumber numberWithInt:kVK_ANSI_U],
@"LeftBracket", [NSNumber numberWithInt:kVK_ANSI_LeftBracket],
@"I", [NSNumber numberWithInt:kVK_ANSI_I],
@"P", [NSNumber numberWithInt:kVK_ANSI_P],
@"L", [NSNumber numberWithInt:kVK_ANSI_L],
@"J", [NSNumber numberWithInt:kVK_ANSI_J],
@"Quote", [NSNumber numberWithInt:kVK_ANSI_Quote],
@"K", [NSNumber numberWithInt:kVK_ANSI_K],
@"Semicolon", [NSNumber numberWithInt:kVK_ANSI_Semicolon],
@"Backslash", [NSNumber numberWithInt:kVK_ANSI_Backslash],
@"Comma", [NSNumber numberWithInt:kVK_ANSI_Comma],
@"Slash", [NSNumber numberWithInt:kVK_ANSI_Slash],
@"N", [NSNumber numberWithInt:kVK_ANSI_N],
@"M", [NSNumber numberWithInt:kVK_ANSI_M],
@"Period", [NSNumber numberWithInt:kVK_ANSI_Period],
@"Grave", [NSNumber numberWithInt:kVK_ANSI_Grave],
@"KeypadDecimal", [NSNumber numberWithInt:kVK_ANSI_KeypadDecimal],
@"KeypadMultiply", [NSNumber numberWithInt:kVK_ANSI_KeypadMultiply],
@"KeypadPlus", [NSNumber numberWithInt:kVK_ANSI_KeypadPlus],
@"KeypadClear", [NSNumber numberWithInt:kVK_ANSI_KeypadClear],
@"KeypadDivide", [NSNumber numberWithInt:kVK_ANSI_KeypadDivide],
@"KeypadEnter", [NSNumber numberWithInt:kVK_ANSI_KeypadEnter],
@"KeypadMinus", [NSNumber numberWithInt:kVK_ANSI_KeypadMinus],
@"KeypadEquals", [NSNumber numberWithInt:kVK_ANSI_KeypadEquals],
@"Keypad0", [NSNumber numberWithInt:kVK_ANSI_Keypad0],
@"Keypad1", [NSNumber numberWithInt:kVK_ANSI_Keypad1],
@"Keypad2", [NSNumber numberWithInt:kVK_ANSI_Keypad2],
@"Keypad3", [NSNumber numberWithInt:kVK_ANSI_Keypad3],
@"Keypad4", [NSNumber numberWithInt:kVK_ANSI_Keypad4],
@"Keypad5", [NSNumber numberWithInt:kVK_ANSI_Keypad5],
@"Keypad6", [NSNumber numberWithInt:kVK_ANSI_Keypad6],
@"Keypad7", [NSNumber numberWithInt:kVK_ANSI_Keypad7],
@"Keypad8", [NSNumber numberWithInt:kVK_ANSI_Keypad8],
@"Keypad9", [NSNumber numberWithInt:kVK_ANSI_Keypad9],
/* keycodes for keys that are independent of keyboard layout*/
@"Return", [NSNumber numberWithInt:kVK_Return],
@"Tab", [NSNumber numberWithInt:kVK_Tab],
@"Space", [NSNumber numberWithInt:kVK_Space],
@"Delete", [NSNumber numberWithInt:kVK_Delete],
@"Escape", [NSNumber numberWithInt:kVK_Escape],
@"Command", [NSNumber numberWithInt:kVK_Command],
@"Shift", [NSNumber numberWithInt:kVK_Shift],
@"CapsLock", [NSNumber numberWithInt:kVK_CapsLock],
@"Option", [NSNumber numberWithInt:kVK_Option],
@"Control", [NSNumber numberWithInt:kVK_Control],
@"RightCommand", [NSNumber numberWithInt:kVK_RightCommand],
@"RightShift", [NSNumber numberWithInt:kVK_RightShift],
@"RightOption", [NSNumber numberWithInt:kVK_RightOption],
@"RightControl", [NSNumber numberWithInt:kVK_RightControl],
@"Function", [NSNumber numberWithInt:kVK_Function],
@"F17", [NSNumber numberWithInt:kVK_F17],
@"VolumeUp", [NSNumber numberWithInt:kVK_VolumeUp],
@"VolumeDown", [NSNumber numberWithInt:kVK_VolumeDown],
@"Mute", [NSNumber numberWithInt:kVK_Mute],
@"F18", [NSNumber numberWithInt:kVK_F18],
@"F19", [NSNumber numberWithInt:kVK_F19],
@"F20", [NSNumber numberWithInt:kVK_F20],
@"F5", [NSNumber numberWithInt:kVK_F5],
@"F6", [NSNumber numberWithInt:kVK_F6],
@"F7", [NSNumber numberWithInt:kVK_F7],
@"F3", [NSNumber numberWithInt:kVK_F3],
@"F8", [NSNumber numberWithInt:kVK_F8],
@"F9", [NSNumber numberWithInt:kVK_F9],
@"F11", [NSNumber numberWithInt:kVK_F11],
@"F13", [NSNumber numberWithInt:kVK_F13],
@"F16", [NSNumber numberWithInt:kVK_F16],
@"F14", [NSNumber numberWithInt:kVK_F14],
@"F10", [NSNumber numberWithInt:kVK_F10],
@"F12", [NSNumber numberWithInt:kVK_F12],
@"F15", [NSNumber numberWithInt:kVK_F15],
@"Help", [NSNumber numberWithInt:kVK_Help],
@"Home", [NSNumber numberWithInt:kVK_Home],
@"PageUp", [NSNumber numberWithInt:kVK_PageUp],
@"ForwardDelete", [NSNumber numberWithInt:kVK_ForwardDelete],
@"F4", [NSNumber numberWithInt:kVK_F4],
@"End", [NSNumber numberWithInt:kVK_End],
@"F2", [NSNumber numberWithInt:kVK_F2],
@"PageDown", [NSNumber numberWithInt:kVK_PageDown],
@"F1", [NSNumber numberWithInt:kVK_F1],
@"LeftArrow", [NSNumber numberWithInt:kVK_LeftArrow],
@"RightArrow", [NSNumber numberWithInt:kVK_RightArrow],
@"DownArrow", [NSNumber numberWithInt:kVK_DownArrow],
@"UpArrow", [NSNumber numberWithInt:kVK_UpArrow],
nil
];
[osxCode2DescMap retain];
}
NSString * val = [osxCode2DescMap objectForKey : [NSNumber numberWithInt : osxKeyCode]];
if (val == nil)
return NULL;
return (*env)->NewStringUTF(env, val.UTF8String);
}
static NSDictionary * getDefaultParams() {
static NSDictionary * sid2defaults = nil;
if (sid2defaults == nil) {
sid2defaults = [NSDictionary dictionaryWithObjectsAndKeys:
[DefaultParams create:@"@$b" enabled:NO], @"com.apple.BluetoothFileExchange - Send File To Bluetooth Device - sendFileUsingBluetoothOBEXService",
[DefaultParams create:@"@^$c" enabled:YES], @"com.apple.ChineseTextConverterService - Convert Text from Simplified to Traditional Chinese - convertTextToTraditionalChinese",
[DefaultParams create:@"@~^$c" enabled:YES], @"com.apple.ChineseTextConverterService - Convert Text from Traditional to Simplified Chinese - convertTextToSimplifiedChinese",
[DefaultParams create:@"@$l" enabled:YES], @"com.apple.Safari - Search With %WebSearchProvider@ - searchWithWebSearchProvider",
[DefaultParams create:@"@*" enabled:NO], @"com.apple.ScriptEditor2 - Script Editor/Get Result of AppleScript - runAsAppleScript",
[DefaultParams create:@"@$f" enabled:NO], @"com.apple.SpotlightService - SEARCH_WITH_SPOTLIGHT - doSearchWithSpotlight",
[DefaultParams create:@"@$y" enabled:YES], @"com.apple.Stickies - Make Sticky - makeStickyFromTextService",
[DefaultParams create:@"@$m" enabled:YES], @"com.apple.Terminal - Open man Page in Terminal - openManPage",
[DefaultParams create:@"@$a" enabled:YES], @"com.apple.Terminal - Search man Page Index in Terminal - searchManPages",
nil
];
[sid2defaults retain];
}
return sid2defaults;
}
static NSMutableDictionary * createDefaultParams() {
NSDictionary * sid2defaults = getDefaultParams();
NSMutableDictionary * result = [NSMutableDictionary dictionaryWithCapacity:[sid2defaults count]];
[result setDictionary:sid2defaults];
return result;
}

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,6 @@
#import "CGGlyphOutlines.h"
#import "CoreTextSupport.h"
#include "fontscalerdefs.h"
#import "LWCToolkit.h"
/* Use THIS_FILE when it is available. */
#ifndef THIS_FILE
@@ -162,7 +161,7 @@ JNF_COCOA_ENTER(env);
CGGlyph glyph;
const CTFontRef fallback = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtFont, glyphCode, &glyph);
const CGFontRef cgFallback = CTFontCopyGraphicsFont(fallback, NULL);
if (IS_OSX_GT10_14 || CGGI_IsColorFont(cgFallback)) {
if (CGGI_IsColorFont(cgFallback)) {
CGAffineTransform matrix = awtStrike->fAltTx;
CGFloat fontSize = sqrt(fabs(matrix.a * matrix.d - matrix.b * matrix.c));
CTFontRef font = CTFontCreateWithGraphicsFont(cgFallback, fontSize, NULL, NULL);

View File

@@ -31,7 +31,6 @@
#import "fontscalerdefs.h" // contains the definition of GlyphInfo struct
#import "sun_awt_SunHints.h"
#import "LWCToolkit.h"
//#define USE_IMAGE_ALIGNED_MEMORY 1
//#define CGGI_DEBUG 1
@@ -629,8 +628,7 @@ CGGI_CreateNewGlyphInfoFrom(CGSize advance, CGRect bbox,
static inline void
CGGI_CreateImageForGlyph
(CGFontRef cgFont, CGGI_GlyphCanvas *canvas, const CGGlyph glyph,
GlyphInfo *info, const CGGI_GlyphInfoDescriptor *glyphDescriptor, const AWTStrike *strike,
const bool isCatalinaOrAbove)
GlyphInfo *info, const CGGI_GlyphInfoDescriptor *glyphDescriptor, const AWTStrike *strike)
{
if (isnan(info->topLeftX) || isnan(info->topLeftY)) {
// Explicitly set glyphInfo width/height to be 0 to ensure
@@ -650,7 +648,7 @@ CGGI_CreateImageForGlyph
CGFloat x = -info->topLeftX;
CGFloat y = canvas->image->height + info->topLeftY;
if (isCatalinaOrAbove || glyphDescriptor == &argb) {
if (glyphDescriptor == &argb) {
CGAffineTransform matrix = CGContextGetTextMatrix(canvas->context);
CGFloat fontSize = sqrt(fabs(matrix.a * matrix.d - matrix.b * matrix.c));
CTFontRef font = CTFontCreateWithGraphicsFont(cgFont, fontSize, NULL, NULL);
@@ -694,8 +692,7 @@ CGGI_CreateImageForGlyph
static inline GlyphInfo *
CGGI_CreateImageForUnicode
(CGGI_GlyphCanvas *canvas, const AWTStrike *strike,
const CGGI_RenderingMode *mode, const UnicodeScalarValue uniChar,
const bool isCatalinaOrAbove)
const CGGI_RenderingMode *mode, const UnicodeScalarValue uniChar)
{
// save the state of the world
CGContextSaveGState(canvas->context);
@@ -740,7 +737,7 @@ CGGI_CreateImageForUnicode
CFRelease(cgFallback);
// clean the canvas - align, strike, and copy the glyph from the canvas into the info
CGGI_CreateImageForGlyph(cgFallback, canvas, glyph, info, glyphDescriptor, strike, isCatalinaOrAbove);
CGGI_CreateImageForGlyph(cgFallback, canvas, glyph, info, glyphDescriptor, strike);
// restore the state of the world
CGContextRestoreGState(canvas->context);
@@ -785,15 +782,14 @@ CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas,
CGGI_GlyphInfoDescriptor* mainFontDescriptor = CGGI_GetGlyphInfoDescriptor(mode, strike->fAWTFont->fNativeCGFont);
const bool isCatalinaOrAbove = IS_OSX_GT10_14;
CFIndex i;
for (i = 0; i < len; i++) {
GlyphInfo *info = (GlyphInfo *)jlong_to_ptr(glyphInfos[i]);
if (info != NULL) {
CGGI_CreateImageForGlyph(strike->fAWTFont->fNativeCGFont,
canvas, glyphs[i], info, mainFontDescriptor, strike, isCatalinaOrAbove);
canvas, glyphs[i], info, mainFontDescriptor, strike);
} else {
info = CGGI_CreateImageForUnicode(canvas, strike, mode, uniChars[i], isCatalinaOrAbove);
info = CGGI_CreateImageForUnicode(canvas, strike, mode, uniChars[i]);
glyphInfos[i] = ptr_to_jlong(info);
}
#ifdef CGGI_DEBUG

View File

@@ -50,7 +50,7 @@ BOOL postEventDuringEventSynthesis = NO;
* Subtypes of NSApplicationDefined, which are used for custom events.
*/
enum {
ExecuteBlockEvent = 777, NativeSyncQueueEvent
ExecuteBlockEvent, NativeSyncQueueEvent
};
@implementation NSApplicationAWT
@@ -366,15 +366,11 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
{
if ([event type] == NSApplicationDefined
&& TS_EQUAL([event timestamp], dummyEventTimestamp)
&& (short)[event subtype] == NativeSyncQueueEvent
&& [event data1] == NativeSyncQueueEvent
&& [event data2] == NativeSyncQueueEvent) {
&& [event subtype] == NativeSyncQueueEvent) {
[seenDummyEventLock lockWhenCondition:NO];
[seenDummyEventLock unlockWithCondition:YES];
} else if ([event type] == NSApplicationDefined
&& (short)[event subtype] == ExecuteBlockEvent
&& [event data1] != 0 && [event data2] == ExecuteBlockEvent) {
} else if ([event type] == NSApplicationDefined && [event subtype] == ExecuteBlockEvent) {
void (^block)() = (void (^)()) [event data1];
block();
[block release];
@@ -405,7 +401,7 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
context: nil
subtype: ExecuteBlockEvent
data1: encode
data2: ExecuteBlockEvent];
data2: 0];
[NSApp postEvent: event atStart: NO];
[pool drain];
@@ -423,8 +419,8 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
windowNumber: 0
context: nil
subtype: NativeSyncQueueEvent
data1: NativeSyncQueueEvent
data2: NativeSyncQueueEvent];
data1: 0
data2: 0];
if (useCocoa) {
[NSApp postEvent:event atStart:NO];
} else {

View File

@@ -615,7 +615,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
*/
long eventMask = AWTEvent.INPUT_METHODS_ENABLED_MASK;
private static final boolean INPUT_METHODS_DISABLED;
private static boolean INPUT_METHODS_DISABLED;
/**
* Static properties for incremental drawing.
@@ -10530,5 +10530,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
void updateZOrder() {
peer.setZOrder(getHWPeerAboveMe());
}
/**
* Disable IM-events dispatching (global).
* Usage of IM under Linux can cause freezes and crashes, disabling increases stability
*/
public static void disableInputMethodSupport() {
INPUT_METHODS_DISABLED = true;
}
}

View File

@@ -3984,6 +3984,19 @@ public class Window extends Container implements Accessible {
hasCustomDecoration = true;
}
private volatile boolean ignoreMouseEvents;
boolean isIgnoreMouseEvents() {
return ignoreMouseEvents;
}
/**
* Set via reflection (JB JdkEx API).
*/
void setIgnoreMouseEvents(boolean ignore) {
ignoreMouseEvents = ignore;
}
// ************************** MIXING CODE *******************************
// A window has an owner, but it does NOT have a container

View File

@@ -0,0 +1,87 @@
package java.awt.desktop;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import sun.util.logging.PlatformLogger;
import javax.swing.*;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
/**
* Provides info about system hotkeys
*/
public class SystemHotkey extends AWTKeyStroke {
private static final PlatformLogger ourLog = PlatformLogger.getLogger(java.awt.desktop.SystemHotkey.class.getName());
private static final Map<Integer, String> ourCodeDescriptionCache = new HashMap<>();
private final int myNativeKeyCode;
private final String myDescription;
SystemHotkey(char keyChar, int javaKeyCode, int javaModifiers, String description, int nativeKeyCode) {
super(keyChar, javaKeyCode, javaModifiers, true);
this.myNativeKeyCode = nativeKeyCode;
this.myDescription = description;
}
public String toString() {
return String.format("desc='%s' char=%s mod='%s' nativeKeyCode=0x%X ['%s'] javaKeyCode=0x%X",
String.valueOf(myDescription), String.valueOf(getKeyChar()), InputEvent.getModifiersExText(getModifiers()),
myNativeKeyCode, getOsxKeyCodeDescription(myNativeKeyCode), getKeyCode());
}
/**
* Gets hotkey description
* @return hotkey description
*/
public String getDescription() {
return myDescription;
}
/**
* Reads all registered hotkeys
* @return list of all registered hotkeys
*/
public static List<SystemHotkey> readSystemHotkeys() {
final SystemHotkeyReader reader = new SystemHotkeyReader();
reader.readSystemHotkeys();
return reader.getResult();
}
/**
* Gets virtual code description
* @param code (virtual keycode)
* @return virtual keycode description
*/
private static String getOsxKeyCodeDescription(int code) {
return ourCodeDescriptionCache.computeIfAbsent(code, (c)->{
final String desc = osxKeyCodeDescription(c);
return desc == null || desc.isEmpty() ? String.format("Unknown_key_code_0x%X", c) : desc;
});
}
private static native String osxKeyCodeDescription(int osxCode);
}
class SystemHotkeyReader {
private final List<SystemHotkey> myResult = new ArrayList<>();
void add(int keyCode, String keyChar, int modifiers, String desc) {
myResult.add(new SystemHotkey(
keyChar == null || keyChar.isEmpty() ? KeyEvent.CHAR_UNDEFINED : keyChar.charAt(0),
keyCode == -1 ? KeyEvent.VK_UNDEFINED : osx2java(keyCode),
modifiers, desc, keyCode
));
}
List<SystemHotkey> getResult() { return myResult; }
native void readSystemHotkeys();
private static native int osx2java(int osxCode);
}

View File

@@ -111,6 +111,10 @@ public abstract class FileFont extends PhysicalFont {
return 1; // DEFAULT_CHARSET
}
int getFontDataSize() {
return fileSize;
}
/*
* This is the public interface. The subclasses need to implement
* this. The returned block may be longer than the requested length.

View File

@@ -404,7 +404,8 @@ public class FileFontStrike extends PhysicalStrike {
int glyphCode,
boolean fracMetrics,
int rotation,
byte charset);
byte charset,
int fontDataSize);
private native long _getGlyphImageFromWindowsUsingDirectWrite(String family,
int style,
@@ -441,7 +442,12 @@ public class FileFontStrike extends PhysicalStrike {
}
if (ptr == 0) {
boolean fm = desc.fmHint == INTVAL_FRACTIONALMETRICS_ON;
ptr = _getGlyphImageFromWindows(family, style, size, glyphCode, fm, rotation, charset);
ptr = _getGlyphImageFromWindows(family, style, size, glyphCode, fm, rotation, charset,
fileFont.getFontDataSize());
if (ptr == 0 && FontUtilities.isLogging()) {
FontUtilities.getLogger().warning("Failed to render glyph via GDI: code=" + glyphCode
+ ", fontFamily=" + family + ", style=" + style + ", size=" + size + ", rotation=" + rotation);
}
if (ptr != 0 && fm) {
Point2D.Float metrics = new Point2D.Float();
fileFont.getGlyphMetrics(pScalerContext, glyphCode, metrics);

View File

@@ -53,7 +53,6 @@ public abstract class Font2D {
public static final int NATIVE_RANK = 5;
public static final int UNKNOWN_RANK = 6;
public static final int DEFAULT_RANK = 4;
public static final int IDEA_RANK = 7;
private static final String[] boldNames = {
"bold", "demibold", "demi-bold", "demi bold", "negreta", "demi", "black", "coder-b"};

View File

@@ -28,10 +28,8 @@ package sun.font;
import java.io.File;
import java.awt.Font;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.Locale;
public class FontFamily {
@@ -44,6 +42,8 @@ public class FontFamily {
protected Font2D bold;
protected Font2D italic;
protected Font2D bolditalic;
private final List<FontAndStyle> fontSequence = new ArrayList<FontAndStyle>();
private boolean initialized = false;
protected boolean logicalFont = false;
protected int familyRank;
@@ -66,6 +66,7 @@ public class FontFamily {
if (family == null) {
return;
}
family.ensureFontsLoaded();
if (family.plain == font2D) {
family.plain = null;
}
@@ -244,16 +245,51 @@ public class FontFamily {
}
FontUtilities.getLogger().info(msg);
}
synchronized (fontSequence) {
if (initialized) {
doSetFont(font, style);
return;
}
fontSequence.add(new FontAndStyle(font, style));
}
}
private void ensureFontsLoaded() {
synchronized (fontSequence) {
if (initialized) {
return;
}
if (FontUtilities.isMacOSX) {
fontSequence.sort(Comparator.comparing(FontAndStyle::getWeight));
}
for (FontAndStyle fontAndStyle : fontSequence) {
doSetFont(fontAndStyle.font, fontAndStyle.style);
}
if (italic == null && plain instanceof FontWithDerivedItalic) {
italic = ((FontWithDerivedItalic)plain).createItalic();
}
if (bolditalic == null) {
Font2D boldItalicPrototype = bold != null ? bold : plain;
if (boldItalicPrototype instanceof FontWithDerivedItalic) {
bolditalic = ((FontWithDerivedItalic)boldItalicPrototype).createItalic();
}
}
fontSequence.clear();
initialized = true;
}
}
private void doSetFont(Font2D font, int style) {
/* Allow a lower-rank font only if its a file font
* from the exact same source as any previous font.
*/
if ((font.getRank() > familyRank) && !isFromSameSource(font)) {
if (FontUtilities.isLogging()) {
FontUtilities.getLogger()
.warning("Rejecting adding " + font +
" of lower rank " + font.getRank() +
" to family " + this +
" of rank " + familyRank);
.warning("Rejecting adding " + font +
" of lower rank " + font.getRank() +
" to family " + this +
" of rank " + familyRank);
}
return;
}
@@ -290,7 +326,7 @@ public class FontFamily {
}
public Font2D getFontWithExactStyleMatch(int style) {
ensureFontsLoaded();
switch (style) {
case Font.PLAIN:
@@ -319,7 +355,7 @@ public class FontFamily {
* same location.
*/
public Font2D getFont(int style) {
ensureFontsLoaded();
switch (style) {
case Font.PLAIN:
@@ -367,7 +403,7 @@ public class FontFamily {
* it might as well be from the same family.
*/
Font2D getClosestStyle(int style) {
ensureFontsLoaded();
switch (style) {
/* if you ask for a plain font try to return a non-italic one,
* then a italic one, finally a bold italic one */
@@ -444,8 +480,23 @@ public class FontFamily {
" plain="+plain+
" bold=" + bold +
" italic=" + italic +
" bolditalic=" + bolditalic;
" bolditalic=" + bolditalic +
" initialized=" + initialized;
}
private static class FontAndStyle {
private final Font2D font;
private final int style;
private FontAndStyle(Font2D inFont, int inStyle) {
font = inFont;
style = inStyle;
}
int getWeight() {
return font.getWeight();
}
}
}

View File

@@ -0,0 +1,5 @@
package sun.font;
interface FontWithDerivedItalic {
Font2D createItalic();
}

View File

@@ -82,27 +82,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
}
private static class TTFilterIdea extends TTFilter {
final private boolean positive;
final private HashSet<String> ideaSet;
public TTFilterIdea(boolean positive, HashSet<String> ideaSet) {
this.positive = positive;
this.ideaSet = ideaSet;
}
@Override
public boolean accept(File dir, String name) {
if (super.accept(dir, name)) {
if (ideaSet.contains(name))
return positive;
else
return !positive;
}
return false;
}
}
private static class T1Filter implements FilenameFilter {
public boolean accept(File dir,String name) {
if (noType1Font) {
@@ -208,9 +187,9 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private boolean loaded1dot0Fonts = false;
boolean loadedAllFonts = false;
boolean loadedAllFontFiles = false;
HashMap<String,String> jreFontMap;
HashSet<String> jreBundledFontFiles;
HashSet<String> ideaFontSet;
private HashMap<String,String> jreFontMap;
private HashSet<String> jreBundledFontFiles;
HashMap<String,String> jreFamilyMap;
String[] jreOtherFontFiles;
boolean noOtherJREFontFiles = false; // initial assumption.
@@ -246,8 +225,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private static final FilenameFilter ttFilter = new TTFilter();
private static final FilenameFilter t1Filter = new T1Filter();
private FilenameFilter ttFilterIdea;
private FilenameFilter ttFilterJre;
private Font[] allFonts;
private String[] allFamilies; // cache for default locale only
private Locale lastDefaultLocale;
@@ -304,6 +281,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
*/
jreFontMap = new HashMap<String, String>();
jreBundledFontFiles = new HashSet<String>();
jreFamilyMap = new HashMap<>();
/* Droid Sans Mono Family */
jreFontMap.put("droid sans0", "DroidSans.ttf");
@@ -332,6 +310,10 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
jreFontMap.put("FiraCode retina", "FiraCode-Retina.ttf");
jreFontMap.put("FiraCode regular", "FiraCode-Regular.ttf");
jreFamilyMap.put("FiraCode-Medium", "Fira Code Medium");
jreFamilyMap.put("FiraCode-Retina", "Fira Code Retina");
jreFamilyMap.put("FiraCode-Light", "Fira Code Light");
jreFontMap.put("SourceCodePro bold italic", "SourceCodePro-BoldIt.ttf");
jreFontMap.put("SourceCodePro regular", "SourceCodePro-Regular.ttf");
jreFontMap.put("SourceCodePro bold", "SourceCodePro-Bold.ttf");
@@ -342,26 +324,15 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
jreFontMap.put("Roboto light", "Roboto-Light.ttf");
jreFontMap.put("Roboto thin", "Roboto-Thin.ttf");
ideaFontSet = new HashSet<>();
ideaFontSet.add("FiraCode-Bold.ttf");
ideaFontSet.add("FiraCode-Light.ttf");
ideaFontSet.add("FiraCode-Medium.ttf");
ideaFontSet.add("FiraCode-Retina.ttf");
ideaFontSet.add("FiraCode-Regular.ttf");
ideaFontSet.add("SourceCodePro-BoldIt.ttf");
ideaFontSet.add("SourceCodePro-Regular.ttf");
ideaFontSet.add("SourceCodePro-Bold.ttf");
ideaFontSet.add("SourceCodePro-It.ttf");
ideaFontSet.add("Inconsolata.ttf");
ideaFontSet.add("Roboto-Light.ttf");
ideaFontSet.add("Roboto-Thin.ttf");
jreFamilyMap.put("Roboto-Light", "Roboto Light");
jreFamilyMap.put("Roboto-Thin", "Roboto Thin");
ttFilterIdea = new TTFilterIdea(true, ideaFontSet);
ttFilterJre = new TTFilterIdea(false, ideaFontSet);
jreFontMap.put("JetBrains Mono Bold", "JetBrainsMono-Bold.ttf");
jreFontMap.put("JetBrains Mono Regular", "JetBrainsMono-Regular.ttf");
jreFontMap.put("JetBrains Mono Italic", "JetBrainsMono-Italic.ttf");
jreFontMap.put("JetBrains Mono Bold Italic", "JetBrainsMono-Bold-Italic.ttf");
for (String ffile : jreFontMap.values()) {
jreBundledFontFiles.add(ffile);
}
jreBundledFontFiles.addAll(jreFontMap.values());
}
static {
@@ -3364,14 +3335,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
protected void registerJREFonts() {
File pathFile = new File(jreFontDirName);
addDirFonts(jreFontDirName, pathFile, ttFilterIdea,
FONTFORMAT_TRUETYPE, true,
Font2D.IDEA_RANK,
true, false);
addDirFonts(jreFontDirName, pathFile, ttFilterJre,
FONTFORMAT_TRUETYPE, true,
Font2D.JRE_RANK,
registerFontsInDir(jreFontDirName, true, Font2D.JRE_RANK,
true, false);
}

View File

@@ -181,6 +181,7 @@ public class TrueTypeFont extends FileFont {
private String localeFullName;
private Byte supportedCharset;
private int fontDataSize;
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
boolean javaRasterizer)
@@ -539,11 +540,13 @@ public class TrueTypeFont extends FileFont {
fontIndex = fIndex;
buffer = readBlock(TTCHEADERSIZE+4*fIndex, 4);
headerOffset = buffer.getInt();
fontDataSize = Math.max(0, fileSize - headerOffset);
break;
case v1ttTag:
case trueTag:
case ottoTag:
fontDataSize = fileSize;
break;
default:
@@ -1780,6 +1783,11 @@ public class TrueTypeFont extends FileFont {
private static native void getSupportedCharsetsForFamily(String familyName, Map<String, Byte> supportedCharsets);
@Override
int getFontDataSize() {
return fontDataSize;
}
@Override
public String toString() {
return "** TrueType Font: Family="+familyName+ " Name="+fullName+

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
169
449
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-adobe-standard
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-ascii-0
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-iso10646-1
@@ -168,3 +168,283 @@ DroidSerif-Regular.ttf -misc-droid serif-medium-r-normal--0-0-0-0-p-0-koi8-ru
DroidSerif-Regular.ttf -misc-droid serif-medium-r-normal--0-0-0-0-p-0-koi8-u
DroidSerif-Regular.ttf -misc-droid serif-medium-r-normal--0-0-0-0-p-0-koi8-uni
DroidSerif-Regular.ttf -misc-droid serif-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-ascii-0
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-ibm-cp850
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-ibm-cp852
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-ibm-cp866
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso10646-1
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-1
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-10
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-13
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-15
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-16
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-2
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-3
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-4
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-5
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-iso8859-9
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-koi8-e
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-koi8-r
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-koi8-ru
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-koi8-u
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-koi8-uni
FiraCode-Bold.ttf -misc-fira code-bold-r-normal--0-0-0-0-m-0-microsoft-cp1252
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-ascii-0
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-ibm-cp850
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-ibm-cp852
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-ibm-cp866
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso10646-1
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-1
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-10
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-13
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-15
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-16
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-2
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-3
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-4
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-5
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-iso8859-9
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-koi8-e
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-koi8-r
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-koi8-ru
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-koi8-u
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-koi8-uni
FiraCode-Light.ttf -misc-fira code light-light-r-normal--0-0-0-0-m-0-microsoft-cp1252
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-ascii-0
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-ibm-cp850
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-ibm-cp852
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-ibm-cp866
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso10646-1
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-1
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-10
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-13
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-15
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-16
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-2
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-3
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-4
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-5
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-iso8859-9
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-koi8-e
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-koi8-r
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-koi8-ru
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-koi8-u
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-koi8-uni
FiraCode-Medium.ttf -misc-fira code medium-medium-r-normal--0-0-0-0-m-0-microsoft-cp1252
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-ascii-0
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-ibm-cp850
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-ibm-cp852
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-ibm-cp866
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso10646-1
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-1
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-10
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-13
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-15
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-16
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-2
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-3
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-4
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-5
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-iso8859-9
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-koi8-e
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-koi8-r
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-koi8-ru
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-koi8-u
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-koi8-uni
FiraCode-Regular.ttf -misc-fira code-medium-r-normal--0-0-0-0-m-0-microsoft-cp1252
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-ascii-0
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-ibm-cp850
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-ibm-cp852
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-ibm-cp866
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso10646-1
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-1
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-10
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-13
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-15
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-16
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-2
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-3
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-4
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-5
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-iso8859-9
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-koi8-e
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-koi8-r
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-koi8-ru
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-koi8-u
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-koi8-uni
FiraCode-Retina.ttf -misc-fira code retina-medium-r-normal--0-0-0-0-m-0-microsoft-cp1252
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-ascii-0
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso10646-1
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-1
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-15
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-2
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-9
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-adobe-standard
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-ascii-0
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso10646-1
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-1
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-10
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-13
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-15
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-16
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-2
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-3
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-4
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-5
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso8859-9
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-koi8-e
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-koi8-r
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-koi8-ru
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-koi8-u
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-koi8-uni
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-microsoft-cp1252
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-adobe-standard
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-ascii-0
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso10646-1
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-1
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-10
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-13
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-15
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-2
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-3
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-4
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-5
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-iso8859-9
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-koi8-e
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-koi8-r
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-koi8-ru
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-koi8-u
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-koi8-uni
Roboto-Thin.ttf -misc-roboto thin-light-r-normal--0-0-0-0-p-0-microsoft-cp1252
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-adobe-standard
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-ascii-0
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-ibm-cp437
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-ibm-cp850
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-ibm-cp852
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-ibm-cp866
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso10646-1
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-1
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-10
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-13
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-15
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-16
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-2
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-3
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-4
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-5
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-iso8859-9
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-koi8-e
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-koi8-r
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-koi8-ru
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-koi8-u
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-koi8-uni
SourceCodePro-Bold.ttf -adobe-source code pro-bold-r-normal--0-0-0-0-m-0-microsoft-cp1252
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-adobe-standard
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-ascii-0
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-ibm-cp850
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-ibm-cp852
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso10646-1
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-1
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-10
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-13
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-15
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-16
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-2
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-3
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-4
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-iso8859-9
SourceCodePro-BoldIt.ttf -adobe-source code pro-bold-i-normal--0-0-0-0-m-0-microsoft-cp1252
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-adobe-standard
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-ascii-0
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-ibm-cp850
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-ibm-cp852
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso10646-1
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-1
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-10
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-13
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-15
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-16
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-2
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-3
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-4
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-iso8859-9
SourceCodePro-It.ttf -adobe-source code pro-medium-i-normal--0-0-0-0-m-0-microsoft-cp1252
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-adobe-standard
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-ascii-0
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-ibm-cp437
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-ibm-cp850
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-ibm-cp852
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-ibm-cp866
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso10646-1
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-1
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-10
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-13
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-15
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-16
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-2
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-3
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-4
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-5
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-iso8859-9
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-koi8-e
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-koi8-r
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-koi8-ru
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-koi8-u
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-koi8-uni
SourceCodePro-Regular.ttf -adobe-source code pro-medium-r-normal--0-0-0-0-m-0-microsoft-cp1252

View File

@@ -30,14 +30,12 @@
#include "sun_font_FreetypeFontScaler.h"
#include <stdlib.h>
#if defined(_WIN32) || defined(MACOSX)
#define DISABLE_FONTCONFIG
#endif
#include <math.h>
#ifndef DISABLE_FONTCONFIG
#if !defined(_WIN32) && !defined(__APPLE_)
#include <dlfcn.h>
#else
#define DISABLE_FONTCONFIG
#endif
#include "ft2build.h"
@@ -48,6 +46,7 @@
#include FT_SIZES_H
#include FT_OUTLINE_H
#include FT_SYNTHESIS_H
#include FT_MODULE_H
#include FT_LCD_FILTER_H
#ifndef DISABLE_FONTCONFIG
@@ -447,6 +446,52 @@ static unsigned long ReadTTFontFileFunc(FT_Stream stream,
}
}
typedef FT_Error (*FT_Prop_Set_Func)(FT_Library library,
const FT_String* module_name,
const FT_String* property_name,
const void* value );
/**
* Prefer the older v35 freetype byte code interpreter.
*/
static void setInterpreterVersion(FT_Library library) {
char* props = getenv("FREETYPE_PROPERTIES");
int version = 35;
const char* module = "truetype";
const char* property = "interpreter-version";
/* If some one is setting this, don't override it */
if (props != NULL && strstr(property, props)) {
return;
}
/*
* FT_Property_Set was introduced in 2.4.11.
* Some older supported Linux OSes may not include it so look
* this up dynamically.
* And if its not available it doesn't matter, since the reason
* we need it dates from 2.7.
* On Windows & Mac the library is always bundled so it is safe
* to use directly in those cases.
*/
#if defined(_WIN32) || defined(__APPLE__)
FT_Property_Set(library, module, property, (void*)(&version));
#else
void *lib = dlopen("libfreetype.so", RTLD_LOCAL|RTLD_LAZY);
if (lib == NULL) {
lib = dlopen("libfreetype.so.6", RTLD_LOCAL|RTLD_LAZY);
if (lib == NULL) {
return;
}
}
FT_Prop_Set_Func func = (FT_Prop_Set_Func)dlsym(lib, "FT_Property_Set");
if (func != NULL) {
func(library, module, property, (void*)(&version));
}
dlclose(lib);
#endif
}
/*
* Class: sun_font_FreetypeFontScaler
* Method: initNativeScaler
@@ -486,6 +531,7 @@ Java_sun_font_FreetypeFontScaler_initNativeScaler(
free(scalerInfo);
return 0;
}
setInterpreterVersion(scalerInfo->library);
#define TYPE1_FROM_JAVA 2
@@ -662,16 +708,40 @@ static void setupLoadRenderFlags(FTScalerContext *context, int fcHintStyle, FcBo
}
#endif
// values used by FreeType (as of version 2.10.1) for italics transformation matrix in FT_GlyphSlot_Oblique
#define FT_MATRIX_ONE 0x10000
#define FT_MATRIX_OBLIQUE_XY 0x0366A
static void setupTransform(FT_Matrix* target, FTScalerContext *context) {
FT_Matrix* transform = &context->transform;
if (context->doItalize) {
// we cannot use FT_GlyphSlot_Oblique as it doesn't work well with arbitrary transforms,
// so we add corresponding shear transform to the requested glyph transformation
target->xx = FT_MATRIX_ONE;
target->xy = FT_MATRIX_OBLIQUE_XY;
target->yx = 0;
target->yy = FT_MATRIX_ONE;
FT_Matrix_Multiply(transform, target);
} else {
target->xx = transform->xx;
target->xy = transform->xy;
target->yx = transform->yx;
target->yy = transform->yy;
}
}
static int setupFTContext(JNIEnv *env, jobject font2D, FTScalerInfo *scalerInfo, FTScalerContext *context,
FT_Bool configureFont) {
FT_Matrix matrix;
int errCode = 0;
scalerInfo->env = env;
scalerInfo->font2D = font2D;
if (context != NULL) {
FT_UInt dpi = (FT_UInt) getScreenResolution(env);
FT_Set_Transform(scalerInfo->face, &context->transform, NULL);
setupTransform(&matrix, context);
FT_Set_Transform(scalerInfo->face, &matrix, NULL);
FT_UInt dpi = (FT_UInt) getScreenResolution(env);
errCode = FT_Set_Char_Size(scalerInfo->face, 0, ADJUST_FONT_SIZE(context->ptsz, dpi), dpi, dpi);
if (errCode) return errCode;
@@ -869,11 +939,8 @@ static int setupFTContext(JNIEnv *env, jobject font2D, FTScalerInfo *scalerInfo,
return 0;
}
/* ftsynth.c uses (0x10000, 0x0366A, 0x0, 0x10000) matrix to get oblique
outline. Therefore x coordinate will change by 0x0366A*y.
Note that y coordinate does not change. These values are based on
libfreetype version 2.9.1. */
#define OBLIQUE_MODIFIER(y) (context->doItalize ? ((y)*0x366A/0x10000) : 0)
// using same values as for the transformation matrix
#define OBLIQUE_MODIFIER(y) (context->doItalize ? ((y)*FT_MATRIX_OBLIQUE_XY/FT_MATRIX_ONE) : 0)
/* FT_GlyphSlot_Embolden (ftsynth.c) uses FT_MulFix(units_per_EM, y_scale) / 24
* strength value when glyph format is FT_GLYPH_FORMAT_OUTLINE. This value has
@@ -1242,9 +1309,6 @@ Java_sun_font_FreetypeFontScaler_getGlyphImageNative(
if (context->doBold) { /* if bold style */
FT_GlyphSlot_Embolden(ftglyph);
}
if (context->doItalize) { /* if oblique */
FT_GlyphSlot_Oblique(ftglyph);
}
/* generate bitmap if it is not done yet
e.g. if algorithmic styling is performed and style was added to outline */
@@ -1470,9 +1534,6 @@ static FT_Outline* getFTOutline(JNIEnv* env, jobject font2D,
if (context->doBold) { /* if bold style */
FT_GlyphSlot_Embolden(ftglyph);
}
if (context->doItalize) { /* if oblique */
FT_GlyphSlot_Oblique(ftglyph);
}
FT_Outline_Translate(&ftglyph->outline,
FloatToF26Dot6(xpos),

View File

@@ -28,9 +28,6 @@
#include "hb.h"
#include "hb-jdk.h"
#ifdef MACOSX
#include "hb-coretext.h"
#endif
#include <stdlib.h>
#if defined(__GNUC__) && __GNUC__ >= 4
@@ -370,12 +367,6 @@ JNIEXPORT jlong JNICALL Java_sun_font_SunLayoutEngine_createFace(JNIEnv *env,
jobject font2D,
jboolean aat,
jlong platformFontPtr) {
#ifdef MACOSX
if (aat && platformFontPtr) {
hb_face_t *face = hb_coretext_face_create((CGFontRef)platformFontPtr);
return ptr_to_jlong(face);
}
#endif
Font2DPtr *fi = (Font2DPtr*)malloc(sizeof(Font2DPtr));
if (!fi) {
return 0;
@@ -423,26 +414,8 @@ static hb_font_t* _hb_jdk_font_create(hb_face_t* face,
return font;
}
#ifdef MACOSX
static hb_font_t* _hb_jdk_ct_font_create(hb_face_t* face,
JDKFontInfo *jdkFontInfo) {
hb_font_t *font = NULL;
font = hb_font_create(face);
hb_font_set_scale(font,
HBFloatToFixed(jdkFontInfo->ptSize),
HBFloatToFixed(jdkFontInfo->ptSize));
return font;
}
#endif
hb_font_t* hb_jdk_font_create(hb_face_t* hbFace,
JDKFontInfo *jdkFontInfo,
hb_destroy_func_t destroy) {
#ifdef MACOSX
if (jdkFontInfo->aat && jdkFontInfo->nativeFont) {
return _hb_jdk_ct_font_create(hbFace, jdkFontInfo);
}
#endif
return _hb_jdk_font_create(hbFace, jdkFontInfo, destroy);
}

View File

@@ -586,17 +586,21 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol {
return false;
}
x = (int)(xclient.get_data(2) >> 16);
y = (int)(xclient.get_data(2) & 0xFFFF);
XWindow xwindow = null;
{
XBaseWindow xbasewindow = XToolkit.windowToXWindow(xclient.get_window());
if (xbasewindow instanceof XWindow) {
xwindow = (XWindow)xbasewindow;
// xclient can be a system-generated or a sent event (see XDragSourceContextPeer)
// so x/y is expected to be presented in device space
x = xbasewindow.scaleDown(x);
y = xbasewindow.scaleDown(y);
}
}
x = (int)(xclient.get_data(2) >> 16);
y = (int)(xclient.get_data(2) & 0xFFFF);
if (xwindow == null) {
long receiver =
XDropTargetRegistry.getRegistry().getEmbeddedDropSite(

View File

@@ -524,8 +524,9 @@ public final class XDragSourceContextPeer
updateTargetWindow(xmotion);
if (dragProtocol != null) {
dragProtocol.sendMoveMessage(scaleDown(xmotion.get_x_root()),
scaleDown(xmotion.get_y_root()),
// XDnDDropTargetProtocol.processXdndPosition will scale x/y
dragProtocol.sendMoveMessage(xmotion.get_x_root(),
xmotion.get_y_root(),
sourceAction, sourceActions,
xmotion.get_time());
}
@@ -533,8 +534,9 @@ public final class XDragSourceContextPeer
private void processDrop(XButtonEvent xbutton) {
try {
dragProtocol.initiateDrop(scaleDown(xbutton.get_x_root()),
scaleDown(xbutton.get_y_root()),
// XDnDDropTargetProtocol.processXdndPosition will scale x/y
dragProtocol.initiateDrop(xbutton.get_x_root(),
xbutton.get_y_root(),
sourceAction, sourceActions,
xbutton.get_time());
} catch (XException e) {

View File

@@ -72,16 +72,16 @@ public class XInputMethod extends X11InputMethod {
return createXICNative(peer.getContentWindow());
}
protected boolean recreateXIC() {
protected boolean recreateXIC(int ctxid) {
final XComponentPeer peer = (XComponentPeer)getPeer(clientComponentWindow);
if (peer == null || pData == 0)
return true;
return recreateXICNative(peer.getContentWindow(), pData);
return recreateXICNative(peer.getContentWindow(), pData, ctxid);
}
protected void releaseXIC() {
protected int releaseXIC() {
if (pData == 0)
return;
releaseXICNative(pData);
return 0;
return releaseXICNative(pData);
}
private static volatile long xicFocus = 0;
@@ -161,8 +161,8 @@ public class XInputMethod extends X11InputMethod {
*/
private native boolean openXIMNative(long display);
private native boolean createXICNative(long window);
private native boolean recreateXICNative(long window, long px11data);
private native void releaseXICNative(long px11data);
private native boolean recreateXICNative(long window, long px11data, int ctxid);
private native int releaseXICNative(long px11data);
private native void setXICFocusNative(long window,
boolean value, boolean active);
private native void adjustStatusWindow(long window);

View File

@@ -25,6 +25,7 @@
package sun.awt;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
@@ -34,6 +35,7 @@ import java.awt.font.TextAttribute;
import java.awt.font.TextHitInfo;
import java.awt.peer.ComponentPeer;
import java.text.AttributedString;
import java.util.Map;
import sun.util.logging.PlatformLogger;
@@ -364,19 +366,21 @@ public abstract class X11InputMethod extends X11InputMethodBase {
static void recreateAllXIC() {
// NOTE: called from native within AWT_LOCK
for (X11InputMethod im : activeInputMethods)
im.releaseXIC();
Map<X11InputMethod, Integer> im2ctxid = new HashMap<>(activeInputMethods.size());
for (X11InputMethod im : activeInputMethods) {
im2ctxid.put(im, im.releaseXIC());
}
if (!recreateX11InputMethod()) {
log.warning("can't recreate X11 InputMethod");
return;
}
for (X11InputMethod im : activeInputMethods) {
if (!im.recreateXIC())
if (!im.recreateXIC(im2ctxid.get(im)))
log.warning("can't recreate XIC for " + im.toString());
}
}
protected abstract boolean recreateXIC();
protected abstract void releaseXIC();
protected abstract boolean recreateXIC(int ctxid);
protected abstract int releaseXIC();
private static native boolean recreateX11InputMethod();
}

View File

@@ -1423,21 +1423,35 @@ finally:
JNIEXPORT jboolean JNICALL
Java_sun_awt_X11_XInputMethod_recreateXICNative(JNIEnv *env,
jobject this,
jlong window, jlong pData)
jlong window, jlong pData, jint ctxid)
{
// NOTE: must be called under AWT_LOCK
return createXIC(env, (X11InputMethodData *)pData, window);
X11InputMethodData * pX11IMData = (X11InputMethodData *)pData;
jboolean result = createXIC(env, pX11IMData, window);
if (result) {
if (ctxid == 1)
pX11IMData->current_ic = pX11IMData->ic_active;
else if (ctxid == 2)
pX11IMData->current_ic = pX11IMData->ic_passive;
}
return result;
}
JNIEXPORT void JNICALL
JNIEXPORT int JNICALL
Java_sun_awt_X11_XInputMethod_releaseXICNative(JNIEnv *env,
jobject this,
jlong pData)
{
// NOTE: must be called under AWT_LOCK
X11InputMethodData * pX11IMData = (X11InputMethodData *)pData;
int result = 0;
if (pX11IMData->current_ic == pX11IMData->ic_active)
result = 1;
else if (pX11IMData->current_ic == pX11IMData->ic_passive)
result = 2;
pX11IMData->current_ic = NULL;
destroyXInputContexts(pX11IMData);
return result;
}

View File

@@ -324,8 +324,6 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
/* GDK */
fp_gdk_get_default_root_window =
dl_symbol("gdk_get_default_root_window");
fp_gdk_window_get_scale_factor =
dl_symbol("gdk_window_get_scale_factor");
/* Pixbuf */
fp_gdk_pixbuf_new = dl_symbol("gdk_pixbuf_new");
@@ -400,6 +398,8 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
} else {
fp_gdk_window_create_similar_image_surface =
dl_symbol("gdk_window_create_similar_image_surface");
fp_gdk_window_get_scale_factor =
dl_symbol("gdk_window_get_scale_factor");
}
gtk3_version_3_14 = !fp_gtk_check_version(3, 14, 0);
@@ -2892,9 +2892,13 @@ static gboolean gtk3_get_drawable_data(JNIEnv *env, jintArray pixelArray,
jint *ary;
GdkWindow *root = (*fp_gdk_get_default_root_window)();
int win_scale = (*fp_gdk_window_get_scale_factor)(root);
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(
root, x, y, (int)(width / (float)win_scale + 0.5), (int)(height / (float)win_scale + 0.5));
if (gtk3_version_3_10) {
int win_scale = (*fp_gdk_window_get_scale_factor)(root);
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(
root, x, y, (int) (width / (float) win_scale + 0.5), (int) (height / (float) win_scale + 0.5));
} else {
pixbuf = (*fp_gdk_pixbuf_get_from_drawable)(root, x, y, width, height);
}
if (pixbuf && scale != 1) {
GdkPixbuf *scaledPixbuf;

View File

@@ -956,6 +956,10 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative
return XRenderCreateGlyphSet(awt_display, (XRenderPictFormat *) jlong_to_ptr(format));
}
static jboolean fits16Bit(jint x) {
return (((x & 0xffff8000) + 0x8000) & 0xffff0000) == 0 ? JNI_TRUE : JNI_FALSE;
}
JNIEXPORT void JNICALL
Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
(JNIEnv *env, jclass cls, jint op, jint src, jint dst,
@@ -970,6 +974,11 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
unsigned int sids[256];
int charCnt = 0;
if (fits16Bit(sx) == JNI_FALSE || fits16Bit(sy) == JNI_FALSE) {
// X Rendering Extension protocol supports only 16-bit initial coordinates
return;
}
if ((MAX_PAYLOAD / sizeof(XGlyphElt32) < (unsigned)eltCnt)
|| (MAX_PAYLOAD / sizeof(unsigned int) < (unsigned)glyphCnt)
|| ((MAX_PAYLOAD - sizeof(XGlyphElt32)*(unsigned)eltCnt) /

View File

@@ -669,7 +669,7 @@ static void checkBrokenInputMethod(XEvent * event, jboolean isEventFiltered) {
if (parsedVal > 0)
filteredEventsThreshold = parsedVal;
else if (strncmp(utf8string, "true", 4) == 0)
filteredEventsThreshold = 10;
filteredEventsThreshold = 5;
}
(*env)->ReleaseStringUTFChars(env, jvalue, utf8string);
}

View File

@@ -1758,7 +1758,7 @@ void GetSysInsets(RECT* insets, AwtFrame* pFrame) {
int dpi = device ? device->GetScaleX() * 96 : 96;
// GetSystemMetricsForDpi gives incorrect values, use AdjustWindowRectExForDpi for border metrics instead
RECT rect = {0};
RECT rect = {};
DWORD style = pFrame->IsResizable() ? WS_OVERLAPPEDWINDOW : WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME;
AwtToolkit::AdjustWindowRectExForDpi(&rect, style, FALSE, NULL, dpi);
::SetRect(insets, -rect.left, -rect.top, rect.right, rect.bottom);
@@ -1772,7 +1772,7 @@ LRESULT HitTestNCA(AwtFrame* frame, int x, int y) {
GetWindowRect(frame->GetHWnd(), &rcWindow);
// Get the frame rectangle, adjusted for the style without a caption.
RECT rcFrame = {0};
RECT rcFrame = {};
AdjustWindowRectEx(&rcFrame, WS_OVERLAPPEDWINDOW & ~WS_CAPTION, FALSE, NULL);
JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);

View File

@@ -171,8 +171,8 @@ JNIEXPORT jboolean JNICALL
JNIEXPORT jlong JNICALL
Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
(JNIEnv *env, jobject unused,
jstring fontFamily, jint style, jint size, jint glyphCode, jboolean fm, jint rotation, jbyte charset) {
(JNIEnv *env, jobject unused, jstring fontFamily, jint style, jint size,
jint glyphCode, jboolean fm, jint rotation, jbyte charset, jint fontDataSize) {
GLYPHMETRICS glyphMetrics;
LOGFONTW lf;
@@ -188,6 +188,7 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
LPWSTR name;
HFONT oldFont, hFont;
MAT2 mat2;
DWORD actualFontDataSize;
unsigned short width;
unsigned short height;
@@ -255,6 +256,17 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
}
oldFont = SelectObject(hMemoryDC, hFont);
if (fontDataSize > 0) {
// We cannot specify via GDI which font file to use,
// so we check that it picks the exact font we need by validating font size.
// If it doesn't match, we cannot proceed, as same glyph code can correspond
// to a completely different glyph in the selected font.
actualFontDataSize = GetFontData(hMemoryDC, 0, 0, NULL, 0);
if (actualFontDataSize != fontDataSize) {
FREE_AND_RETURN;
}
}
tmpBitmap = CreateCompatibleBitmap(hDesktopDC, 1, 1);
if (tmpBitmap == NULL) {
FREE_AND_RETURN;

View File

@@ -42,18 +42,20 @@ applications/jcstress/acqrel/Test.java generic-all
# :hotspot_compiler
compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all
compiler/codegen/Test6896617.java 8193479 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8140405 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
compiler/tiered/LevelTransitionTest.java 8067651 generic-all
compiler/types/correctness/CorrectnessTest.java 8066173 generic-all
compiler/types/correctness/OffTest.java 8066173 generic-all
compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all
compiler/codegen/Test6896617.java 8193479 generic-all
compiler/codegen/aes/TestCipherBlockChainingEncrypt.java 8219513 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8140405 generic-all
compiler/jsr292/ContinuousCallSiteTargetChange.java 8222030 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
compiler/tiered/LevelTransitionTest.java 8067651 generic-all
compiler/types/correctness/CorrectnessTest.java 8066173 generic-all
compiler/types/correctness/OffTest.java 8066173 generic-all
compiler/c2/Test6852078.java 8194310 generic-all
compiler/c2/Test6852078.java 8194310 generic-all
applications/ctw/modules/java_desktop.java 8189604 windows-all
applications/ctw/modules/java_desktop_2.java 8189604,8204842 generic-all
@@ -65,14 +67,15 @@ compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
# :hotspot_gc
gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java 8156755 generic-all
gc/survivorAlignment/TestPromotionToSurvivor.java 8129886 generic-all
gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all
gc/g1/humongousObjects/TestHeapCounters.java 8178918 generic-all
gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8177765 generic-all
gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
gc/g1/humongousObjects/objectGraphTest/TestObjectGraphAfterGC.java 8156755 generic-all
gc/survivorAlignment/TestPromotionToSurvivor.java 8129886 generic-all
gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all
gc/g1/humongousObjects/TestHeapCounters.java 8178918 generic-all
gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithG1.java 8180622 generic-all
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8177765 generic-all
gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
gc/stress/TestReclaimStringsLeaksMemory.java 8224847 generic-all
#############################################################################
@@ -80,6 +83,9 @@ gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
runtime/NMT/MallocStressTest.java 8079353 generic-all
runtime/SelectionResolution/InvokeInterfaceICCE.java 8224795 generic-all
runtime/SelectionResolution/InvokeVirtualICCE.java 8224795 generic-all
runtime/SelectionResolution/InvokeVirtualSuccessTest.java 8224795 generic-all
runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x001/TestDescription.java 8013728 generic-all
runtime/memory/ReadFromNoaccessArea.java nobug generic-all crash is the expected behaviour

View File

@@ -1,62 +0,0 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.EventQueue;
import java.awt.FileDialog;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.event.KeyEvent;
/**
* @test
* @key headful
* @bug 8234522
* @requires (os.family == "mac")
*/
public final class MacOSGoToFolderCrash {
public static void main(final String[] args) throws Exception {
EventQueue.invokeLater(() -> {
FileDialog fd = new FileDialog((Frame) null);
fd.setVisible(true);
});
Robot robot = new Robot();
robot.setAutoDelay(400);
robot.waitForIdle();
// "⌘+Shift+G" Open "Go To Folder" window
robot.keyPress(KeyEvent.VK_META);
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_G);
robot.keyRelease(KeyEvent.VK_G);
robot.keyRelease(KeyEvent.VK_SHIFT);
robot.keyRelease(KeyEvent.VK_META);
// Select something
robot.keyPress(KeyEvent.VK_DOWN);
robot.keyRelease(KeyEvent.VK_DOWN);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
// Close File dialog
robot.keyPress(KeyEvent.VK_ESCAPE);
robot.keyRelease(KeyEvent.VK_ESCAPE);
}
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright 2000-2019 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.*;
public class JEditorPanePreferredSizeTest3 {
public static void main(String[] args) throws Exception {
Exception[] exception = new Exception[1];
SwingUtilities.invokeAndWait(() -> {
JEditorPane editorPane = createEditor();
Dimension initialSize = editorPane.getPreferredSize();
JEditorPane anotherPane = createEditor();
anotherPane.setSize(initialSize.width / 2, initialSize.height);
Dimension newSize = anotherPane.getPreferredSize();
if (newSize.height <= initialSize.height) {
exception[0] = new RuntimeException("Unexpected size: " + newSize + ", initial size: " + initialSize);
}
});
if (exception[0] != null) throw exception[0];
}
private static JEditorPane createEditor() {
return new JEditorPane("text/html", "Very long line");
}
}

View File

@@ -0,0 +1,186 @@
/*
* Copyright 2000-2019 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.JComponent;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.Popup;
import javax.swing.PopupFactory;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Robot;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.KeyEvent;
/**
* @test
* @summary Regression test for JBR-1417: JBR 11 does not support chain of popups
* @requires (jdk.version.major >= 8)
* @run main ChainOfPopupsFocusTest
*/
/*
* Description: Test checks that focus goes to the parent popup when child popup is closed.
* Test opens several popups one by one, setting current popup as a parent for the next one.
* Then the popups are closed one by one. Test fails if focus went somewhere else than the parent popup.
*/
public class ChainOfPopupsFocusTest implements Runnable, ActionListener {
private static final int DEPTH = 5;
private static final String FRAMENAME = "MainFrame";
private static final String POPUPNAME = "Popup";
private static volatile Component focusOwner;
private static volatile int popupsCount;
private static Robot robot;
private JFrame frame;
public static void main(String[] args) throws Exception {
robot = new Robot();
robot.setAutoDelay(50);
ChainOfPopupsFocusTest test = new ChainOfPopupsFocusTest();
SwingUtilities.invokeAndWait(test);
robot.delay(3000);
try {
SwingUtilities.invokeAndWait(() ->
focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
if(focusOwner == null || !focusOwner.getName().equals(FRAMENAME)) {
throw new RuntimeException("Test ERROR: " + FRAMENAME + " is not focused");
}
for (int count = 1; count <= DEPTH; count++) {
pressCtrlKey(KeyEvent.VK_N);
robot.delay(1000);
}
if(popupsCount != DEPTH) {
throw new RuntimeException("Test ERROR: Number of open popups is "
+ popupsCount + ", but " + DEPTH + " is expected");
}
for (int count = DEPTH-1; count >= 0; count--) {
pressCtrlKey(KeyEvent.VK_X);
robot.delay(1000);
SwingUtilities.invokeAndWait(() ->
focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
String focusedComponent = (focusOwner != null ? focusOwner.getName() : "Nothing");
String expectedComponent = (count == 0 ? FRAMENAME : POPUPNAME + count);
if(!focusedComponent.equals(expectedComponent)) {
throw new RuntimeException("Test FAILED: "
+ focusedComponent + " is focused instead of " + expectedComponent);
}
}
} finally {
SwingUtilities.invokeAndWait(() -> test.frame.dispose());
robot.delay(2000);
}
System.out.println("Test PASSED");
}
private static void pressCtrlKey(int vk) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(vk);
robot.keyRelease(vk);
robot.keyRelease(KeyEvent.VK_CONTROL);
}
@Override
public void run() {
JTextArea area = createTextArea(FRAMENAME);
frame = new JFrame(getClass().getSimpleName());
frame.add(new JScrollPane(area));
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.toFront();
area.requestFocusInWindow();
}
private JTextArea createTextArea(String locatedOn) {
JTextArea area = new JTextArea(20, 40);
area.setName(locatedOn);
area.registerKeyboardAction(this, "show", KeyStroke.getKeyStroke("control N"), JComponent.WHEN_FOCUSED);
area.registerKeyboardAction(event -> SwingUtilities.getWindowAncestor((Component) event.getSource()).setVisible(false), KeyStroke.getKeyStroke("control X"), JComponent.WHEN_FOCUSED);
area.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent event) {
area.requestFocus();
}
});
return area;
}
@Override
public void actionPerformed(ActionEvent event) {
Component source = (Component) event.getSource();
switch (event.getActionCommand()) {
case "show":
Point point = source.getLocationOnScreen();
Component area = createTextArea(POPUPNAME + ++popupsCount);
Popup popup = PopupFactory.getSharedInstance().getPopup(source, new JScrollPane(area), point.x + 10, point.y + 10);
Window window = SwingUtilities.getWindowAncestor(area);
window.setAutoRequestFocus(true);
window.setFocusable(true);
window.setFocusableWindowState(true);
window.setFocusTraversalPolicy(new FocusTraversalPolicy() {
@Override
public Component getComponentAfter(Container container, Component component) {
return area;
}
@Override
public Component getComponentBefore(Container container, Component component) {
return area;
}
@Override
public Component getFirstComponent(Container container) {
return area;
}
@Override
public Component getLastComponent(Container container) {
return area;
}
@Override
public Component getDefaultComponent(Container container) {
return area;
}
});
popup.show();
break;
case "hide":
SwingUtilities.getWindowAncestor(source).setVisible(false);
break;
}
}
}

View File

@@ -40,7 +40,7 @@ cd ${TESTSRC}
${TESTJAVA}/bin/javac -d ${TESTCLASSES} Font430.java
${TESTJAVA}/bin/java -cp ${TESTCLASSES} Font430 t1.bmp true
${TESTJAVA}/bin/java -cp ${TESTCLASSES} Font430 t2.bmp true
${TESTJAVA}/bin/java -cp ${TESTCLASSES} Font430 t2.bmp false
cmp t1.bmp t2.bmp
exit_code=$?
@@ -49,6 +49,7 @@ case $exit_code in
0) echo "PASSED"
;;
*) echo "FAILED: $exit_code"
mv t[1..2].bmp ${TESTCLASSES}
exit 1
;;
esac

View File

@@ -0,0 +1,166 @@
/*
* Copyright 2000-2019 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 java.awt.event.KeyEvent;
import java.util.HashMap;
/*
* Class containing common key functionality
*/
public class Key {
// KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
private final String vkName;
// KeyChars mapped to the key on the current keyboard layout
private final MappedKeyChars mappedKeyChars;
Key(String vkName, MappedKeyChars mappedKeyChars) {
this.vkName = vkName;
this.mappedKeyChars = mappedKeyChars;
}
// Returns the virtual key code for US keyboard layout.
// Robot only knows US keyboard layout.
// So to press some key on the current layout, one needs to pass corresponding US layout key code to Robot.
// So every key stores corresponding KeyEvent.VK_ constant name to provide mapping to US layout.
int getKeyCode_US() {
try {
return KeyEvent.class.getField(vkName).getInt(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new RuntimeException(e);
}
};
// Returns key code for the current layout.
// Key that generates VK_ code when using a US keyboard layout also generates a unique code for other layout.
// Test firstly determines char mapped to the key on the current layout
// and then uses KeyEvent.getExtendedKeyCodeForChar(c) to get the key code.
int getKeyCode() {
KeyChar keyChar = mappedKeyChars.getKeyChar();
char ch = keyChar.getChar();
if (latinKeyCodesMap.containsKey(ch)) {
// TODO Fix this in jbruntime
// KeyEvent.getExtendedKeyCodeForChar(ch) does not return corresponding VK_ constant for non-English keys
return latinKeyCodesMap.get(ch);
} else if (keyChar.isDead() && deadKeyCodesMap.containsKey(ch)) {
// KeyEvent.getExtendedKeyCodeForChar(ch) does not return corresponding VK_ constant for dead keys
return deadKeyCodesMap.get(ch);
} else {
return KeyEvent.getExtendedKeyCodeForChar(ch);
}
}
// Returns key char for the current layout
public char getChar(Modifier modifier) {
return mappedKeyChars.getKeyChar(modifier).getChar();
}
// Checks if no char is mapped to the modifier + key
public boolean isCharNull(Modifier modifier) {
return (mappedKeyChars.getKeyChar(modifier).getChar() == Character.MIN_VALUE);
}
// Checks if modifier + key is a shortcut
public boolean isCharUndefined(Modifier modifier) {
return (mappedKeyChars.getKeyChar(modifier).getChar() == Character.MAX_VALUE);
}
// Checks if key is a dead key, no modifiers
public boolean isDead() {
return mappedKeyChars.getKeyChar().isDead();
}
// Checks if modifier + key is a dead key, always false for shortcut
public boolean isDead(Modifier modifier) {
return mappedKeyChars.getKeyChar(modifier).isDead();
}
// TODO Remove this map when KeyEvent.getExtendedKeyCodeForChar(ch) is fixed for latin keys in jbruntime
// Map storing latin chars and corresponding VK_ codes
private static final HashMap<Character, Integer> latinKeyCodesMap = new HashMap<Character, Integer>() {
{
// Please see:
// jbruntime/src/java.desktop/share/classes/java/awt/event/KeyEvent.java
put((char) 0x00E0, KeyEvent.VK_A_WITH_GRAVE);
put((char) 0x00E1, KeyEvent.VK_A_WITH_ACUTE);
put((char) 0x00E2, KeyEvent.VK_A_WITH_CIRCUMFLEX);
put((char) 0x00E3, KeyEvent.VK_A_WITH_TILDE);
put((char) 0x00E4, KeyEvent.VK_A_WITH_DIAERESIS);
put((char) 0x00E5, KeyEvent.VK_A_WITH_RING_ABOVE);
put((char) 0x00E6, KeyEvent.VK_AE);
put((char) 0x00E7, KeyEvent.VK_C_WITH_CEDILLA);
put((char) 0x00E8, KeyEvent.VK_E_WITH_GRAVE);
put((char) 0x00E9, KeyEvent.VK_E_WITH_ACUTE);
put((char) 0x00EA, KeyEvent.VK_E_WITH_CIRCUMFLEX);
put((char) 0x00EB, KeyEvent.VK_E_WITH_DIAERESIS);
put((char) 0x00EC, KeyEvent.VK_I_WITH_GRAVE);
put((char) 0x00ED, KeyEvent.VK_I_WITH_GRAVE);
put((char) 0x00EE, KeyEvent.VK_I_WITH_CIRCUMFLEX);
put((char) 0x00EF, KeyEvent.VK_I_WITH_DIAERESIS);
put((char) 0x00F0, KeyEvent.VK_ETH);
put((char) 0x00F1, KeyEvent.VK_N_WITH_TILDE);
put((char) 0x00F2, KeyEvent.VK_O_WITH_GRAVE);
put((char) 0x00F3, KeyEvent.VK_O_WITH_ACUTE);
put((char) 0x00F4, KeyEvent.VK_O_WITH_CIRCUMFLEX);
put((char) 0x00F5, KeyEvent.VK_O_WITH_TILDE);
put((char) 0x00F6, KeyEvent.VK_O_WITH_DIAERESIS);
put((char) 0x00F7, KeyEvent.VK_DIVISION_SIGN);
put((char) 0x00F8, KeyEvent.VK_O_WITH_SLASH);
put((char) 0x00F9, KeyEvent.VK_U_WITH_GRAVE);
put((char) 0x00FA, KeyEvent.VK_U_WITH_ACUTE);
put((char) 0x00FB, KeyEvent.VK_U_WITH_CIRCUMFLEX);
put((char) 0x00FC, KeyEvent.VK_U_WITH_DIAERESIS);
put((char) 0x00FD, KeyEvent.VK_Y_WITH_ACUTE);
put((char) 0x00FE, KeyEvent.VK_THORN);
put((char) 0x00FF, KeyEvent.VK_Y_WITH_DIAERESIS);
}
};
// Map storing possible dead key chars and corresponding VK_ codes
private static final HashMap<Character, Integer> deadKeyCodesMap = new HashMap<Character, Integer>() {
{
// Please see:
// jbruntime/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp
// jbruntime/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m
put((char) 0x02D9, KeyEvent.VK_DEAD_ABOVEDOT);
put((char) 0x02DA, KeyEvent.VK_DEAD_ABOVERING);
put((char) 0x00B4, KeyEvent.VK_DEAD_ACUTE); // ACUTE ACCENT
put((char) 0x0384, KeyEvent.VK_DEAD_ACUTE); // GREEK TONOS
// TODO Should test map ' to acute as sometimes it may add either acute or cedilla to the next key
//put((char) 0x0027 /* ' */, KeyEvent.VK_DEAD_ACUTE); // APOSTROPHE
put((char) 0x02D8, KeyEvent.VK_DEAD_BREVE);
put((char) 0x02C7, KeyEvent.VK_DEAD_CARON);
put((char) 0x00B8, KeyEvent.VK_DEAD_CEDILLA); // CEDILLA
put((char) 0x002C /* , */, KeyEvent.VK_DEAD_CEDILLA); // COMMA
put((char) 0x02C6, KeyEvent.VK_DEAD_CIRCUMFLEX); // MODIFIER LETTER CIRCUMFLEX ACCENT
put((char) 0x005E, KeyEvent.VK_DEAD_CIRCUMFLEX); // CIRCUMFLEX ACCENT
put((char) 0x00A8, KeyEvent.VK_DEAD_DIAERESIS); // DIAERESIS
put((char) 0x0022 /* " */, KeyEvent.VK_DEAD_DIAERESIS); // QUOTATION MARK
put((char) 0x02DD, KeyEvent.VK_DEAD_DOUBLEACUTE);
put((char) 0x0060, KeyEvent.VK_DEAD_GRAVE);
put((char) 0x037A, KeyEvent.VK_DEAD_IOTA);
put((char) 0x02C9, KeyEvent.VK_DEAD_MACRON); // MODIFIER LETTER MACRON
put((char) 0x00AF, KeyEvent.VK_DEAD_MACRON); // MACRON
put((char) 0x02DB, KeyEvent.VK_DEAD_OGONEK);
put((char) 0x02DC, KeyEvent.VK_DEAD_TILDE); // SMALL TILDE
put((char) 0x007E, KeyEvent.VK_DEAD_TILDE); // TILDE
put((char) 0x309B, KeyEvent.VK_DEAD_VOICED_SOUND);
put((char) 0x309C, KeyEvent.VK_DEAD_SEMIVOICED_SOUND);
}
};
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright 2000-2019 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.
*/
/*
* Class describing a key char
*/
public class KeyChar {
// Char value
private final char ch;
// Dead or not
private final boolean isDead;
// Private constructor for an ordinal key char
private KeyChar(char ch) {
this.ch = ch;
this.isDead = false;
}
// Private constructor for a dead key char
private KeyChar(char ch, boolean isDead) {
this.ch = ch;
this.isDead = isDead;
}
// Helper method for an ordinal key char creation
static KeyChar ch(char ch) {
return new KeyChar(ch);
}
// Helper method for a dead key char creation
static KeyChar dead(char ch) {
return new KeyChar(ch, true);
}
// Returns dead marker
boolean isDead() {
return isDead;
}
// Returns char value
char getChar() {
return ch;
}
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright 2000-2019 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.
*/
/*
* Enumerates macOS keyboard layouts covered by this test
*/
public enum Layout {
ABC ("ABC", Layout_ABC.values()),
US_INTERNATIONAL_PC ("USInternational-PC", Layout_US_INTERNATIONAL_PC.values()),
SPANISH_ISO ("Spanish-ISO", Layout_SPANISH_ISO.values()),
FRENCH_PC ("French-PC", Layout_FRENCH_PC.values()),
GERMAN ("German", Layout_GERMAN.values()),
;
// Real macOS keyboard layout name without "com.apple.keylayout." prefix
private String name;
// Array of test keys for the layout
private LayoutKey[] layoutKeys;
Layout(String name, LayoutKey[] layoutKeys) {
this.name = name;
this.layoutKeys = layoutKeys;
}
// Return array of test keys for the layout
LayoutKey[] getLayoutKeys() {
return layoutKeys;
}
@Override
public String toString() {
return "com.apple.keylayout." + name;
}
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2000-2019 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.
*/
/*
* Common interface for all test layouts.
* Keyboard layouts are declared as a separate enums to allow testing of different key sets for different layouts.
* As layouts are declared as enums, they cannot extend any other class, but need to have some common functionality.
*/
public interface LayoutKey {
// Return Key object containing common key functionality
Key getKey();
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright 2000-2019 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.
*/
/**
* @test
* @summary Regression test for IDEA-165950: National keyboard layouts support
* @requires (jdk.version.major >= 8 & os.family == "mac")
* @modules java.desktop/sun.lwawt.macosx
* @run main NationalLayoutTest ABC
*/
/*
* Enumerates keys under test for com.apple.keylayout.ABC (macOS 10.14.5)
*/
public enum Layout_ABC implements LayoutKey {
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
// Robot cannot press section sign key (16777383),
// located on the left side of the key 1 on the Apple International English keyboard
// SECTION ('§', '§', '±', '±'),
VK_MINUS ('-', '', '_', '—'),
VK_EQUALS ('=', '≠', '+', '±'),
VK_OPEN_BRACKET ('[', '“', '{', '”'),
VK_CLOSE_BRACKET (']', '', '}', ''),
VK_SEMICOLON (';', '…', ':', 'Ú'),
VK_QUOTE ('\'', 'æ', '"', 'Æ'),
VK_BACK_SLASH ('\\', '«', '|', '»'),
VK_BACK_QUOTE (KeyChar.ch('`'), KeyChar.dead('`'), KeyChar.ch('~'), KeyChar.ch('`')),
VK_COMMA (',', '≤', '<', '¯'),
VK_PERIOD ('.', '≥', '>', '˘'),
VK_SLASH ('/', '÷', '?', '¿'),
//VK_1 ('1', '¡', '!', ''),
//VK_2 ('2', '™', '@', '€'),
//VK_3 ('3', '£', '#', ''),
//VK_4 ('4', '¢', '$', ''),
//VK_5 ('5', '∞', '%', 'fi'),
//VK_6 ('6', '§', '^', 'fl'),
//VK_7 ('7', '¶', '&', '‡'),
//VK_8 ('8', '•', '*', '°'),
//VK_9 ('9', 'ª', '(', '·'),
//VK_0 ('0', 'º', ')', ''),
// macOS system shortcuts: Shift+Cmd+Q - Log Out, Ctrl+Cmd+Q - Lock Screen
//VK_Q ('q', 'œ', 'Q', 'Œ'),
//VK_W ('w', '∑', 'W', '„'),
//VK_E (KeyChar.ch('e'), KeyChar.dead('´') ,KeyChar.ch('E'), KeyChar.ch('´')),
//VK_R ('r', '®', 'R', '‰'),
//VK_T ('t', '†', 'T', 'ˇ'),
//VK_Y ('y', '¥', 'Y', 'Á'),
//VK_U (KeyChar.ch('u'), KeyChar.dead('¨'), KeyChar.ch('U'), KeyChar.ch('¨')),
//VK_I (KeyChar.ch('i'), KeyChar.dead('ˆ'), KeyChar.ch('I'), KeyChar.ch('ˆ')),
//VK_O ('o', 'ø', 'O', 'Ø'),
//VK_P ('p', 'π', 'P', '∏'),
//VK_A ('a', 'å', 'A', 'Å'),
//VK_S ('s', 'ß', 'S', 'Í'),
//VK_D ('d', '∂', 'D', 'Î'),
//VK_F ('f', 'ƒ', 'F', 'Ï'),
//VK_G ('g', '©', 'G', '˝'),
// macOS system shortcuts: Cmd+H - Hide the windows of the front app
//VK_H ('h', '˙', 'H', 'Ó'),
//VK_J ('j', '∆', 'J', 'Ô'),
//VK_K ('k', '˚', 'K', ''),
//VK_L ('l', '¬', 'L', 'Ò'),
//VK_Z ('z', 'Ω', 'Z', '¸'),
//VK_X ('x', '≈', 'X', '˛'),
//VK_C ('c', 'ç', 'C', 'Ç'),
// macOS system shortcuts: Cmd+V - Paste the contents of the Clipboard into the current document or app
//VK_V ('v', '√', 'V', '◊'),
//VK_B ('b', '∫', 'B', 'ı'),
//VK_N (KeyChar.ch('n'), KeyChar.dead('˜'), KeyChar.ch('N'), KeyChar.ch('˜')),
//VK_M ('m', 'µ', 'M', 'Â'),
;
// Common code for any LayoutKey enum
private final Key key;
Layout_ABC(char no, char alt, char shift, char alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
Layout_ABC(KeyChar no, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
public Key getKey() {
return key;
}
}

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2000-2019 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.
*/
/**
* @test
* @summary Regression test for IDEA-165950: National keyboard layouts support
* @requires (jdk.version.major >= 8 & os.family == "mac")
* @modules java.desktop/sun.lwawt.macosx
* @run main NationalLayoutTest FRENCH_PC
*/
/*
* Enumerates keys under test for com.apple.keylayout.French-PC (macOS 10.14.5)
*/
public enum Layout_FRENCH_PC implements LayoutKey {
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
VK_MINUS (')', ']', '°', ']'),
VK_EQUALS ('=', '}', '+', '≠'),
VK_OPEN_BRACKET (KeyChar.dead('^'), KeyChar.ch('ô'), KeyChar.dead('¨'), KeyChar.ch('Ô')),
VK_CLOSE_BRACKET ('$', '¤', '£', '¥'),
VK_SEMICOLON ('m', 'µ', 'M', 'Ó'),
VK_QUOTE ('ù', 'Ù', '%', '‰'),
VK_BACK_SLASH ('*', '@', 'μ', '#'),
VK_BACK_QUOTE ('<', '«', '>', '≥'),
VK_COMMA (';', '…', '.', '•'),
VK_PERIOD (':', '÷', '/', '\\'),
VK_SLASH ('!', '¡', '§', '±'),
;
// Common code for any LayoutKey enum
private final Key key;
Layout_FRENCH_PC(char no, char alt, char shift, char alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
Layout_FRENCH_PC(KeyChar no, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
public Key getKey() {
return key;
}
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright 2000-2019 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.
*/
/**
* @test
* @summary Regression test for IDEA-165950: National keyboard layouts support
* @requires (jdk.version.major >= 8 & os.family == "mac")
* @modules java.desktop/sun.lwawt.macosx
* @run main NationalLayoutTest GERMAN
*/
/*
* Enumerates keys under test for com.apple.keylayout.German (macOS 10.14.5)
*/
public enum Layout_GERMAN implements LayoutKey {
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
// Eszett
VK_MINUS ('ß', '¿', '?', '˙'),
VK_EQUALS (KeyChar.dead('´'), KeyChar.ch('\''), KeyChar.dead('`'), KeyChar.ch('˚')),
VK_OPEN_BRACKET ('ü', '•', 'Ü', '°'),
VK_CLOSE_BRACKET ('+', '±', '*', ''),
VK_SEMICOLON ('ö', 'œ', 'Ö', 'Œ'),
VK_QUOTE ('ä', 'æ', 'Ä', 'Æ'),
VK_BACK_SLASH ('#', '', '\'', ''),
VK_BACK_QUOTE ('<', '≤', '>', '≥'),
VK_COMMA (',', '∞', ';', '˛'),
VK_PERIOD ('.', '…', ':', '÷'),
VK_SLASH ('-', '', '_', '—'),
;
// Common code for any LayoutKey enum
private final Key key;
Layout_GERMAN(char no, char alt, char shift, char alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
Layout_GERMAN(KeyChar no, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
public Key getKey() {
return key;
}
}

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2000-2019 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.
*/
/**
* @test
* @summary Regression test for IDEA-165950: National keyboard layouts support
* @requires (jdk.version.major >= 8 & os.family == "mac")
* @modules java.desktop/sun.lwawt.macosx
* @run main NationalLayoutTest SPANISH_ISO
*/
/*
* Enumerates keys under test for com.apple.keylayout.Spanish-ISO (macOS 10.14.5)
*/
public enum Layout_SPANISH_ISO implements LayoutKey {
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
VK_MINUS ('\'', '´', '?', '¸'),
VK_EQUALS ('¡', '', '¿', '˛'),
VK_OPEN_BRACKET (KeyChar.dead('`'), KeyChar.ch('['), KeyChar.dead('^'), KeyChar.ch('ˆ')),
VK_CLOSE_BRACKET ('+', ']', '*', '±'),
VK_SEMICOLON (KeyChar.ch('ñ'), KeyChar.dead('~'), KeyChar.ch('Ñ'), KeyChar.ch('˜')),
VK_QUOTE (KeyChar.dead('´'), KeyChar.ch('{'), KeyChar.dead('¨'), KeyChar.ch('«')),
VK_BACK_SLASH ('ç', '}', 'Ç', '»'),
VK_BACK_QUOTE ('<', '≤', '>', '≥'),
VK_COMMA (',', '„', ';', '\u0000'),
VK_PERIOD ('.', '…', ':', '…'),
VK_SLASH ('-', '', '_', '—'),
;
// Common code for any LayoutKey enum
private final Key key;
Layout_SPANISH_ISO(char no, char alt, char shift, char alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
Layout_SPANISH_ISO(KeyChar no, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
public Key getKey() {
return key;
}
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright 2000-2019 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.
*/
/**
* @test
* @summary Regression test for IDEA-165950: National keyboard layouts support
* @requires (jdk.version.major >= 8 & os.family == "mac")
* @modules java.desktop/sun.lwawt.macosx
* @run main NationalLayoutTest US_INTERNATIONAL_PC
*/
/*
* Enumerates keys under test for com.apple.keylayout.USInternational-PC (macOS 10.14.5)
*/
public enum Layout_US_INTERNATIONAL_PC implements LayoutKey {
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
VK_MINUS ('-', '', '_', '—'),
VK_EQUALS ('=', '≠', '+', '±'),
VK_OPEN_BRACKET ('[', '“', '{', '”'),
VK_CLOSE_BRACKET (']', '', '}', ''),
VK_SEMICOLON (';', '…', ':', 'Ú'),
// ' is a special dead symbol, which may add either acute or cedilla to the next key
VK_QUOTE (KeyChar.dead('\''), KeyChar.ch('æ'), KeyChar.dead('\"'), KeyChar.ch('Æ')),
VK_BACK_SLASH ('\\', '«', '|', '»'),
VK_BACK_QUOTE (KeyChar.dead('`'), KeyChar.dead('`'), KeyChar.dead('~'), KeyChar.ch('`')),
VK_COMMA (',', '≤', '<', '¯'),
VK_PERIOD ('.', '≥', '>', '˘'),
VK_SLASH ('/', '÷', '?', '¿'),
;
// Common code for any LayoutKey enum
private final Key key;
Layout_US_INTERNATIONAL_PC(char no, char alt, char shift, char alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
Layout_US_INTERNATIONAL_PC(KeyChar no, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
key = new Key(name(), new MappedKeyChars(no, alt, shift, alt_shift));
}
public Key getKey() {
return key;
}
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright 2000-2019 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.
*/
/*
* Defines chars mapped to the key on the current keyboard layout
*/
public class MappedKeyChars {
private final KeyChar no_modifier;
private final KeyChar alt;
private final KeyChar shift;
private final KeyChar alt_shift;
MappedKeyChars(char no_modifier, char alt, char shift, char alt_shift) {
this.no_modifier = KeyChar.ch(no_modifier);
this.alt = KeyChar.ch(alt);
this.shift = KeyChar.ch(shift);
this.alt_shift = KeyChar.ch(alt_shift);
}
MappedKeyChars(KeyChar no_modifier, KeyChar alt, KeyChar shift, KeyChar alt_shift) {
this.no_modifier = no_modifier;
this.alt = alt;
this.shift = shift;
this.alt_shift = alt_shift;
}
/*
* Return char mapped to key + modifier on the current layout.
* Return "undefined" char '\uffff', if modifier is a shortcut, i.e. other than Alt, Shift or Alt+Shift or empty.
* Return "null" char '\u0000', if there is no char mapped to the key + modifier or its testing is skipped.
*/
KeyChar getKeyChar(Modifier modifier) {
if(modifier.isEmpty()) {
return no_modifier;
}
if(modifier.isAlt()) {
return alt;
}
if(modifier.isShift()) {
return shift;
}
if(modifier.isAltShift()) {
return alt_shift;
}
return KeyChar.ch(Character.MAX_VALUE);
}
/*
* Return char mapped to the low registry key on the current layout, i.e. with no modifier.
*/
KeyChar getKeyChar() {
return no_modifier;
}
}

View File

@@ -0,0 +1,104 @@
/*
* Copyright 2000-2019 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 java.awt.event.KeyEvent;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/*
* Enumerates modifier combinations covered by this test
*/
public enum Modifier {
E(),
//A(KeyEvent.VK_ALT),
//S(KeyEvent.VK_SHIFT),
//SA(KeyEvent.VK_SHIFT, KeyEvent.VK_ALT),
// Shortcuts
M(KeyEvent.VK_META),
C(KeyEvent.VK_CONTROL),
//CS(KeyEvent.VK_CONTROL, KeyEvent.VK_SHIFT),
//CA(KeyEvent.VK_CONTROL, KeyEvent.VK_ALT),
//CM(KeyEvent.VK_CONTROL, KeyEvent.VK_META),
//MS(KeyEvent.VK_META, KeyEvent.VK_SHIFT),
//MA(KeyEvent.VK_META, KeyEvent.VK_ALT),
//CMS(KeyEvent.VK_CONTROL, KeyEvent.VK_META, KeyEvent.VK_SHIFT),
//CMA(KeyEvent.VK_CONTROL, KeyEvent.VK_META, KeyEvent.VK_ALT),
//CSA(KeyEvent.VK_CONTROL, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT),
//MSA(KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT),
//CMSA(KeyEvent.VK_CONTROL, KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT),
;
// Holds array of int modifier values, where every int value corresponds to modifier KeyEvent.VK_ code
private int[] modifiers;
// Creates empty Modifier
Modifier() {
this(new int[0]);
}
// Creates Modifier using given KeyEvent.VK_ codes
Modifier(int... modifiers) {
for(int key : modifiers) {
if ((key != KeyEvent.VK_CONTROL) && (key != KeyEvent.VK_META)
&& (key != KeyEvent.VK_SHIFT) && (key != KeyEvent.VK_ALT)) {
throw new IllegalArgumentException("Bad modifier: " + key);
}
}
this.modifiers = modifiers;
}
// Returns array of int modifier values, where every int value corresponds to modifier KeyEvent.VK_ code
int[] getModifiers() {
return modifiers;
}
// Checks if no modifier is set
boolean isEmpty() {
return (modifiers.length == 0);
}
// Checks if modifier is Alt
boolean isAlt() {
return ((modifiers.length == 1) && (modifiers[0] == KeyEvent.VK_ALT));
}
// Checks if modifier is Shift
boolean isShift() {
return ((modifiers.length == 1) && (modifiers[0] == KeyEvent.VK_SHIFT));
}
// Checks if modifier is Alt+Shift
boolean isAltShift() {
List<Integer> list = Arrays.stream(modifiers).boxed().collect(Collectors.toList());
return ((modifiers.length == 2) && list.contains(KeyEvent.VK_ALT) && list.contains(KeyEvent.VK_SHIFT));
}
@Override
public String toString() {
if (modifiers.length == 0) {
return "no";
}
return Arrays.stream(modifiers).boxed().map(i -> KeyEvent.getKeyText(i)).collect(Collectors.joining(" "));
}
}

View File

@@ -0,0 +1,531 @@
/*
* Copyright 2000-2019 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 sun.lwawt.macosx.LWCToolkit;
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Label;
import java.awt.Panel;
import java.awt.Robot;
import java.awt.TextArea;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.text.CharacterIterator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/*
* Description: Tests national keyboard layouts on macOS.
*
* Test goes over existing Layout and Modifier enums.
* Each layout key will be tested with all possible modifier combinations.
* Test switches to the requested layout (or user changes it by hands).
* Then Robot keeps pressing modifier + key, while test keeps tracking of keyPressed, charsTyped and inputMethod events.
* Finally, test compares the resulting key presses and typed chars with the expected ones using the assumptions below.
*
* Test based on the following assumptions:
* TODO check if these assumptions are correct
* - Pressing "modifier + key" always generates "modifier key code + low registry key code" for any key and modifier.
* - No keyTyped event is expected as the result of pressing dead key + key.
* - Pressing "dead key + space" generates corresponding diacritic character,
* which may be obtained using inputMethodTextChanged event.
* - Cmd, Ctrl and its combinations with other modifiers are considered as a "shortcut",
* no keyTyped event is expected as the result of pressing a shortcut,
* no attempts are made to check inputMethodTextChanged event result for a "shortcut".
*
* WARNING: Test sends many key presses which may match system and IDE shortcuts.
*
* !!! DISABLE MACOS SYSTEM SHORTCUTS BEFORE RUNNING THIS TEST !!!
* !!! DO NOT RUN THIS TEST FROM IDE !!!
*
* MacOS accessibility permission should be granted on macOS >= 10.14 for the application launching this test, so
* Java Robot is able to access keyboard (use System Preferences -> Security&Privacy -> Privacy tab -> Accessibility).
*
* Test can only be compiled by JBRSDK as it uses private LWCToolkit API for switching system keyboard layout.
* Test may be run by any JRE, but in case of non-JBR, one needs to manually switch the keyboard layout during testing.
*
* Compilation:
* <javac-1.8.*> -bootclasspath <jbrsdk8>/Contents/Home/jre/lib/rt.jar:. NationalLayoutTest.java
* <javac-11.*> --add-exports java.desktop/sun.lwawt.macosx=ALL-UNNAMED NationalLayoutTest.java
*
* Usage:
* <java> NationalLayoutTest [manual] [layout1] [layout2] ... , where layoutN is one of the existing Layout enum values
*
* Examples:
* > java NationalLayoutTest
* > java NationalLayoutTest ABC SPANISH_ISO
* > java NationalLayoutTest manual US_INTERNATIONAL_PC
*
*/
public class NationalLayoutTest {
private static final String MANUAL= "manual";
private static final int PAUSE = 2000;
// Test control keys
private static final int NEXT_KEY = KeyEvent.VK_ENTER;
private static final int NEXT_MODIFIER = KeyEvent.VK_ESCAPE;
private static final int TERMINATE_KEY = KeyEvent.VK_SPACE;
private static CountDownLatch nextKey;
private static CountDownLatch nextModifierSet;
private static boolean jbr = true;
private static boolean autoTest = true;
private static boolean showKeyCodeHex = false;
private static Frame mainFrame;
private static TextArea inputArea;
private static TextArea pressArea;
private static TextArea typeArea;
private static Robot robot;
// Synchronized lists for storing results of different key events
private static CopyOnWriteArrayList<Integer> keysPressed = new CopyOnWriteArrayList();
private static CopyOnWriteArrayList<Character> charsTyped = new CopyOnWriteArrayList();
private static CopyOnWriteArrayList<Character> inputMethodChars = new CopyOnWriteArrayList();
/*
* Test entry point
*/
public static void main(String[] args) throws InterruptedException {
// Check if the testing could be performed using Java Robot
try {
robot = new Robot();
robot.setAutoDelay(50);
} catch (AWTException e) {
throw new RuntimeException("TEST ERROR: Cannot create Java Robot " + e);
}
// Check if program arguments contain known layouts to test
List<Layout> layoutList = new ArrayList();
for (String arg : args) {
if(!arg.equals(MANUAL)) {
try {
layoutList.add(Layout.valueOf(arg));
} catch (IllegalArgumentException e) {
throw new RuntimeException("ERROR: Unexpected argument: " + arg);
}
}
}
// JBR internal API from LWCToolkit is used to switch system keyboard layout.
// So running the test for other java implementations is only possible in manual mode.
// During the test run one should switch to the requested keyboard layout by hands
// and then proceed with testing by pressing NEXT_MODIFIER.
if (!System.getProperty("java.vm.vendor").toLowerCase().contains("jetbrains")) {
System.out.println("WARNING - Not JBR mode: Cannot automatically switch keyboard layout");
jbr = false;
}
// One may want to use MANUAL mode to simply improve visibility.
// Please proceed with layout testing by pressing NEXT_MODIFIER.
if(Arrays.asList(args).contains(MANUAL) || !(jbr)) {
System.out.println("WARNING - Manual mode: Press " + KeyEvent.getKeyText(NEXT_MODIFIER)
+ " to start testing keyboard layout with the modifier set");
autoTest = false;
}
String initialLayoutName = null;
try {
// Create test GUI
createGUI();
// Save initial keyboard layout
if(jbr) {
initialLayoutName = LWCToolkit.getKeyboardLayoutId();
}
boolean failed = false;
// Test layouts defined in the command line or all enumerated test layouts in case command line is empty
for(Layout layout : (layoutList.isEmpty()
? Layout.values() : layoutList.toArray(new Layout[layoutList.size()]))) {
// Test layout with all enumerated modifier combinations
for (Modifier modifier : Modifier.values()) {
if(!testLayout(layout, modifier)) {
failed = true;
};
}
}
// Provide the test result
if(failed) {
throw new RuntimeException("TEST FAILED: Some keyboard layout tests failed, check the test output");
} else {
System.out.println("TEST PASSED");
}
} finally {
// Restore initial keyboard layout
if(initialLayoutName != null && !initialLayoutName.isEmpty()) {
LWCToolkit.switchKeyboardLayout(initialLayoutName);
}
// Destroy test GUI
destroyGUI();
// Wait for EDT auto-shutdown
Thread.sleep(PAUSE);
}
}
// Helpers for checking whether type area got focus
private static final CountDownLatch typeAreaGainedFocus = new CountDownLatch(1);
private static final FocusListener typeAreaFocusListener = new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
typeAreaGainedFocus.countDown();
}
};
/*
* Create the test GUI - main frame with three text areas:
* 1) input area shows the current test key combination pressed by Java Robot
* 2) press area shows what key pressed events was received as the result of 1
* 3) type area (which is initially focused) shows symbols typed as the result of 1
*/
private static void createGUI() throws InterruptedException {
mainFrame = new Frame("Test Frame");
inputArea = new TextArea("",50, 30);
pressArea = new TextArea("", 50, 30);
typeArea = new TextArea("",50, 30);
// Add listeners to track keyboard events
typeArea.addFocusListener(typeAreaFocusListener);
typeArea.addKeyListener(keyListener);
typeArea.addInputMethodListener(inputMethodListener);
Panel labelPanel = new Panel();
labelPanel.add(new Label("Input Keys ---> Pressed Keys ---> Typed Chars"));
Panel textPanel = new Panel();
textPanel.setLayout(new FlowLayout());
textPanel.add(inputArea);
textPanel.add(pressArea);
textPanel.add(typeArea);
mainFrame.setLocation(200, 200);
mainFrame.add(labelPanel, BorderLayout.NORTH);
mainFrame.add(textPanel, BorderLayout.SOUTH);
mainFrame.pack();
mainFrame.setVisible(true);
typeArea.requestFocusInWindow();
// Check if type area got focus.
// Corresponding latch is released in the typeAreaFocusListener.
if(!typeAreaGainedFocus.await(PAUSE, TimeUnit.MILLISECONDS)) {
throw new RuntimeException("TEST ERROR: Failed to request focus in the text area for typing");
};
}
/*
* Destroy the test GUI
*/
private static void destroyGUI() {
if(typeArea != null) {
typeArea.removeFocusListener(typeAreaFocusListener);
typeArea.removeKeyListener(keyListener);
typeArea.removeInputMethodListener(inputMethodListener);
}
if(mainFrame != null) {
mainFrame.dispose();
}
}
/*
* Listener for keyPressed and keyTyped events
*/
private static final KeyListener keyListener = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
// Obtain pressed key code
int keyCode = e.getKeyCode();
if (keyCode == KeyEvent.VK_UNDEFINED) {
keyCode = e.getExtendedKeyCode();
}
if (keyCode == NEXT_MODIFIER) {
// Support for manual mode: notify main thread that testing may be continued
nextModifierSet.countDown();
} else if (keyCode == NEXT_KEY) {
// Update press area with the next line
pressArea.append("\n");
// Notify main thread that all events related to the key testing should already have been received
nextKey.countDown();
} else if (keyCode == TERMINATE_KEY) {
// Do nothing, press TERMINATE_KEY_SEQUENCE to support dead key testing
} else {
String keyText = KeyEvent.getKeyText(keyCode);
// Update press area with the pressed key text
pressArea.append(keysPressed.isEmpty() ? keyText : " " + keyText);
// Store pressed key code to the corresponding list
keysPressed.add(keyCode);
}
}
@Override
public void keyTyped(KeyEvent e) {
// Obtain typed char
char keyChar = e.getKeyChar();
int keyCode = KeyEvent.getExtendedKeyCodeForChar(keyChar);
if ((keyCode != NEXT_MODIFIER) && (keyCode != NEXT_KEY) && (keyCode != TERMINATE_KEY)) {
// Store typed char to the corresponding list
charsTyped.add(keyChar);
}
}
};
/*
* Test listener for InputMethod events.
* Such events may occur for a special case when a character is generated by pressing more than one key,
* for example, when attaching specific diacritic to a base letter, by pressing dead key + base key.
*/
static final InputMethodListener inputMethodListener = new InputMethodListener() {
@Override
public void inputMethodTextChanged(InputMethodEvent e) {
// Store generated chars to the corresponding list
if(e.getCommittedCharacterCount() > 0) {
CharacterIterator text = e.getText();
for (char ch = text.first(); ch != CharacterIterator.DONE; ch = text.next()) {
inputMethodChars.add(ch);
}
}
}
@Override
public void caretPositionChanged(InputMethodEvent event) {
// Do nothing
}
};
/*
* Main method for testing defined layout keys with the specific modifier set
*/
private static boolean testLayout(Layout layout, Modifier modifier) throws InterruptedException {
boolean result = true;
System.out.println("\nStart testing " + layout + " layout with " + modifier + " modifier(s):");
// Switch current keyboard layout to the test one
if(jbr) {
LWCToolkit.switchKeyboardLayout(layout.toString());
}
// Support for manual mode: wait while user switches the keyboard layout (if needed)
// and proceed with layout + modifier testing by pressing NEXT_MODIFIER.
// Corresponding latch is released in the keyListener when NEXT_MODIFIER key event is received.
nextModifierSet = new CountDownLatch(1);
if(autoTest) {
pressKey(NEXT_MODIFIER);
}
if(!nextModifierSet.await(PAUSE*10, TimeUnit.MILLISECONDS)) {
throw new RuntimeException("TEST ERROR: User has not proceeded with manual testing");
};
// Clean up the test text areas
inputArea.setText("");
pressArea.setText("");
// Workaround jdk8 setText() issue
typeArea.setText(" ");
// Store modifier keys to array
int[] modifiers = modifier.getModifiers();
// Go over all keys defined for the layout
for(LayoutKey layoutKey : layout.getLayoutKeys()) {
// Clean up synchronized lists which store pressed key codes and typed chars
keysPressed = new CopyOnWriteArrayList();
charsTyped = new CopyOnWriteArrayList();
inputMethodChars = new CopyOnWriteArrayList();
// Get Key object from LayoutKey enum
Key key = layoutKey.getKey();
// Obtain the key code for the current layout
int keyCode = key.getKeyCode();
// Append input area with the modifiers + key under test
if(!modifier.isEmpty()) {
inputArea.append(modifier + " ");
}
inputArea.append(KeyEvent.getKeyText(keyCode) + "\n");
// Robot only knows US keyboard layout.
// So, to press modifier + key under test on the current layout,
// one need to pass corresponding US layout key code to Robot.
pressKey(key.getKeyCode_US(), modifiers);
// The key under test may be a dead key which does not generate a character by itself.
// But it modifies the character generated by the key pressed immediately after.
// So need to press some TERMINATE_KEY key to avoid dead key influence on the next key under test.
// Corresponding diacritic character by itself can be generated by pressing dead key followed by space.
// That is why pressing TERMINATE_KEY=space after a dead key resets the dead key modifier
// and allows testing the generated character which may be useful for some layouts.
// Test does two checks: if modifier + key is a dead key and if key with no modifier is a dead key.
// Second check is needed for shortcuts as key.isDead(modifier) is always false for a shortcut.
if(key.isDead(modifier) || key.isDead()) {
pressKey(TERMINATE_KEY);
}
// Wait while NEXT_KEY is pressed, which identifies that modifier + key testing is finished.
// Corresponding latch is released in the keyListener when NEXT_KEY key event is received.
nextKey = new CountDownLatch(1);
pressKey(NEXT_KEY);
if(!nextKey.await(PAUSE, TimeUnit.MILLISECONDS)) {
throw new RuntimeException("TEST ERROR: "
+ KeyEvent.getKeyText(NEXT_KEY) + " key pressed event was not received");
};
// Define array of key codes expected to be pressed as the result of modifiers + key
int[] keysPattern = Arrays.copyOf(modifiers, modifiers.length + 1);
keysPattern[modifiers.length] = keyCode;
// Define array of key codes which were really pressed as the result of modifiers + key
int[] keysResult = listToInts(keysPressed);
// Do not check the resulting character in case it is null,
// i.e. no char is mapped to the modifier or there is no need to test it.
if (key.isCharNull(modifier)) {
// Check if the pressed key codes are equal to the expected ones
if(!checkResult(keysPattern, keysResult, null,null)) {
result = false;
};
} else {
// Define array of chars expected to be typed as the result of modifiers + key
// Do not expect any char typed as the result of shortcut (char is undefined in this case)
char[] charsPattern = key.isCharUndefined(modifier)
? new char[0] : new char[] { key.getChar(modifier) };
// Define array of chars which were really typed as the result of modifiers + key
// No keyTyped events may be generated as the result of pressing a dead key + space,
// so check if input method text was updated in this case.
char[] charsResult = (key.isDead(modifier) && charsTyped.isEmpty())
? listToChars(inputMethodChars) : listToChars(charsTyped);
// Check if pressed key codes and typed chars are equal to the expected ones
if(!checkResult(keysPattern, keysResult, charsPattern, charsResult)) {
result = false;
};
}
}
// Provide layout + modifier testing result
System.out.println("Finish testing " + layout + " layout with " + modifier + " modifier(s): "
+ (result ? "PASSED" : "FAILED"));
return result;
}
/*
* Use Java Robot to press the key with specific modifiers
*/
private static void pressKey(int keyCode, int... modifiers) {
robot.waitForIdle();
for (int modifier : modifiers) {
robot.keyPress(modifier);
}
robot.keyPress(keyCode);
robot.keyRelease(keyCode);
for (int modifier : modifiers) {
robot.keyRelease(modifier);
}
}
/*
* Check if keys pressed and char typed are equal to the expected ones
*/
private static boolean checkResult(int[] patternKeys, int[] resultKeys, char[] patternChars, char[] resultChars) {
boolean checkKeys = Arrays.equals(patternKeys, resultKeys);
boolean checkChars = Arrays.equals(patternChars, resultChars);
boolean result = (checkKeys & checkChars);
if(!result) {
String[] patternStr = (patternKeys != null) ? intsToStrings(patternKeys) : null;
String[] resultStr = (resultKeys != null) ? intsToStrings(resultKeys) : null;
String eqKeys = checkKeys ? " == " : " != ";
System.err.println("keyText : " + Arrays.toString(patternStr) + eqKeys + Arrays.toString(resultStr));
System.err.println("keyCode : " + Arrays.toString(patternKeys) + eqKeys + Arrays.toString(resultKeys));
if(showKeyCodeHex) {
String[] patternHex = intsToHexStrings(patternKeys);
String[] resultHex = intsToHexStrings(resultKeys);
System.err.println("keyCodeHex: " + Arrays.toString(patternHex) + eqKeys + Arrays.toString(resultHex));
}
}
if(!checkChars) {
String[] patternHex = (patternChars != null) ? charsToHexStrings(patternChars) : null;
String[] resultHex = (resultChars != null) ? charsToHexStrings(resultChars) : null;
String eqChars = checkChars ? " == " : " != ";
System.err.println("keyChar : " + Arrays.toString(patternChars) + eqChars + Arrays.toString(resultChars));
System.err.println("keyCharHex: " + Arrays.toString(patternHex) + eqChars + Arrays.toString(resultHex));
}
if(!result) {
System.err.println();
}
return result;
}
/*
* Transform list of Integers to int array
*/
private static int[] listToInts(List<Integer> list) {
return list.stream().mapToInt(i->i).toArray();
}
/*
* Transform list of Characters to char array
*/
private static char[] listToChars(List<Character> list) {
return list.stream().map(c -> c.toString()).collect(Collectors.joining()).toCharArray();
}
/*
* Transform array of int keys to array of Strings, mapping an int key to its text representation
*/
private static String[] intsToStrings(int[] ints) {
return Arrays.stream(ints).boxed().map(i -> KeyEvent.getKeyText(i)).toArray(String[]::new);
}
/*
* Transform array of int keys to array of Strings, mapping an int key to its hex representation
*/
private static String[] intsToHexStrings(int[] ints) {
return Arrays.stream(ints).boxed().map(i -> String.format("0x%1$04X", i)).toArray(String[]::new);
}
/*
* Transform array of char to array of Strings, mapping a char to its hex representation
*/
private static String[] charsToHexStrings(char[] chars) {
int[] result = new int[chars.length];
Arrays.setAll(result, i -> (int) chars[i]);
return intsToHexStrings(result);
}
}

View File

@@ -119,7 +119,7 @@ java/awt/BasicStroke/DashZeroWidth.java
java/awt/Choice/ItemStateChangeTest/ItemStateChangeTest.java 8169108 windows-all
java/awt/Choice/ChoiceGeneratesItemEvents/ChoiceGeneratesItemEvents.html 8047703 generic-all
java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html 6849922 macosx-all,windows-all
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,windows-all
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,windows-all,linux-all
java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all,windows-all
java/awt/Choice/GrabLockTest/GrabLockTest.java JRE-839 windows-all,macosx-all,linux-all
java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.html 8194045 generic-all
@@ -138,6 +138,7 @@ java/awt/Debug/DumpOnKey/DumpOnKey.java
java/awt/Dialog/DialogAboveFrame/DialogAboveFrame.java 8214923 windows-all,macosx-all
java/awt/Dialog/DialogAboveFrame/DialogAboveFrameTest.java 8215105 macosx-all,windows-all
java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java 8225790 linux-all
java/awt/Dialog/SiblingChildOrder/SiblingChildOrderTest.java 8215105,8221383 macosx-all,windows-all
java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java 8159069 windows-all
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all,linux-all,windows-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 8073636 macosx-all
@@ -180,7 +181,7 @@ java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest
java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html 7124275 macosx-all
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java 8169110 macosx-all,windows-all,linux-all
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JRE-898 macosx-all,linux-all,windows-all reproduced with Adopt, OpenJDK
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JRE-898 macosx-all,linux-all,windows-all
java/awt/Focus/RequestFocusToDisabledCompTest/RequestFocusToDisabledCompTest.java JRE-898 macosx-all
java/awt/Focus/ResetMostRecentFocusOwnerTest/ResetMostRecentFocusOwnerTest.java 8168294 macosx-all,windows-all,linux-all
java/awt/Focus/RollbackFocusFromAnotherWindowTest/RollbackFocusFromAnotherWindowTest.java JRE-898 macosx-all,linux-all
@@ -198,6 +199,7 @@ java/awt/FontMetrics/MaxAdvanceIsMax.java
java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786,8055833 macosx-all,linux-all
java/awt/Frame/ExceptionOnSetExtendedStateTest/ExceptionOnSetExtendedStateTest.java 8198237 macosx-all
java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
java/awt/Frame/FrameLocation/FrameLocation.java 8019803 macosx-all
java/awt/Frame/InvisibleOwner/InvisibleOwner.java 8169111 macosx-all,windows-all
java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java 8169472 windows-all
java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all
@@ -208,7 +210,7 @@ java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameRes
java/awt/Frame/WindowDragTest/WindowDragTest.java 8169470 generic-all
java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all,windows-all,linux-all
java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java 8047218 generic-all
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all,linux-all (linux: NPE commit testing)
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469,JBR-1897 windows-all,macosx-all,linux-all (linux: NPE commit testing)
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all,linux-all,macosx-all
java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 windows-all,macosx-all
java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java 7188711 macosx-all
@@ -221,15 +223,16 @@ java/awt/Graphics2D/DrawString/TextRenderingTest.java
java/awt/Graphics2D/FillTexturePaint/FillTexturePaint.java 8169463 windows-all
java/awt/Graphics2D/FlipDrawImage/FlipDrawImage.java 8169462 windows-all
java/awt/Graphics2D/ScaledTransform/ScaledTransform.java 8165951 windows-all,linux-all
java/awt/GraphicsDevice/CheckDisplayModes.java 8213119 macosx-all
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8197814 macosx-all,linux-all,windows-all
java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8197814 macosx-all,linux-all,windows-all
java/awt/GridLayout/LayoutExtraGaps/LayoutExtraGaps.java 8000171 windows-all
java/awt/JAWT/JAWT.sh 8197798 windows-all
java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.html JRE-898 macosx-all,linux-all
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 8198623 macosx-all,windows-all,linux-all
java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java 8198623 macosx-all,windows-all
java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java 8198623 macosx-all,windows-all,linux-all
java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.html 8198624 macosx-all,linux-all,windows-all
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html 8198626 macosx-all,windows-all
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html 8198626 macosx-all,windows-all,linux-all
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 generic-all
java/awt/List/FirstItemRemoveTest/FirstItemRemoveTest.html 8169461 windows-all
java/awt/List/KeyEventsTest/KeyEventsTest.html 8047703 windows-all
@@ -531,14 +534,14 @@ java/awt/Modal/ToFront/FrameToFrontTKModal2Test.java
java/awt/Modal/ToFront/FrameToFrontTKModal3Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Modal/ToFront/FrameToFrontTKModal4Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Modal/ToFront/FrameToFrontTKModal5Test.java 8196441 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all,windows-all
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/ModalDialogEnterExitEventsTest.java JRE-898 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all,windows-all,linux-all
java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all
java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.html 8169534 macosx-all,windows-all,linux-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 windows-all,macosx-all,linux-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all,linux-all (linux: NPE commit testing)
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all,macosx-all,linux-all (macosx,linux: NPE commit testing)
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java 8052166 linux-all
java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676,8129775 generic-all
java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java 8013428 generic-all
@@ -549,6 +552,7 @@ java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.html
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
java/awt/Paint/PaintNativeOnUpdate.java 8028000 generic-all
java/awt/Paint/bug8024864.java 8176512 windows-all,macosx-all,linux-all
java/awt/PrintJob/PrinterException.java 8194045 generic-all
@@ -560,7 +564,7 @@ java/awt/ScrollPane/ScrollPanePreferredSize/ScrollPanePreferredSize.java
java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java 8196018 windows-all,linux-all
java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235,8159592,8134231 macosx-all,windows-all,linux-all
java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java 8203004 linux-all
java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all,linux-4.15.0-45-generic (kubuntu)
java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all,linux-all, windows-all (windows, linux - time out)
java/awt/TextArea/DisposeTest/TestDispose.java JBR-1905 generic-all
java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all
java/awt/TextField/SelectionInvisibleTest/SelectionInvisibleTest.java 8169533 macosx-all,windows-all
@@ -582,7 +586,7 @@ java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java
java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 8197575,8150540 macosx-all,windows-all
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8197575,8150540 macosx-all,windows-all
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8197575,8150540 macosx-all,windows-all
java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all
java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java 8196440 linux-all,macosx-all (commit: mac OOME)
java/awt/Window/8159168/SetShapeTest.java 8208507 generic-all
java/awt/Window/BackgroundIsNotUpdated/BackgroundIsNotUpdated.java 8142536 generic-all
java/awt/Window/Grab/GrabTest.java 8196019 macosx-all,windows-all,linux-all
@@ -597,6 +601,7 @@ java/awt/Window/ShapedAndTranslucentWindows/ShapedByAPI.java
java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucent.java 8078999,8198690 macosx-all,linux-all,windows-all
java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java 8013450 macosx-all,linux-all,windows-all (windows: commit testing time out)
java/awt/Window/ShapedAndTranslucentWindows/StaticallyShaped.java 8198690,8165218 macosx-all,linux-all,windows-all
java/awt/Window/ShapedAndTranslucentWindows/Translucent.java 8222328 linux-all,windows-all
java/awt/Window/ShapedAndTranslucentWindows/TranslucentChoice.java 8194129 macosx-all,windows-all,linux-all
java/awt/Window/ShapedAndTranslucentWindows/TranslucentWindowClick.java 8194129 macosx-all,windows-all,linux-all
java/awt/Window/AlwaysOnTop/AutoTestOnTop.java 6847593,8194045 macosx-all,windows-all,linux-all
@@ -755,7 +760,6 @@ javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
# jdk_net
java/net/CookieHandler/B6791927.java 8234007 general-all
java/net/MulticastSocket/NoLoopbackPackets.java 7122846 macosx-all
java/net/MulticastSocket/SetLoopbackMode.java 7122846 macosx-all
java/net/MulticastSocket/Test.java 7145658,8207404 macosx-all,aix-all
@@ -910,7 +914,7 @@ javax/sound/midi/Sequencer/Recording.java
# jdk_swing
com/sun/java/swing/plaf/windows/Test8173145.java 8198334 windows-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all,linux-all
javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
javax/swing/JButton/4368790/bug4368790.java 8065582 macosx-all
javax/swing/JButton/8151303/PressedIconTest.java 8198689 macosx-all,windows-all (windows: commit testing)
@@ -921,7 +925,7 @@ javax/swing/JColorChooser/Test6541987.java
javax/swing/JColorChooser/Test6827032.java 8197825 windows-all
javax/swing/JColorChooser/Test7194184.java 8194126,8072110 linux-all,macosx-all,windows-all
javax/swing/JColorChooser/Test8051548.java 8197552 macosx-all,windows-all,linux-all
javax/swing/JComboBox/4743225/bug4743225.java 8171302 windows-all,macosx-all
javax/swing/JComboBox/4743225/bug4743225.java 8171302 windows-all,macosx-all,linux-all
javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all,macosx-all
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all,linux-all
javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
@@ -941,6 +945,7 @@ javax/swing/JComponent/4337267/bug4337267.java
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
javax/swing/JComponent/7154030/bug7154030.java 7190978 generic-all
javax/swing/DataTransfer/8059739/bug8059739.java 8199074 generic-all
javax/swing/GraphicsConfigNotifier/StalePreferredSize.java 8213121 macosx-all,windows-all
javax/swing/GroupLayout/6613904/bug6613904.java 8199072 generic-all
javax/swing/JEditorPane/5076514/bug5076514.java 8198321 generic-all
javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all,windows-all
@@ -958,6 +963,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
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
@@ -965,7 +971,7 @@ javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java
javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java 8186513 generic-all
javax/swing/JInternalFrame/DockIconRepaint/DockIconRepaint.java 8208289 macosx-all
javax/swing/JInternalFrame/Test6325652.java 8160880,8196467 linux-all,macosx-all,windows-all
javax/swing/JInternalFrame/Test6505027.java 8172535 macosx-all,windows-all
javax/swing/JInternalFrame/Test6505027.java 8172535 macosx-all,windows-all,linux-all
javax/swing/JLabel/6596966/bug6596966.java 8197552,8040914 macosx-all,windows-all,linux-all
javax/swing/JList/6462008/bug6462008.java 7156347 generic-all
javax/swing/JMenu/4213634/bug4213634.java 8197552 macosx-all,windows-all,linux-all
@@ -980,7 +986,7 @@ javax/swing/JMenuItem/4171437/bug4171437.java
javax/swing/JMenuItem/4654927/bug4654927.java 8172536 macosx-all,windows-all,linux-all
javax/swing/JMenuItem/6209975/bug6209975.java 8204062 macosx-all,windows-all
javax/swing/JMenuItem/6249972/bug6249972.java 8197552 macosx-all,windows-all,linux-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all,windows-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all,windows-all,linux-all
javax/swing/JPopupMenu/4769039/bug4769039.java 8194045 generic-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/JPopupMenu/4966112/bug4966112.java 8064915,7151826 macosx-all,linux-all
@@ -1025,7 +1031,7 @@ javax/swing/JTextArea/TextViewOOM/TextViewOOM.java
javax/swing/JTextField/4306756/bug4306756.java 8194045 generic-all
javax/swing/JTextField/8036819/bug8036819.java 8197552 macosx-all,windows-all,linux-all
javax/swing/JToolTip/4846413/bug4846413.java 8172407 macosx-all,windows-all
javax/swing/JTree/4330357/bug4330357.java 8029682,8003839 macosx-all,windows-all
javax/swing/JTree/4330357/bug4330357.java 8029682,8003839 macosx-all,windows-all,linux-all
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
javax/swing/JTree/4908142/bug4908142.java 8197552,8172065 macosx-all,windows-all,linux-all
javax/swing/JTree/4927934/bug4927934.java 8197552,8172063 macosx-all,windows-all,linux-all
@@ -1043,11 +1049,11 @@ javax/swing/LookAndFeel/8145547/DemandGTK2.sh
javax/swing/LookAndFeel/8145547/DemandGTK3.sh 8215539,8212903 linux-all
javax/swing/MultiUIDefaults/4300666/bug4300666.java 7105119 macosx-all
javax/swing/MultiUIDefaults/Test6860438.java 8198391 generic-all
javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all
javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all,windows-all
javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099,8208565 macosx-all,windows-all,linux-all
javax/swing/PopupFactory/8048506/bug8048506.java 8202660 windows-all
javax/swing/ProgressMonitor/ProgressMonitorEscapeKeyPress.java 8197552 macosx-all,windows-all,linux-all
javax/swing/RepaintManager/IconifyTest/IconifyTest.java 8072110 linux-all,windows-all
javax/swing/RepaintManager/IconifyTest/IconifyTest.java 8072110,8221903 linux-all,windows-all,macosx-all (commit: macosx)
javax/swing/SpringLayout/4726194/bug4726194.java 8198399 generic-all
javax/swing/SwingUtilities/4917669/bug4917669.java 8197552,8172064 macosx-all,windows-all,linux-all
javax/swing/SwingUtilities/6797139/bug6797139.java 8198400 generic-all
@@ -1186,6 +1192,7 @@ com/sun/jdi/RedefineCrossEvent.java
############################################################################
jdk/internal/platform/cgroup/TestCgroupMetrics.java 8222533 linux-all
jdk/internal/platform/docker/TestSystemMetrics.java 8224502 linux-all
# jdk_jfr

View File

@@ -2,13 +2,12 @@ java/awt/Choice/ChoiceLocationTest/ChoiceLocationTest.java
java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java nobug macosx-all,windows-all
java/awt/Choice/GetSizeTest/GetSizeTest.java nobug macosx-all,windows-all
java/awt/Choice/ResizeAutoClosesChoice/ResizeAutoClosesChoice.java nobug windows-all,linux-all
java/awt/Component/7097771/bug7097771.java nobug windows-all
java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java nobug macosx-all
java/awt/Component/F10TopToplevel/F10TopToplevel.html nobug linux-all
java/awt/Component/PaintAll/PaintAll.java nobug linux-all
java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java nobug generic-all
java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java nobug macosx-all,windows-all
java/awt/Dialog/NestedDialogs/Modal/NestedModalDialogTest.java nobug macosx-all,windows-all
java/awt/Dialog/NestedDialogs/Modeless/NestedModelessDialogTest.java nobug macosx-all,windows-all,linux-all
java/awt/Dialog/NonResizableDialogSysMenuResize/NonResizableDialogSysMenuResize.java nobug macosx-all,windows-all
java/awt/Dialog/SiblingChildOrder/SiblingChildOrderTest.java nobug macosx-all,windows-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html nobug macosx-all,windows-all
@@ -30,6 +29,7 @@ java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java
java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java nobug macosx-all,windows-all,linux-all
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java nobug macosx-all
java/awt/Focus/RequestFocusAndHideTest/RequestFocusAndHideTest.java nobug macosx-all
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java nobug linux-all,macosx-all,windows-all reproduced with Adopt, OpenJDK
java/awt/Focus/WindowIsFocusableAccessByThreadsTest/WindowIsFocusableAccessByThreadsTest.java nobug macosx-all,windows-all
java/awt/Frame/8158918/SetExtendedState.java nobug linux-all
java/awt/Frame/FrameLocation/FrameLocation.java nobug linux-all
@@ -58,8 +58,6 @@ java/awt/List/ItemEventTest/ItemEventTest.java
java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java nobug macosx-all,windows-all
java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java nobug linux-all
java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java nobug linux-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java nobug macosx-all,windows-all
java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java nobug macosx-all,windows-all
java/awt/Mixing/HWDisappear.java nobug macosx-all,windows-all
java/awt/Mixing/JButtonInGlassPane.java nobug macosx-all,linux-all,windows-all
java/awt/Mixing/LWComboBox.java nobug macosx-all,linux-all,windows-all
@@ -70,6 +68,7 @@ java/awt/Mixing/Validating.java
java/awt/Modal/LWModalTest/LWModalTest.java nobug macosx-all,windows-all
java/awt/Modal/ModalDialogOrderingTest/ModalDialogOrderingTest.java nobug macosx-all,windows-all
java/awt/Modal/ToBack/ToBackModeless6Test.java nobug macosx-all,linux-all,windows-all
java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.java nobug macosx-all,linux-all
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java nobug macosx-all,windows-all,linux-all
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java nobug macosx-all,linux-all,windows-all
java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java nobug macosx-all,windows-all
@@ -95,14 +94,14 @@ java/awt/Toolkit/RealSync/Test.java
java/awt/Toolkit/SunDisplayChangerLeakTest/SunDisplayChangerLeakTest.java nobug macosx-all,linux-all,windows-all
java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java nobug macosx-all,windows-all
java/awt/Window/ChangeWindowResizabilty/ChangeWindowResizabiltyTest.java nobug windows-all,linux-all
java/awt/Window/FindOwner/FindOwnerTest.html nobug macosx-all,windows-all
java/awt/Window/FindOwner/FindOwnerTest.html nobug macosx-all,windows-all,linux-all
java/awt/Window/GetScreenLocation/GetScreenLocationTest.java nobug macosx-all,linux-all,windows-all
java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java nobug macosx-all
java/awt/Window/MaximizeOffscreen/MaximizeOffscreenTest.java nobug macosx-all,linux-all
java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java nobug linux-all
java/awt/Window/ScreenLocation/ScreenLocationTest.java nobug linux-all
java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.java nobug linux-all
java/awt/Window/ShapedAndTranslucentWindows/Translucent.java nobug windows-all
java/awt/Window/ShapedAndTranslucentWindows/Translucent.java nobug windows-all,macosx-all
java/awt/Window/ShapedAndTranslucentWindows/WindowOpacity.java nobug windows-all
java/awt/Window/TopLevelLocation/TopLevelLocation.java nobug linux-all,macosx-all
java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java nobug macosx-all
@@ -124,7 +123,6 @@ java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java nobug macosx-all,windows-all
java/awt/event/KeyEvent/KeyTyped/CtrlASCII.html nobug linux-all,windows-all
java/awt/event/KeyEvent/RobotCrash/RobotCrash.java nobug linux-all,windows-all
java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java nobug macosx-all,linux-all
java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java nobug macosx-all,windows-all,linux-all
java/awt/event/MouseEvent/EnterAsGrabbedEvent/EnterAsGrabbedEvent.java nobug macosx-all,windows-all
java/awt/event/MouseEvent/MouseButtonsTest/MouseButtonsTest.java nobug macosx-all,linux-all,windows-all
@@ -144,6 +142,7 @@ java/awt/hidpi/properties/HiDPIPropertiesUnixTest.java
java/awt/hidpi/properties/HiDPIPropertiesWindowsTest.java nobug windows-all
java/awt/image/DrawImage/EABlitTest.java nobug windows-all
java/awt/image/DrawImage/IncorrectOffset.java nobug windows-all
java/awt/image/DrawImage/UnmanagedDrawImagePerformance.java JBR-1801 windows-all
java/awt/image/VolatileImage/DrawBufImgOp.java nobug windows-all
java/awt/image/VolatileImage/DrawHugeImageTest.java nobug windows-all
java/awt/image/VolatileImage/TransparentVImage.java nobug windows-all
@@ -153,8 +152,9 @@ java/awt/keyboard/AltPlusNumberKeyCombinationsTest/AltPlusNumberKeyCombinationsT
java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java nobug windows-all,linux-all
javax/swing/JComboBox/4199622/bug4199622.java nobug windows-all
javax/swing/JComboBox/4523758/bug4523758.java nobug macosx-all,windows-all
javax/swing/JDialog/Transparency/TransparencyTest.java nobug macosx-all,windows-all
javax/swing/JComboBox/4523758/bug4523758.java nobug macosx-all,windows-all,linux-all
javax/swing/JComponent/6989617/bug6989617.java nobug macosx-all
javax/swing/JDialog/Transparency/TransparencyTest.java nobug linux-all,macosx-all,windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest.java nobug windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest_i18n.java nobug windows-all
javax/swing/JFileChooser/6489130/bug6489130.java nobug macosx-all
@@ -167,27 +167,31 @@ javax/swing/JInternalFrame/6725409/bug6725409.java
javax/swing/JInternalFrame/8020708/bug8020708.java nobug windows-all,linux-all
javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java nobug macosx-all,linux-all,windows-all
javax/swing/JInternalFrame/InternalFrameIsNotCollectedTest.java nobug macosx-all
javax/swing/JInternalFrame/NormalBoundsTest.java nobug macosx-all
javax/swing/JInternalFrame/Test6802868.java nobug macosx-all,linux-all
javax/swing/JLabel/7004134/bug7004134.java nobug macosx-all,linux-all
javax/swing/JList/6510999/bug6510999.java nobug linux-all,macosx-all,windows-all
javax/swing/JList/BasicListTest.java nobug macosx-all
javax/swing/JMenu/6538132/bug6538132.java nobug windows-all
javax/swing/JMenu/8178430/LabelDotTest.java nobug linux-all
javax/swing/JMenuItem/8139169/ScreenMenuBarInputTwice.java nobug macosx-all
javax/swing/JMenuItem/8158566/CloseOnMouseClickPropertyTest.java nobug windows-all
javax/swing/JOptionPane/6428694/bug6428694.java nobug windows-all
javax/swing/JPopupMenu/4634626/bug4634626.java nobug windows-all
javax/swing/JPopupMenu/6544309/bug6544309.java nobug linux-all,windows-all
javax/swing/JPopupMenu/6691503/bug6691503.java nobug macosx-all
javax/swing/JPopupMenu/6827786/bug6827786.java nobug windows-all
javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java nobug macosx-all,windows-all
javax/swing/JRadioButton/8041561/bug8041561.java nobug windows-all
javax/swing/JScrollBar/7163696/Test7163696.java nobug windows-all
javax/swing/JScrollBar/bug4202954/bug4202954.java nobug windows-all
javax/swing/JSlider/6401380/bug6401380.java nobug windows-all
javax/swing/JTabbedPane/7161568/bug7161568.java nobug windows-all
javax/swing/JTextArea/7049024/bug7049024.java.bug7049024 nobug linux-all
javax/swing/JTabbedPane/7161568/bug7161568.java nobug windows-all,linux-all
javax/swing/JTabbedPane/7170310/bug7170310.java nobug macosx-all,linux-all
javax/swing/JTextArea/8149849/DNDTextToScaledArea.java nobug windows-all
javax/swing/JToolTip/6219960/bug6219960.java nobug macosx-all,windows-all
javax/swing/JTree/4633594/JTreeFocusTest.java nobug macosx-all,windows-all
javax/swing/JTree/6578666/bug6578666.java nobug macosx-all
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucent.java nobug windows-all
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentGradient.java nobug windows-all
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java nobug macosx-all,linux-all,windows-all
@@ -198,7 +202,7 @@ javax/swing/event/RightAltKeyTest.java
javax/swing/plaf/metal/MetalGradient/8163193/ButtonGradientTest.java nobug linux-all,windows-all
javax/swing/plaf/nimbus/8041642/ScrollBarThumbVisibleTest.java nobug windows-all
javax/swing/plaf/nimbus/8041642/bug8041642.java nobug windows-all
javax/swing/plaf/nimbus/8057791/bug8057791.java nobug windows-all
javax/swing/plaf/nimbus/8057791/bug8057791.java nobug windows-all,linux-all
javax/swing/plaf/nimbus/TestNimbusOverride.java nobug windows-all
javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java nobug windows-all
javax/swing/plaf/synth/SynthScrollbarThumbPainter/SynthScrollbarThumbPainterTest.java nobug windows-all

View File

@@ -36,6 +36,7 @@ import java.awt.geom.QuadCurve2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -44,6 +45,7 @@ import static org.junit.Assert.assertTrue;
public class RenderPerfTest {
private final static int N = 1000;
private final static int K = 5;
private final static float WIDTH = 800;
private final static float HEIGHT = 800;
private final static float R = 25;
@@ -187,6 +189,32 @@ public class RenderPerfTest {
}
}
static class RandomTextParticleRenderer extends TextParticleRenderer {
StringBuffer buffer = new StringBuffer();
Random rnd = new Random();
int sLen;
RandomTextParticleRenderer(int n, int k, float r, Object hint) {
super(n, r, hint);
sLen = k;
}
@Override
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, hint);
setPaint(g2d, id);
buffer.setLength(0);
for (int i = 0; i < sLen; i++) {
buffer.appendCodePoint(0x20 + (Math.abs(rnd.nextInt()) % 0xfd0));
}
g2d.drawString(buffer.toString(),
(int)(x[id] - r), (int)(y[id] - r));
}
}
static class FlatOvalRotParticleRenderer extends FlatParticleRenderer {
@@ -516,6 +544,8 @@ public class RenderPerfTest {
private static final ParticleRenderer whiteTextRendererGray =
new WhiteTextParticleRenderer(R, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
private static final ParticleRenderer randomTextRendererGray =
new RandomTextParticleRenderer(N, K, R, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
@Test
public void testFlatBubbles() throws Exception {
@@ -752,6 +782,25 @@ public class RenderPerfTest {
report("TextLCD", fps);
}
@Test
public void testRandomTextBubblesGray() throws Exception {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, randomTextRendererGray);
}
@Override
public void update() {
balls.update();
}
});
report("RandomTextGray", fps);
}
@Test
public void testTextBubblesGray() throws Exception {

View File

@@ -0,0 +1,139 @@
package quality.text;
import org.junit.Assert;
import org.junit.Test;
import java.awt.*;
import java.util.Locale;
public class BundledFontTest {
/* Tests for the following font names:
"droid sans"
"droid sans bold"
"droid sans mono"
"droid sans mono slashed"
"droid sans mono dotted"
"droid serif"
"droid serif bold"
"fira code"
"fira code light"
"fira code medium"
"fira code retina"
"inconsolata"
"roboto light"
"roboto thin"
"source code pro"
"jetbrains mono"
*/
@SuppressWarnings("SameParameterValue")
private void doTestFont(String name, int style) {
Font f = new Font(name, style, 20);
String family = f.getFamily(Locale.ENGLISH);
Assert.assertTrue(family.equalsIgnoreCase(name));
}
private void doTestFont(String name)
throws Exception {
doTestFont(name, Font.PLAIN);
}
@Test
public void testDroidSans() throws Exception {
doTestFont("Droid Sans");
}
@Test
public void testDroidSansBold() throws Exception {
doTestFont("Droid Sans");
doTestFont("Droid Sans", Font.BOLD);
}
@Test
public void testDroidSansMono() throws Exception {
doTestFont("Droid Sans Mono");
}
@Test
public void testDroidSansMonoSlashed() throws Exception {
doTestFont("Droid Sans Mono Slashed");
}
@Test
public void testDroidSansMonoDotted() throws Exception {
doTestFont("Droid Sans Mono Dotted");
}
@Test
public void testDroidSerif() throws Exception {
doTestFont("Droid Serif");
}
@Test
public void testDroidSerifBold() throws Exception {
doTestFont("Droid Serif");
doTestFont("Droid Serif", Font.BOLD);
}
@Test
public void testDroidSerifItalic() throws Exception {
doTestFont("Droid Serif");
doTestFont("Droid Serif", Font.ITALIC);
}
@Test
public void testFiraCode() throws Exception {
doTestFont("Fira Code");
}
@Test
public void testFiraCodeLight() throws Exception {
doTestFont("Fira Code Light");
}
@Test
public void testFiraCodeMedium() throws Exception {
doTestFont("Fira Code Medium");
}
@Test
public void testInconsolata() throws Exception {
doTestFont("Inconsolata");
}
@Test
public void testRobotoLight() throws Exception {
doTestFont("Roboto Light");
}
@Test
public void testRobotoThin() throws Exception {
doTestFont("Roboto Thin");
}
@Test
public void testSourceCodePro() throws Exception {
doTestFont("Source Code Pro");
}
@Test
public void testJetBrainsMono() throws Exception {
doTestFont("JetBrains Mono");
}
@Test
public void testJetBrainsMonoBold() throws Exception {
doTestFont("JetBrains Mono", Font.BOLD);
}
@Test
public void testJetBrainsMonoItalic() throws Exception {
doTestFont("JetBrains Mono", Font.ITALIC);
}
@Test
public void testJetBrainsMonoBoldItalic() throws Exception {
doTestFont("JetBrains Mono", Font.BOLD | Font.ITALIC);
}
}

View File

@@ -354,10 +354,6 @@ public class Platform {
* This should match the #if condition in ClassListParser::load_class_from_source().
*/
public static boolean areCustomLoadersSupportedForCDS() {
boolean isLinux = Platform.isLinux();
boolean is64 = Platform.is64bit();
boolean isSolaris = Platform.isSolaris();
return (is64 && (isLinux || isSolaris));
return (is64bit() && (isLinux() || isSolaris() || isOSX() || isWindows()));
}
}