Compare commits

..

310 Commits

Author SHA1 Message Date
Vitaly Provodin
9e4b9ab9fe JBR-4154 modify searching jbr tag 2026-01-30 08:37:48 +04:00
Konanki Sreenath
118915d36a 8368032: Enhance Certificate Checking
Backport-of: 8747d00ad14838d5a2e3403b807a60a722044374
2026-01-30 07:48:57 +04:00
Sean Coffey
d2f6f04b1c 8372753: jpackage ignores --file-associations option with predefined app image
Backport-of: 44c11c754e3612f83ca4027ad3d43b90d33e86c5
2026-01-30 07:48:56 +04:00
Kerem Kat
639ad76841 8371425: Include folder names in vscode workspace virtual folders
Backport-of: 98f40e4575
2026-01-30 07:48:56 +04:00
SendaoYan
70501a7163 8371697: test/jdk/java/nio/file/FileStore/Basic.java fails after 8360887 on linux
Backport-of: 46b5e588ab
2026-01-30 07:48:56 +04:00
SendaoYan
530538ec6e 8368982: Test sun/security/tools/jarsigner/EC.java completed and timed out
Backport-of: b0721e2859
2026-01-30 07:48:56 +04:00
Alexey Semenyuk
3195df109f 8371094: --mac-signing-key-user-name no longer works
Reviewed-by: aivanov
Backport-of: 0555f6228c
2026-01-30 05:18:11 +04:00
Aleksey Shipilev
26e637f5e8 8370318: AES-GCM vector intrinsic may read out of bounds (x86_64, AVX-512)
Backport-of: 7bb490c4bf
2026-01-30 05:18:11 +04:00
Renjith Kannath Pariyangad
8de23b6208 8370465: Right to Left Orientation Issues with MenuItem Component
Backport-of: fc5df4ac8f
2026-01-30 05:18:10 +04:00
SendaoYan
d360ca79ed 8366694: Test JdbStopInNotificationThreadTest.java timed out after 60 second
8366850: Test com/sun/jdi/JdbStopInNotificationThreadTest.java failed

Reviewed-by: phh
Backport-of: ed62bda2e0
2026-01-30 05:18:10 +04:00
Ravi.Patel8
8d3bfa4fe0 8368606: Printer lookup returns empty on AIX platform due to uninitialized results list
Backport-of: 9b1633ded0
2026-01-30 05:18:09 +04:00
Paul Hübner
9018865725 8366229: runtime/Thread/TooSmallStackSize.java runs with all collectors
Backport-of: 075ebb4ee5
2026-01-30 05:18:09 +04:00
Bhogesh Patil
bcddf0fa77 8370428: Change milestone to fcs for all releases
Reviewed-by: jwilhelm
2026-01-30 05:18:09 +04:00
Srinivas Vamsi Parasa
c3ab7dfff8 8354348: Enable Extended EVEX to REX2/REX demotion for commutative operations with same dst and src2
Backport-of: c41add8d3e
2026-01-30 05:18:08 +04:00
Vladimir Petko
7c50ced913 8359735: [Ubuntu 25.10] java/lang/ProcessBuilder/Basic.java, java/lang/ProcessHandle/InfoTest.java fail due to rust-coreutils
Reviewed-by: rriggs
Backport-of: c6ab63d306
2026-01-30 05:18:08 +04:00
SendaoYan
4bbbc89bff 8367904: Test java/net/InetAddress/ptr/Lookup.java should throw SkippedException
Backport-of: c0815e40b6
2026-01-30 05:18:07 +04:00
Vladimir Petko
94203b85f9 8370049: [s390x] G1 barrier compareAndExchange does not return old value when compareExchange fails
Backport-of: 5609ee11a2
2026-01-30 05:18:07 +04:00
Hari Prasad Kummari
2ea60ba454 8346884: Add since checker test to jdk.editpad
Backport-of: 7daf9813c0
2026-01-30 05:18:06 +04:00
David Briemann
3526c6957b 8369979: Flag UsePopCountInstruction was accidentally disabled on PPC64
Backport-of: 9b9559a2e3
2026-01-30 05:18:06 +04:00
Matthias Baesken
7f47b088d8 8369563: Gtest dll_address_to_function_and_library_name has issues with stripped pdb files
Backport-of: 98e1d2fab1
2026-01-30 05:18:06 +04:00
Matthias Baesken
7e424d49f6 8368960: Adjust java UL logging in the build
Backport-of: bd25db1fb8
2026-01-30 05:18:05 +04:00
SendaoYan
f18d1fd2dd 8367869: Test java/io/FileDescriptor/Sync.java timed out
Backport-of: 61c5245bf7
2026-01-30 05:18:05 +04:00
SendaoYan
7d8cc48e1e 8367988: NewFileSystemTests.readOnlyZipFileFailure fails when run by root user
Backport-of: b03b6f54c5
2026-01-30 05:18:04 +04:00
Martin Doerr
fd7a9c35f3 8369946: Bytecode rewriting causes Java heap corruption on PPC
Backport-of: 6bf3581bba
2026-01-30 05:18:04 +04:00
Matias Saavedra Silva
17e0cbad03 8364660: ClassVerifier::ends_in_athrow() should be removed
Reviewed-by: jwilhelm, dlong, rhalade
Backport-of: 1bd814c3b2
2026-01-30 05:18:04 +04:00
Yagmur Eren
1dd7512bbd 8358748: Large page size initialization fails with assert "page_size must be a power of 2"
Reviewed-by: ayang, dholmes
Backport-of: 40bc083267
2026-01-30 05:18:03 +04:00
Viktor Klang
d3e8ef53b7 8369656: Calling CompletableFuture.join() could execute task in common pool
Reviewed-by: alanb
Backport-of: b5b83247da
2026-01-30 05:18:03 +04:00
Mohamed Issa
f1b6a6b4cd 8358556: Assert when running with -XX:-UseLibmIntrinsic
Backport-of: ef4cbec6fb
2026-01-30 05:18:03 +04:00
Feilong Jiang
31757a29da 8369947: Bytecode rewriting causes Java heap corruption on RISC-V
Backport-of: 4625199358
2026-01-30 05:18:02 +04:00
William Kemper
aece9e0b48 8370048: Shenandoah: Deprecated ShenandoahPacing option
Reviewed-by: ysr
2026-01-30 05:18:02 +04:00
Anawesha Khuntia
a2d2229ff4 8364764: java/nio/channels/vthread/BlockingChannelOps.java subtests timed out
Backport-of: f0498c2aed
2026-01-30 05:18:02 +04:00
Kieran Farrell
d2050cecaf 8365086: CookieStore.getURIs() and get(URI) should return an immutable List
Backport-of: 022e29a775
2026-01-30 05:18:01 +04:00
Justin King
d2ffd294d8 8369506: Bytecode rewriting causes Java heap corruption on AArch64
Reviewed-by: aph
Backport-of: 18fd047702
2026-01-30 05:18:01 +04:00
Hari Prasad Kummari
e3e335e449 8365660: test/jdk/sun/security/pkcs11/KeyAgreement/ tests skipped without SkipExceprion
Backport-of: ec7361e082
2026-01-30 05:18:00 +04:00
Cesar Soares Lucas
1b8418aad8 8357396: Refactor nmethod::make_not_entrant to use Enum instead of "const char*"
Backport-of: 62fde68708
2026-01-30 05:18:00 +04:00
Alexey Semenyuk
84c7e312b2 8369853: jpackage signing tests fail after JDK-8358723
Backport-of: 95def24b02
2026-01-30 05:17:59 +04:00
Alexey Semenyuk
754e25e8e9 8369868: Compilation error in Win8365790Test.java with JDK-8358723 fix resulting in CI tier3 failure
Reviewed-by: aivanov
2026-01-30 05:17:59 +04:00
Chris Dennis
f5375d45d2 8362123: ClassLoader Leak via Executors.newSingleThreadExecutor(...)
Reviewed-by: aph
Backport-of: d5a207994b
2026-01-30 05:17:59 +04:00
Matthias Baesken
975659cbac 8369560: Slowdebug build without CDS fails
Reviewed-by: lucy
Backport-of: 0af959a340
2026-01-30 05:17:58 +04:00
Matthias Baesken
561bca6b25 8369657: [AIX] TOC overflow in static-launcher build when building slowdebug after JDK-8352064
Backport-of: 4b85ba9067
2026-01-30 05:17:58 +04:00
Kieran Farrell
be88154727 8367237: Thread-Safety Usage Warning for java.text.Collator Classes
Reviewed-by: jlu
Backport-of: 64155dfac0
2026-01-30 05:17:57 +04:00
SendaoYan
d961fae855 8368668: Several vmTestbase/vm/gc/compact tests timed out on large memory machine
Backport-of: 9093d3a04c
2026-01-30 05:17:57 +04:00
Vladimir Petko
15e7bc5997 8369450: [Ubuntu 25.10] openjdk fails to build due to rust-coreutils date
Backport-of: b73228b51c
2026-01-30 05:17:56 +04:00
Vanitha B P
88809673ff 8367598: Switch to CRC32C for SEED calculation in jdk.test.lib.Utils
Backport-of: 29908148f8
2026-01-30 05:17:56 +04:00
Anawesha Khuntia
cd78fb00e3 8333526: Restructure java/nio/channels/DatagramChannel/StressNativeSignal.java to a fail fast exception handling policy
Backport-of: 4f4030a423
2026-01-30 05:17:55 +04:00
Joakim Nordström
6f55e6f965 8365913: Support latest MSC_VER in abstract_vm_version.cpp
Backport-of: af532cc1b2
2026-01-30 05:17:55 +04:00
Ashish
4f53417379 8359167: Remove unused test/hotspot/jtreg/vmTestbase/nsk/share/jpda/BindServer.java
Reviewed-by: cjplummer, coffeys
Backport-of: 982064e50c
2026-01-30 05:17:54 +04:00
Erik Gahlin
f36e7808f5 8368670: Deadlock in JFR on event register + class load
Reviewed-by: mgronlun
Backport-of: 5fccabff15
2026-01-30 05:17:54 +04:00
Ramesh Bhagavatam Gangadhar
021bdd427f 8366342: Key generator and key pair generator tests skipping, but showing as passed
Backport-of: 7690a45f77
2026-01-30 05:17:54 +04:00
Feilong Jiang
c47029b756 8369616: JavaFrameAnchor on RISC-V has unnecessary barriers and wrong store order in MacroAssembler
Backport-of: 72663695da
2026-01-30 05:17:53 +04:00
Matthias Baesken
109f16f7cd 8368565: Adjust comment regarding dependency of libjvm.so to librt
Backport-of: 7bfdb01207
2026-01-30 05:17:53 +04:00
Shivangi Gupta
184a465e1b 8201778: Speed up test javax/net/ssl/DTLS/PacketLossRetransmission.java
Backport-of: fc3e3e26c5
2026-01-30 05:17:53 +04:00
Sean Coffey
d158ba0a3d 8369319: java/net/httpclient/CancelRequestTest.java fails intermittently
Reviewed-by: dfuchs
2026-01-30 05:17:52 +04:00
Erik Gahlin
fe1aafd0e6 8364190: JFR: RemoteRecordingStream withers don't work
Reviewed-by: mgronlun
Backport-of: da0d9598d0
2026-01-30 05:17:52 +04:00
Kieran Farrell
3f35cb9022 8367021: Regression in LocaleDataTest refactoring
Backport-of: 48831c65b5
2026-01-30 05:17:52 +04:00
Kieran Farrell
5157aef64d 8369184: SimpleTimeZone equals() Returns True for Unequal Instances with Different hashCode Values
Backport-of: 37b725d9c1
2026-01-30 05:17:52 +04:00
Ramesh Bhagavatam Gangadhar
13176e057f 8366159: SkippedException is treated as a pass for pkcs11/KeyStore, pkcs11/SecretKeyFactory and pkcs11/SecureRandom
Backport-of: 166ef5e7b1
2026-01-30 05:17:51 +04:00
Alexey Ivanov
a8deb6c6dd 8370331: Problemlist 2 tests due to failures in the CI pipeline
Reviewed-by: robm
2026-01-30 05:17:51 +04:00
Ravi Reddy
a1d77270b4 8365058: Enhance CopyOnWriteArraySet
Reviewed-by: jlu
Backport-of: 5c7956fd9a56a00c8af2d3092ea5680843429b53
2026-01-30 05:17:51 +04:00
Alexey Ivanov
7b486e585a 8365280: Enhance JOptionPane
Backport-of: 8d9541f8c907d10159d524fc00fce85a2d99e51d
2026-01-30 05:17:50 +04:00
nibjen
64fd28006a 8367133: DTLS: fragmentation of Finished message results in handshake failure
Backport-of: 80cb0ead50
2026-01-30 05:17:50 +04:00
Sergey Bylokhov
22334869b7 8367384: The ICC_Profile class may throw exceptions during serialization
Backport-of: 0e98ec3662
2026-01-30 05:17:50 +04:00
Thomas Fitzsimmons
5a7a4824b4 8361711: Add library name configurability to PKCS11Test.java
Backport-of: 1cb1267ce8
2026-01-30 05:17:49 +04:00
Alex Menkov
d3fede2b54 8304811: vmTestbase/vm/mlvm/indy/func/jvmti/stepBreakPopReturn/INDIFY_Test.java fails with JVMTI_ERROR_TYPE_MISMATCH
Backport-of: 854b384b12
2026-01-30 05:17:49 +04:00
Roman Marchenko
641b2ca788 8358751: C2: Recursive inlining check for compiled lambda forms is broken
Backport-of: 9cca4f7c76
2026-01-30 05:17:49 +04:00
Justin Lu
20cc191e4a 8369078: Fix faulty test conversion in IllegalCharsetName.java
Backport-of: 0f406c420e
2026-01-30 05:17:49 +04:00
Rui Li
89acfe5f73 8360411: [TEST] open/test/jdk/java/io/File/MaxPathLength.java Refactor extract method to encapsulate Windows specific test logic
8363720: Follow up to JDK-8360411 with post review comments

Reviewed-by: phh
Backport-of: 016694bf74
2026-01-30 05:17:48 +04:00
Aleksey Shipilev
80bc539570 8367948: JFR: MethodTrace threshold setting has no effect
Backport-of: 4bc86a26db
2026-01-30 05:17:48 +04:00
Aleksey Shipilev
5f302fa47a 8367953: JFR sampler threads does not appear in thread dump
Backport-of: 64c46d8efc
2026-01-30 05:17:48 +04:00
Joakim Nordström
c8b6f5e737 8364993: JFR: Disable jdk.ModuleExport in default.jfc
Backport-of: a382996bb4
2026-01-30 05:17:47 +04:00
Joakim Nordström
2ce6d1b10f 8364556: JFR: Disable SymbolTableStatistics and StringTableStatistics in default.jfc
Backport-of: 7698c373a6
2026-01-30 05:17:47 +04:00
Aleksey Shipilev
92a00c7161 8369226: GHA: Switch to MacOS 15
Backport-of: 1ea8cfa6dc
2026-01-30 05:17:47 +04:00
SendaoYan
85a8c54493 8365983: Tests should throw SkippedException when SCTP not supported
Backport-of: a029245a4e
2026-01-30 05:17:46 +04:00
Dingli Zhang
405d9bf3fe 8368893: RISC-V: crash after JDK-8352673 on fastdebug version
Backport-of: f49849a5ed
2026-01-30 05:17:46 +04:00
Justin King
2ea868167c 8369190: JavaFrameAnchor on AArch64 has unnecessary barriers and wrong store order in MacroAssembler
Backport-of: fd29677479
2026-01-30 05:17:46 +04:00
Johannes Bechberger
98a9b5b028 8359690: New test TestCPUTimeSampleThrottling still fails intermittently
Backport-of: 487cc3c5be
2026-01-30 05:17:46 +04:00
Arno Zeller
7aa681670e 8362581: Timeouts in java/nio/channels/SocketChannel/OpenLeak.java on UNIX
Backport-of: de59da27a6
2026-01-30 05:17:45 +04:00
Robbin Ehn
897257797e 8367692: RISC-V: Align post call nop
Reviewed-by: fyang
Backport-of: 07ecc93dbd
2026-01-30 05:17:45 +04:00
SendaoYan
624df2cbc8 8365834: Mark java/net/httpclient/ManyRequests.java as intermittent
Reviewed-by: jpai
Backport-of: 09aad0aea8
2026-01-30 05:17:44 +04:00
Yassine-O
82ef604109 8366844: Update and automate MouseDraggedOriginatedByScrollBarTest.java
Backport-of: f1ee1b4a3d
2026-01-30 05:17:44 +04:00
Alexey Semenyuk
015a810254 8358723: jpackage signing issues: the main launcher doesn't have entitlements
8334238: Enhance AddLShortcutTest jpackage test
8364984: Many jpackage tests are failing on Linux after JDK-8334238
8368890: open/test/jdk/tools/jpackage/macosx/NameWithSpaceTest.java fails randomly

Reviewed-by: aivanov
Backport-of: bdb7d25ac1
2026-01-30 05:17:44 +04:00
Srinivas Vamsi Parasa
b2d0dbc83c 8366365: [test] test/lib-test/jdk/test/whitebox/CPUInfoTest.java should be updated
Backport-of: 8520fd3f6a
2026-01-30 05:17:43 +04:00
Aleksey Shipilev
34aeacd74b 8361950: Update to use jtreg 8
Backport-of: 5db1dfe5c8
2026-01-30 05:17:43 +04:00
Hari Prasad Kummari
58f3c6cd4b 8361423: Add IPSupport::printPlatformSupport to java/net/NetworkInterface/IPv4Only.java
Backport-of: 2f1aed2a16
2026-01-30 05:17:42 +04:00
Anawesha Khuntia
27d64be387 8359477: com/sun/net/httpserver/Test12.java appears to have a temp file race
Backport-of: e1681c4828
2026-01-30 05:17:42 +04:00
Srinivas Vamsi Parasa
7f04038170 8367780: Enable UseAPX on Intel CPUs only when both APX_F and APX_NCI_NDD_NF cpuid features are present
Backport-of: 3d4e049194
2026-01-30 05:17:42 +04:00
Aleksey Shipilev
4c74718a5a 8367313: CTW: Execute in AWT headless mode
Backport-of: 7e738f0d90
2026-01-30 05:17:41 +04:00
Srinivas Vamsi Parasa
3f3d589d0a 8367694: Fix jtreg test failure when Intel APX is enabled for KNL platforms
Backport-of: e883dec6be
2026-01-30 05:17:40 +04:00
Yassine
6cf5dd0a35 8365425: [macos26] javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java fails on macOS 26
Backport-of: bdf9834b81
2026-01-30 05:17:40 +04:00
Nibedita Jena
c350a93050 8369487: Revert EA option for build promotion
Reviewed-by: coffeys
2026-01-30 05:17:39 +04:00
Trupti Patil
d790b11b71 8366750: Remove test 'java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java' from problemlist
Backport-of: b674a42553
2026-01-30 05:17:39 +04:00
Christoph Langer
04607d8c64 8364454: ProblemList runtime/cds/DeterministicDump.java on macos for JDK-8363986
Backport-of: ad0fd13f20
2026-01-30 05:17:39 +04:00
William Kemper
2d8093d97b 8368152: Shenandoah: Incorrect behavior at end of degenerated cycle
Reviewed-by: kdnilsen, phh
Backport-of: f36c33c86d
2026-01-30 05:17:38 +04:00
William Kemper
bc12ae254d 8365956: GenShen: Adaptive tenuring threshold algorithm may raise threshold prematurely
Reviewed-by: phh, kdnilsen
Backport-of: 7fcce27096
2026-01-30 05:17:38 +04:00
Dingli Zhang
6548a94119 8368732: RISC-V: Detect support for misaligned vector access via hwprobe
Reviewed-by: fyang
Backport-of: 538a722c2e
2026-01-30 05:17:38 +04:00
Igor Veresov
cae0639937 8368698: runtime/cds/appcds/aotCache/OldClassSupport.java assert(can_add()) failed: Cannot add TrainingData objects
Backport-of: 4df41d2a75
2026-01-30 05:17:37 +04:00
Sergey Bylokhov
eb39f11e23 8362204: test/jdk/sun/awt/font/TestDevTransform.java fails on Ubuntu 24.04
Backport-of: 89af6e13f2
2026-01-30 05:17:37 +04:00
Srinivas Vamsi Parasa
2e905e946c 8365265: x86 short forward jump exceeds 8-bit offset in methodHandles_x86.cpp when using Intel APX
Backport-of: 38a261415d
2026-01-30 05:17:36 +04:00
Aleksey Shipilev
56a04bf4bb 8345810: Custom launchers must be linked with pthread to avoid dynamic linker issues
Backport-of: 685da0323b
2026-01-30 05:17:36 +04:00
Aleksey Shipilev
1189a34e5c 8362282: runtime/logging/StressAsyncUL.java failed with exitValue = 134
Backport-of: c968a672c0
2026-01-30 05:17:36 +04:00
Aleksey Shipilev
bf66cdd89d 8357141: Update to use jtreg 7.5.2
Backport-of: fe3be498b8
2026-01-30 05:17:35 +04:00
Andreas Steiner
2632b7cd0c 8359104: gc/TestAlwaysPreTouchBehavior.java#<gcname> fails on Linux
Backport-of: 73df06c80c
2026-01-30 05:17:35 +04:00
Deepak Damodaran
97755b0b5f 8325766: Extend CertificateBuilder to create trust and end entity certificates programmatically
Reviewed-by: coffeys
2026-01-30 05:17:35 +04:00
SendaoYan
810a167ecf 8368367: Test jdk/jfr/event/gc/detailed/TestGCHeapMemoryUsageEvent.java fails jdk.GCHeapMemoryUsage "expected 0 > 0"
Backport-of: ed31023fc5
2026-01-30 05:17:34 +04:00
Coleen Phillimore
cfae44b0d2 8365823: Revert storing abstract and interface Klasses to non-class metaspace
Reviewed-by: shade
Backport-of: fa00b24954
2026-01-30 05:17:34 +04:00
Matthias Baesken
f7574d5ab7 8359423: Improve error message in case of missing jsa shared archive
Reviewed-by: clanger
Backport-of: ef291d2d5d
2026-01-30 05:17:34 +04:00
Matthias Baesken
3052ccbddd 8357691: File blocked.certs contains bad content when boot jdk 25 is used, sun/security/lib/CheckBlockedCerts.java failing
Backport-of: a80ba6260e
2026-01-30 05:17:33 +04:00
Aleksey Shipilev
70755c1758 8358340: Support CDS heap archive with Generational Shenandoah
Backport-of: 577ac0610a
2026-01-30 05:17:33 +04:00
Aleksey Shipilev
ccd676d3b6 8365165: Zap C-heap memory at delete/free
Backport-of: ca753ebad6
2026-01-30 05:17:32 +04:00
Severin Gehwolf
48c47a83cf 8365389: Remove static color fields from SwingUtilities3 and WindowsMenuItemUI
Backport-of: 3468c6e5ef
2026-01-30 05:17:32 +04:00
Aleksey Shipilev
fd7291ddeb 8364111: InstanceMirrorKlass iterators should handle CDS and hidden classes consistently
Backport-of: ebb7f5d39b
2026-01-30 05:17:32 +04:00
Aleksey Shipilev
c16b63da53 8333783: java/nio/channels/FileChannel/directio/DirectIOTest.java is unstable with AV software
Backport-of: 8c6d12250b
2026-01-30 05:17:31 +04:00
Aleksey Shipilev
73ca6fb2e7 8367333: C2: Vector math operation intrinsification failure
8367969: C2: compiler/vectorapi/TestVectorMathLib.java fails without UnlockDiagnosticVMOptions

Reviewed-by: eastigeevich, phh
Backport-of: aa36799acb
2026-01-30 05:17:31 +04:00
Aleksey Shipilev
81e893dac6 8362530: VM crash with -XX:+PrintTieredEvents when collecting AOT profiling
Backport-of: 26ccb3cef1
2026-01-30 05:17:31 +04:00
Sergey Bylokhov
d7e6471e53 8367017: Remove legacy checks from WrappedToolkitTest and convert from bash
Backport-of: e1071797a4
2026-01-30 05:17:30 +04:00
Man Cao
f87b4b039e 8368071: Compilation throughput regressed 2X-8X after JDK-8355003
Reviewed-by: shade
Backport-of: bdfe05b595
2026-01-30 05:17:30 +04:00
Aleksey Shipilev
0d0a5570ae 8365726: Test crashed with assert in C1 thread: Possible safepoint reached by thread that does not allow it
Backport-of: 452b052fe3
2026-01-30 05:17:30 +04:00
Jayashree S Kumar
95574775a7 8360178: TestArguments.atojulong gtest has incorrect format string
Backport-of: 878497fb85
2026-01-30 05:17:29 +04:00
Jayashree S Kumar
1589cd5c5b 8361314: Test serviceability/jvmti/VMEvent/MyPackage/VMEventRecursionTest.java FATAL ERROR in native method: Failed during the GetClassSignature call
Backport-of: 8c00c374ec
2026-01-30 05:17:29 +04:00
Jayashree S Kumar
60a0d6fa91 8361253: CommandLineOptionTest library should report observed values on failure
Backport-of: f153e415d7
2026-01-30 05:17:29 +04:00
Jayashree S Kumar
15902d647b 8361897: gc/z/TestUncommit.java fails with Uncommitted too slow
Backport-of: 3f21c8bd1f
2026-01-30 05:17:28 +04:00
Igor Veresov
0e47243065 8366948: AOT cache creation crashes when iterating training data
Backport-of: 2aafda1968
2026-01-30 05:17:28 +04:00
Sean Coffey
d587e632e4 8362632: Improve HttpServer Request handling
Backport-of: 566ceb1b00f3e7ac7b9189ec84653ccb1f701d25
2026-01-30 05:17:28 +04:00
Dmitry Markov
cca28e69ac 8359501: Enhance Handling of URIs
Backport-of: 79283a4b99d7bfff32674b4a29a75f706c9a9ba3
2026-01-30 05:17:27 +04:00
Matthias Baesken
f14e1ff84d 8362516: Support of GCC static analyzer (-fanalyzer)
Backport-of: ba90ccc6a8
2026-01-30 05:17:27 +04:00
Manukumar V S
8dbe5153ed 8346839: [TESTBUG] "java/awt/textfield/setechochartest4/setechochartest4.java" failed because the test frame disappears on clicking "Click Several Times" button
Backport-of: 58270b757c
2026-01-30 05:17:27 +04:00
Aleksey Shipilev
9bfaad73a1 8361520: Stabilize SystemGC benchmarks
Backport-of: a9bd1ad40c
2026-01-30 05:17:26 +04:00
SendaoYan
e2c04903a9 8366893: java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java timed out on macos-aarch64
Backport-of: 0dad3f1ae8
2026-01-30 05:17:25 +04:00
Fei Yang
6abf323fa3 8368366: RISC-V: AlignVector is mistakenly set to AvoidUnalignedAccesses
Backport-of: 2313f8e4eb
2026-01-30 05:17:25 +04:00
Ramesh Bhagavatam Gangadhar
26f7077a1b 8368192: Test java/lang/ProcessBuilder/Basic.java#id0 fails with Exception: Stack trace
Reviewed-by: coffeys
Backport-of: 218e82c875
2026-01-30 05:17:25 +04:00
Fei Yang
11222fd787 8362972: C2 fails with unexpected node in SuperWord truncation: IsFiniteF, IsFiniteD
Backport-of: 9f796da377
2026-01-30 05:17:24 +04:00
Sergey Bylokhov
463f5d609c 8367131: Test com/sun/jdi/ThreadMemoryLeakTest.java fails on 32 bits
Backport-of: fdc11a1569
2026-01-30 05:17:24 +04:00
Francisco Ferrari Bihurriet
aa31216d20 8367782: VerifyJarEntryName.java: Fix modifyJarEntryName to operate on bytes and re-introduce verifySignatureEntryName
Backport-of: 1b9a11682d
2026-01-30 05:17:24 +04:00
Tejal Wakchaure
86010cca73 8365919: Replace currentTimeMillis with nanoTime in Stresser.java
Backport-of: 0ca38bdc4d
2026-01-30 05:17:23 +04:00
Calvin Cheung
3da1b7eec8 8357064: cds/appcds/ArchiveRelocationTest.java failed with missing expected output
Backport-of: 534d2b33dc
2026-01-30 05:17:23 +04:00
Erik Gahlin
c6c56bc5f5 8362836: JFR: Broken pipe in jdk/jfr/event/io/TestIOTopFrame.java
Backport-of: 1b94a3466e
2026-01-30 05:17:23 +04:00
Chad Rakoczy
83ed2a919c 8277444: Data race between JvmtiClassFileReconstituter::copy_bytecodes and class linking
Backport-of: 46ae1ee871
2026-01-30 05:17:22 +04:00
Manukumar V S
49f16101c9 8023263: [TESTBUG] Test closed/java/awt/Focus/InactiveWindowTest/InactiveFocusRace fails due to not enough time to initialize graphic components
Backport-of: 5271448b3a
2026-01-30 05:17:22 +04:00
Fei Gao
da9779c58b 8364184: [REDO] AArch64: [VectorAPI] sve vector math operations are not supported after JDK-8353217
Backport-of: 51d710e3cc
2026-01-30 05:17:22 +04:00
Manukumar V S
e05391200f 8162380: [TEST_BUG] MouseEvent/.../AltGraphModifierTest.java has only "Fail" button
Backport-of: 34c3ac0316
2026-01-30 05:17:21 +04:00
Alexey Semenyuk
a0e9c79747 8365790: Shutdown hook for application image does not work on Windows
Reviewed-by: almatvee, aivanov
Backport-of: f7ce3a1b5f
2026-01-30 05:17:21 +04:00
Alexey Ivanov
43d9ce5f08 8358532: JFileChooser in GTK L&F still displays HTML filename
Backport-of: 6fe9143bbb
2026-01-30 05:17:21 +04:00
Francesco Andreuzzi
5062dfe21e 8367689: Revert removal of several compilation-related vmStructs fields
Reviewed-by: aturbanov, shade
Backport-of: 4c5e901c96
2026-01-30 05:17:20 +04:00
William Kemper
04294c19d9 8367378: GenShen: Missing timing stats when old mark buffers are flushed during final update refs
Backport-of: 11df28916a
2026-01-30 05:17:20 +04:00
Alexey Ivanov
43a2a0e4f5 8367348: Enhance PassFailJFrame to support links in HTML
Backport-of: 7a3025e3d7
2026-01-30 05:17:20 +04:00
Stefan Johansson
3cba7bcf3f 8366980: TestTransparentHugePagesHeap.java fails when run with -UseCompressedOops
Backport-of: 703d930e4d
2026-01-30 05:17:19 +04:00
Stefan Johansson
4a3b5b5ee1 8366434: THP not working properly with G1 after JDK-8345655
Backport-of: a03302d41b
2026-01-30 05:17:19 +04:00
Richard Reingruber
77596c3ebf 8360219: [AIX] assert(locals_base >= l2) failed: bad placement
Backport-of: bea2b029a7
2026-01-30 05:17:19 +04:00
Aleksey Shipilev
01fdc6ebbb 8364212: Shenandoah: Rework archived objects loading
Backport-of: 68a35511eb
2026-01-30 05:17:18 +04:00
Matthias Baesken
864f6ff97b 8364352: Some tests fail when using a limited number of pregenerated .jsa CDS archives
Backport-of: 3ca44c8dea
2026-01-30 05:17:18 +04:00
Fei Yang
088bb7fce4 8365926: RISC-V: Performance regression in renaissance (chi-square)
Reviewed-by: rehn
Backport-of: 5c1865a4fc
2026-01-30 05:17:17 +04:00
Fei Gao
12b8fb0900 8365312: GCC 12 cannot compile SVE on aarch64 with auto-var-init pattern
Backport-of: 999761d0f6
2026-01-30 05:17:17 +04:00
Dingli Zhang
ca855d5e63 8367616: RISC-V: Auto-enable Zicboz extension for debug builds
Backport-of: 90e81c2bee
2026-01-30 05:17:17 +04:00
Axel Boldt-Christmas
3a2e400923 8366147: ZGC: ZPageAllocator::cleanup_failed_commit_single_partition may leak memory
Backport-of: 86d6a2e05e
2026-01-30 05:17:16 +04:00
Aleksey Shipilev
56bf0e115b 8363966: GHA: Switch cross-compiling sysroots to Debian trixie
Backport-of: 2a5f149bb8
2026-01-30 05:17:16 +04:00
Anass Baya
cb5df22159 8346952: GetGraphicsStressTest.java fails: Native resources unavailable 8361839: Problemlist BogusFocusableWindowState due to failures in the CI pipeline
Reviewed-by: aivanov
Backport-of: 44cff9d6ab
2026-01-30 05:17:16 +04:00
Disha
60013f13de 8366764: Deproblemlist java/awt/ScrollPane/ScrollPositionTest.java
Backport-of: 9f697c8b1ced41c256bd33f52bdcb2cede2adbf9
2026-01-30 05:17:15 +04:00
Tejal Wakchaure
5377bf7b7e 8366029: Do not add -XX:VerifyArchivedFields by default to CDS tests
Backport-of: 15601b4718
2026-01-30 05:17:15 +04:00
Matthias Baesken
a7c40d1bb8 8365442: [asan] runtime/ErrorHandling/CreateCoredumpOnCrash.java fails
Backport-of: e5ec464120
2026-01-30 05:17:15 +04:00
Matthias Baesken
dc9524f67e 8366092: [GCC static analyzer] UnixOperatingSystem.c warning: use of uninitialized value 'systemTicks'
Backport-of: a6e2a329a0
2026-01-30 05:17:14 +04:00
Matthias Baesken
c352cdf0eb 8365700: Jar --validate without any --file option leaves around a temporary file /tmp/tmpJar<number>.jar
Backport-of: 320235ccb8
2026-01-30 05:17:14 +04:00
Dingli Zhang
4fb763f278 8367098: RISC-V: sync CPU features with related JVM flags for dependant ones
Backport-of: f51e442b0e
2026-01-30 05:17:13 +04:00
Rui Li
10c5585183 8364296: Set IntelJccErratumMitigation flag ergonomically
Backport-of: 6c5804722b
2026-01-30 05:17:13 +04:00
Hamlin Li
ac27e8a8e5 8360090: [TEST] RISC-V: disable some cds tests on qemu
Backport-of: c50370599e
2026-01-30 05:17:13 +04:00
skishor
d0397590ab 8361367: AOT ExcludedClasses.java test failed with missing constant pool logs
Backport-of: 92712ef45d
2026-01-30 05:17:12 +04:00
Hari Prasad Kummari
162dab8f17 8364263: HttpClient: Improve encapsulation of ProxyServer
Backport-of: 190e113031
2026-01-30 05:17:12 +04:00
Dingli Zhang
1dfa6ecd61 8367137: RISC-V: Detect Zicboz block size via hwprobe
Backport-of: 5abd18426d
2026-01-30 05:17:12 +04:00
Dingli Zhang
c4f0168cf1 8367066: RISC-V: refine register selection in MacroAssembler:: decode_klass_not_null
Backport-of: 0b3a303053
2026-01-30 05:17:11 +04:00
Lei Zhu
12acfeadcb 8362533: Tests sun/management/jmxremote/bootstrap/* duplicate VM flags
Backport-of: 458f033d4d
2026-01-30 05:17:10 +04:00
Sarvesh Kumar Jain
646ae0e7da 8346753: Test javax/swing/JMenuItem/RightLeftOrientation/RightLeftOrientation.java fails on Windows Server 2025 x64 because the icons of RBMenuItem and CBMenuItem are not visible in Nimbus LookAndFeel
Backport-of: 5205eae6ff
2026-01-30 05:17:10 +04:00
SendaoYan
bf6d863e7e 8366359: Test should throw SkippedException when there is no lpstat
Backport-of: f23c150709
2026-01-30 05:17:09 +04:00
Rui Li
9386c1986a 8320836: jtreg gtest runs should limit heap size
Backport-of: ac9e51023f
2026-01-30 05:17:09 +04:00
Rui Li
87b297a01c 8364198: NMT should have a better corruption message
Backport-of: 2202156acc
2026-01-30 05:17:09 +04:00
Dingli Zhang
7efa4a27eb 8367048: RISC-V: Correct pipeline descriptions of the architecture
Backport-of: 0aee7bf24d
2026-01-30 05:17:08 +04:00
Sean Coffey
1fc59ee493 8341496: Improve JMX connections
8367277: Fix copyright header in JMXInterfaceBindingTest.java

Reviewed-by: dfuchs
Backport-of: 76c1173ff5780b18cdb9ba3a519ee83abf651a3a
2026-01-30 05:17:08 +04:00
Renjith Kannath Pariyangad
c968a428d2 8366446: Test java/awt/geom/ConcurrentDrawPolygonTest.java fails intermittently
Backport-of: 92c451f3b3273babc630a2f0371a0cbb4366c387
2026-01-30 05:17:08 +04:00
SendaoYan
1b845c4470 8364786: Test java/net/vthread/HttpALot.java intermittently fails - 24999 handled, expected 25000
Backport-of: f83454cd61
2026-01-30 05:17:07 +04:00
SendaoYan
5d40abfa81 8366031: Mark com/sun/nio/sctp/SctpChannel/CloseDescriptors.java as intermittent
Backport-of: efb81dafaf
2026-01-30 05:17:07 +04:00
SendaoYan
3a60f5fcda 8366558: Gtests leave /tmp/cgroups-test* files
Backport-of: 49fd6a0cb4
2026-01-30 05:17:07 +04:00
skishor
fe961b1a90 8357816: Add test from JDK-8350576
Backport-of: d8c3533a91
2026-01-30 05:17:07 +04:00
Trupti Patil
467459c562 8361298: SwingUtilities/bug4967768.java fails where character P is not underline
Backport-of: 57553ca1db
2026-01-30 05:17:06 +04:00
Manukumar V S
d6a8b8b8b4 8347277: java/awt/Focus/ComponentLostFocusTest.java fails intermittently
Backport-of: e2a503e26e
2026-01-30 05:17:06 +04:00
Tejal Wakchaure
5e0e381b1d 8365638: JFR: Add --exact for debugging out-of-order events
Backport-of: a42ba1ff1a
2026-01-30 05:17:06 +04:00
Matthias Baesken
eb3b30eae7 8365487: [asan] some oops (mode) related tests fail
Backport-of: 98f54d90ea
2026-01-30 05:17:05 +04:00
Matthias Baesken
98a4962a6a 8364514: [asan] runtime/jni/checked/TestCharArrayReleasing.java heap-buffer-overflow
Backport-of: 67ba8b45dd
2026-01-30 05:17:05 +04:00
SendaoYan
0e6ae6d5f6 8365863: /test/jdk/sun/security/pkcs11/Cipher tests skip without SkippedException
Backport-of: 993babb326
2026-01-30 05:17:05 +04:00
skishor
ae7b9224a8 8361215: Add AOT test case: verification constraint classes are excluded
Backport-of: 055d2ffa69
2026-01-30 05:17:04 +04:00
skishor
00e21e4fad 8358685: [TEST] AOTLoggingTag.java failed with missing log message
Backport-of: 9658cecde3
2026-01-30 05:17:04 +04:00
Rui Li
cbaefac99d 8364257: JFR: User-defined events and settings with a one-letter name cannot be configured
Backport-of: ea7e943874
2026-01-30 05:17:04 +04:00
Matthias Baesken
1d9115a49d 8362889: [GCC static analyzer] leak in libstringPlatformChars.c
Reviewed-by: rriggs
Backport-of: 5160cfb496
2026-01-30 05:17:03 +04:00
Sergey Bylokhov
47534b7782 8366208: Unexpected exception in sun.java2d.cmm.lcms.LCMSImageLayout
Backport-of: 12e6a0b6d0
2026-01-30 05:17:03 +04:00
Vanitha B P
d2dd010fec 8366537: Test "java/util/TimeZone/DefaultTimeZoneTest.java" is not updating the zone ID as expected
Reviewed-by: naoto
Backport-of: a40afdd08f
2026-01-30 05:17:02 +04:00
Matthias Baesken
63c33d115e 8365240: [asan] exclude some tests when using asan enabled binaries
Backport-of: d78fa5a9f6
2026-01-30 05:17:02 +04:00
Shyam Kishor
bb23245ab2 8361494: [IR Framework] Escape too much in replacement of placeholder
Backport-of: 76442f39b9
2026-01-30 05:17:01 +04:00
Lei Zhu
d16e066a1d 8362532: Test gc/g1/plab/* duplicate command-line options
Backport-of: 13bab09bff
2026-01-30 05:17:01 +04:00
Kevin Walls
13aaf6fcf1 8305567: serviceability/tmtools/jstat/GcTest01.java failed utils.JstatGcResults.assertConsistency
Backport-of: 310ef85667
2026-01-30 05:17:01 +04:00
John Jiang
41f3f7997c 8364597: Replace THL A29 Limited with Tencent
Backport-of: 4c9eaddaef
2026-01-30 05:17:00 +04:00
Sean Coffey
18d18c3e93 8365168: Use 64-bit aligned addresses for CK_ULONG access in PKCS11 native key code
Backport-of: 640b71da48
2026-01-30 05:17:00 +04:00
Rui Li
ff21db7b43 8361497: Scoped Values: orElse and orElseThrow do not access the cache
Backport-of: 9dd93c6a2c
2026-01-30 05:16:59 +04:00
Alexey Ivanov
e3933114c2 8359061: Update and ProblemList manual test java/awt/Cursor/CursorDragTest/ListDragCursor.java
Reviewed-by: dmarkov
Backport-of: 7576064a10
2026-01-30 05:16:59 +04:00
Zhaokun Xie
2072cf5d23 8361892: AArch64: Incorrect matching rule leading to improper oop instruction encoding
Backport-of: dccb1782ec
2026-01-30 05:16:58 +04:00
Prajwal Kumaraswamy
0f50f0a825 8265429: Improve GCM encryption
Backport-of: 1315d641edc5fd7619fed0998cb130cfc8162804
2026-01-30 05:16:58 +04:00
Alexey Ivanov
78f56e11d2 8366800: Problemlist 1 test due to failures in the CI pipeline
Reviewed-by: dmarkov
2026-01-30 05:16:57 +04:00
Alexey Ivanov
a2176cda2a 8365615: Improve JMenuBar/RightLeftOrientation.java
Backport-of: afa8e79ba1
2026-01-30 05:16:57 +04:00
Matthias Baesken
dbfd4cb223 8363676: [GCC static analyzer] missing return value check of malloc in OGLContext_SetTransform
Backport-of: d25ad881eb
2026-01-30 05:16:57 +04:00
Chen Liang
a7763d752a 8366028: MethodType::fromMethodDescriptorString should not throw UnsupportedOperationException for invalid descriptors
Backport-of: 1d53ac30f1
2026-01-30 05:16:56 +04:00
Hamlin Li
f5a772cbe5 8365772: RISC-V: correctly prereserve NaN payload when converting from float to float16 in vector way
Backport-of: 32df2d17f3
2026-01-30 05:16:56 +04:00
Hamlin Li
7df4fe508e 8365206: RISC-V: compiler/c2/irTests/TestFloat16ScalarOperations.java is failing on riscv64
Backport-of: 28602f3d3e
2026-01-30 05:16:56 +04:00
abhishek.n
7b7d8ab2c5 8361112: Use exact float -> Float16 conversion method in Float16 tests
Backport-of: 549b875866
2026-01-30 05:16:55 +04:00
Matthias Baesken
089609db6c 8361871: [GCC static analyzer] complains about use of uninitialized value ckpObject in p11_util.c
Backport-of: 518d5f4bbb
2026-01-30 05:16:55 +04:00
Matthias Baesken
b9639251fd 8361868: [GCC static analyzer] complains about missing calloc - NULL checks in p11_util.c
Backport-of: 1cde536b98
2026-01-30 05:16:55 +04:00
Matthias Baesken
9c7d58cfa4 8365543: UnixNativeDispatcher.init should lookup open64at and stat64at on AIX
Backport-of: 166ea12d73
2026-01-30 05:16:54 +04:00
Aleksey Shipilev
b3d0b2e798 8361211: C2: Final graph reshaping generates unencodeable klass constants
Backport-of: e304d37996
2026-01-30 05:16:54 +04:00
Aleksey Shipilev
714dd7e73d 8356324: JVM crash (SIGSEGV at ClassListParser::resolve_indy_impl) during -Xshare:dump starting from 21.0.5
Backport-of: 506625b768
2026-01-30 05:16:53 +04:00
Oli Gillespie
8608882e0b 8357959: (bf) ByteBuffer.allocateDirect initialization can result in large TTSP spikes
Backport-of: e5ce5c57c8
2026-01-30 05:16:52 +04:00
Alexey Ivanov
490cf2a6ff 8349188: LineBorder does not scale correctly
Backport-of: 24117c6e9a
2026-01-30 05:16:52 +04:00
Alexey Ivanov
8c29fcd4c5 8358813: JPasswordField identifies spaces in password via delete shortcuts
Backport-of: 8d73fe91bc
2026-01-30 05:16:51 +04:00
Alexey Ivanov
65bddecd80 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text
Backport-of: 8d33ea7395
2026-01-30 05:16:51 +04:00
abhishek.n
8056da45c4 8352016: Improve java/lang/RuntimeTests/RuntimeExitLogTest.java
Backport-of: 1926aeb1a3
2026-01-30 05:16:51 +04:00
William Kemper
83347b9bfd 8365571: GenShen: PLAB promotions may remain disabled for evacuation threads
Backport-of: 08db4b9962
2026-01-30 05:16:50 +04:00
abhishek.n
bf075b71f0 8362207: Add more test cases for possible double-rounding in fma
Backport-of: 6e368e0c69
2026-01-30 05:16:50 +04:00
Doug Simon
b47d25dea6 8365468: EagerJVMCI should only apply to the CompilerBroker JVMCI runtime
Backport-of: e3aeebec17
2026-01-30 05:16:49 +04:00
Thomas Schatzl
c3f246c4ef 8364503: gc/g1/TestCodeCacheUnloadDuringConcCycle.java fails because of race printing to stdout
Reviewed-by: shade
Backport-of: c56fb0b6ef
2026-01-30 05:16:48 +04:00
Alexey Ivanov
5a343a13a5 8365271: Improve Swing supports
Backport-of: 3a925dcd8a7628ea9ad9092a9019198fa7a6f00d
2026-01-30 05:16:48 +04:00
Alexey Ivanov
d9fd896973 8366340: Problemlist 1 test due to failures in the CI pipeline
Reviewed-by: robm
2026-01-30 05:16:48 +04:00
Alexey Ivanov
4cc3992f89 8366250: Problemlist 3 tests due to failures in the CI pipeline
Reviewed-by: robm
2026-01-30 05:16:47 +04:00
Dingli Zhang
256e0ed085 8365844: RISC-V: TestBadFormat.java fails when running without RVV
Backport-of: 584137cf96
2026-01-30 05:16:47 +04:00
Dingli Zhang
eb9cdd0735 8365841: RISC-V: Several IR verification tests fail after JDK-8350960 without Zvfh
Backport-of: 2e06a91765
2026-01-30 05:16:47 +04:00
Paul Hohensee
a5e8b4583f 8279005: sun/tools/jstat tests do not check for test case exit codes after JDK-8245129
Backport-of: c90c31b07e
2026-01-30 05:16:46 +04:00
Jorn Vernee
a0268397e3 8362169: Pointer passed to upcall may get wrong scope
Backport-of: 9dc62825b5
2026-01-30 05:16:46 +04:00
Matthias Baesken
c1371f36d8 8364996: java/awt/font/FontNames/LocaleFamilyNames.java times out on Windows
Backport-of: 15e8609a2c
2026-01-30 05:16:45 +04:00
Matthias Baesken
3a3f17b766 8364199: Enhance list of environment variables printed in hserr/hsinfo file
Backport-of: 812bd8e94d
2026-01-30 05:16:45 +04:00
Matthias Baesken
4e6528ad68 8363910: Avoid tuning for Power10 CPUs on Linux ppc64le when gcc < 10 is used
Backport-of: 41c94eed37
2026-01-30 05:16:45 +04:00
Shyam Kishor
5ac9d09b08 8362602: Add test.timeout.factor to CompileFactory to avoid test timeouts
Backport-of: f8c8bcf4fd
2026-01-30 05:16:44 +04:00
Thomas Schatzl
5dbcc3b386 8350621: Code cache stops scheduling GC
Reviewed-by: shade
Backport-of: 2292246f8c
2026-01-30 05:16:44 +04:00
Thomas Stuefe
0b21225ae3 8365307: AIX make fails after JDK-8364611
Backport-of: 391ea15118
2026-01-30 05:16:44 +04:00
Boris Ulasevich
ffca1c86b2 8365071: ARM32: JFR intrinsic jvm_commit triggers C2 regalloc assert
Backport-of: f2f7a490c0
2026-01-30 05:16:43 +04:00
Boris Ulasevich
2f5839bf8d 8365166: ARM32: missing os::fetch_bcp_from_context implementation
Reviewed-by: shade
Backport-of: 001aaa1e49
2026-01-30 05:16:43 +04:00
Francesco Andreuzzi
5e8befaa6d 8357822: C2: Multiple string optimization tests are no longer testing string concatenation optimizations
Backport-of: 6c616c71ec
2026-01-30 05:16:42 +04:00
Trupti Patil
6ae876e530 8335986: Test javax/swing/JCheckBox/4449413/bug4449413.java fails on Windows 11 x64 because RBMenuItem's and CBMenuItem's checkmark on the left side are not visible
Backport-of: c51bed739d
2026-01-30 05:16:42 +04:00
Hari Prasad Kummari
fbd9ec1fd9 8358048: java/net/httpclient/HttpsTunnelAuthTest.java incorrectly calls Thread::stop
Backport-of: d288ca28be
2026-01-30 05:16:41 +04:00
Hari Prasad Kummari
9125902914 8360408: [TEST] Use @requires tag instead of exiting based on "os.name" property value for sun/net/www/protocol/file/FileURLTest.java
Backport-of: d4705947d8
2026-01-30 05:16:41 +04:00
Hari Prasad Kummari
f55b4c20c4 8360981: Remove use of Thread.stop in test/jdk/java/net/Socket/DeadlockTest.java
Backport-of: 3263361a28
2026-01-30 05:16:41 +04:00
Coleen Phillimore
dfa8e909fa 8343218: Add option to disable allocating interface and abstract classes in non-class metaspace
Backport-of: da3a5da81b
2026-01-30 05:16:40 +04:00
Martin Doerr
a26d949ebe 8361599: [PPC64] enable missing tests via jtreg requires
Backport-of: 83feb7a238
2026-01-30 05:16:40 +04:00
SendaoYan
5d728a613c 8365811: test/jdk/java/net/CookieHandler/B6644726.java failure - "Should have 5 cookies. Got only 4, expires probably didn't parse correctly"
Backport-of: b453eb63c6
2026-01-30 05:16:39 +04:00
Ramesh Bhagavatam Gangadhar
c8c020cfbe 8356897: Update NSS library to 3.111
Reviewed-by: rhalade
Backport-of: cabd7c1f7a
2026-01-30 05:16:39 +04:00
Aleksey Shipilev
90e55b8948 8357382: runtime/cds/appcds/aotClassLinking/BulkLoaderTest.java#aot fails with Xcomp and C1
Backport-of: 429158218b
2026-01-30 05:16:39 +04:00
Alexey Ivanov
15179063c5 8366075: Problemlist 2 tests due to failures in the CI pipeline
Reviewed-by: robm
2026-01-30 05:16:38 +04:00
Renjith Kannath Pariyangad
25ae692796 8364214: Enhance polygon data support
Backport-of: bc74f4a552f4bec37ee3cd870bacef4a0b186c53
2026-01-30 05:16:38 +04:00
Renjith Kannath Pariyangad
ab59a8099a 8362308: Enhance Bitmap operations
Backport-of: d8ea3bcf8597c7277d6b4bbe23afd33cc41d48fa
2026-01-30 05:16:37 +04:00
Thomas Stuefe
8d63a1e21f 8364611: (process) Child process SIGPIPE signal disposition should be default
Reviewed-by: adinn
Backport-of: bdb1646a1e
2026-01-30 05:16:37 +04:00
abhishek.n
6902cba835 8359449: [TEST] open/test/jdk/java/io/File/SymLinks.java Refactor extract method for Windows specific test
Backport-of: 49a82d8806
2026-01-30 05:16:37 +04:00
Aleksey Shipilev
6c6eb0bf03 8363928: Specifying AOTCacheOutput with a blank path causes the JVM to crash
Backport-of: ea754316fd
2026-01-30 05:16:36 +04:00
Aleksey Shipilev
20618e5b9b 8360783: CTW: Skip deoptimization between tiers
Backport-of: cd6caedd0a
2026-01-30 05:16:36 +04:00
David Holmes
ad7e6864a1 8364235: Fix for JDK-8361447 breaks the alignment requirements for GuardedMemory
Backport-of: 078d0d4968
2026-01-30 05:16:36 +04:00
Dingli Zhang
852b59630c 8365302: RISC-V: compiler/loopopts/superword/TestAlignVector.java fails when vlen=128
Backport-of: 636c61a386
2026-01-30 05:16:35 +04:00
Xiaolong Peng
bcb661fa9e 8361948: Shenandoah: region free capacity unit mismatch
Backport-of: 46988e1073
2026-01-30 05:16:35 +04:00
Dingli Zhang
33ba9f2b4e 8364120: RISC-V: unify the usage of MacroAssembler::instruction_size
Backport-of: 7bf4c608e7
2026-01-30 05:16:33 +04:00
Dingli Zhang
8e227418b7 8364150: RISC-V: Leftover for JDK-8343430 removing old trampoline call
Backport-of: 3488f53d2c
2026-01-30 05:16:33 +04:00
Dingli Zhang
2a7dde1c86 8365200: RISC-V: compiler/loopopts/superword/TestGeneralizedReductions.java fails with Zvbb and vlen=128
Backport-of: 6927fc3904
2026-01-30 05:16:32 +04:00
skishor
b59463ed08 8359207: Remove runtime/signal/TestSigusr2.java since it is always skipped
Reviewed-by: syan
Backport-of: 51877f568b
2026-01-30 05:16:32 +04:00
Chen Liang
598af2f3f6 8358535: Changes in ClassValue (JDK-8351996) caused a 1-9% regression in Renaissance-PageRank
Reviewed-by: shade
Backport-of: e13b4c8de9
2026-01-30 05:16:31 +04:00
Alexander Zvegintsev
fa047c1df5 8362390: AIX make fails in awt_GraphicsEnv.c
Backport-of: 18190519e7
2026-01-30 05:16:31 +04:00
Alexander Zvegintsev
c71ed6754c 8354415: [Ubuntu25.04] api/java_awt/GraphicsDevice/indexTGF.html#SetDisplayMode - setDisplayMode_REFRESH_RATE_UNKNOWN fails: Height is different on vnc
Backport-of: 18c2e40de7
2026-01-30 05:16:31 +04:00
Ao Qi
abc49874d5 8364177: JDK fails to build due to undefined symbol in libpng on LoongArch64
Backport-of: a9f3d3a290
2026-01-30 05:16:31 +04:00
Matthias Baesken
d3c0fca7e2 8360518: Docker tests do not work when asan is configured
Backport-of: 01b15bc1f9
2026-01-30 05:16:30 +04:00
Aleksey Shipilev
5ee10c7b5e 8360255: runtime/jni/checked/TestLargeUTF8Length.java fails with -XX:-CompactStrings
Backport-of: 1ca008fd02
2026-01-30 05:16:30 +04:00
Aleksey Shipilev
7219483217 8361180: Disable CompiledDirectCall verification with -VerifyInlineCaches
Backport-of: 1ac7489874
2026-01-30 05:16:30 +04:00
Aleksey Shipilev
dde2574c26 8343546: GHA: Cache required dependencies in master-branch workflow
Backport-of: 1fa772e814
2026-01-30 05:16:29 +04:00
SendaoYan
46aa5e4547 8362834: Several runtime/Thread tests should mark as /native
Backport-of: 699b8112f8
2026-01-30 05:16:29 +04:00
Dingli Zhang
f0ccd4b67c 8362515: RISC-V: cleanup NativeFarCall
Backport-of: 3e2d12d85a
2026-01-30 05:16:29 +04:00
SendaoYan
77f95a523c 8362482: [TESTBUG] serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java: System.gc() does not provide full GC
Reviewed-by: rrich
Backport-of: b4028c91d5
2026-01-30 05:16:28 +04:00
SendaoYan
0f619d8d87 8362379: Test serviceability/HeapDump/UnmountedVThreadNativeMethodAtTop.java should mark as /native
Backport-of: ee0bcc5526
2026-01-30 05:16:28 +04:00
Trupti Patil
e928b6d966 8355478: DoubleActionESC.java fails intermittently
Backport-of: d1052c70cb
2026-01-30 05:16:28 +04:00
Srinivas Mandalika
c20b2f2c7a 8359428: Test 'javax/swing/JTabbedPane/bug4499556.java' failed because after selecting one of L&F items, the test case automatically failed when clicking on L&F Menu button again
Backport-of: 2b94b70ef5
2026-01-30 05:16:27 +04:00
Aleksey Shipilev
36c573e053 8361478: GHA: Use MSYS2 from GHA runners
Backport-of: ed9066bdf4
2026-01-30 05:16:27 +04:00
Aleksey Shipilev
cf3b9fc954 8361255: CTW: Tolerate more NCDFE problems
Backport-of: a201be8555
2026-01-30 05:16:27 +04:00
Aleksey Shipilev
9103091dcd 8360867: CTW: Disable inline cache verification
Backport-of: aa1911191c
2026-01-30 05:16:26 +04:00
Ludvig Janiuk
be75986980 8365260: Problemlist 1 test due to failures in the CI pipeline
Reviewed-by: aivanov
2026-01-30 05:16:26 +04:00
Yasumasa Suenaga
26e1e27631 8364090: Dump JFR recording on CrashOnOutOfMemoryError
Backport-of: 8ed214f3b1
2026-01-30 05:16:26 +04:00
Dingli Zhang
3f87607443 8361449: RISC-V: Code cleanup for native call
Backport-of: 5edd546585
2026-01-30 05:16:25 +04:00
Shruthi Acharya
9a16d275a3 8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)
Backport-of: 8f121a173c
2026-01-30 05:16:25 +04:00
SendaoYan
bcd7d72131 8362855: Test java/net/ipv6tests/TcpTest.java should report SkippedException when there no ia4addr or ia6addr
Backport-of: 8fcbb110e9
2026-01-30 05:16:24 +04:00
SendaoYan
34ec576d71 8364114: Test TestHugePageDecisionsAtVMStartup.java#LP_enabled fails when no free hugepage
Backport-of: 3b0da29879
2026-01-30 05:16:24 +04:00
Maheshkumar Bollapragada
b182c7e5ba 8359687: Use PassFailJFrame for java/awt/print/Dialog/DialogType.java
Backport-of: de34bb8e66
2026-01-30 05:16:24 +04:00
SendaoYan
2ea239d7d0 8362501: Update test/hotspot/jtreg/applications/jcstress/README
Backport-of: 559795b0eb
2026-01-30 05:16:23 +04:00
Dingli Zhang
88406911c3 8359105: RISC-V: No need for acquire fence in safepoint poll during JNI calls
Backport-of: 1a01839f8c
2026-01-30 05:16:23 +04:00
Dingli Zhang
4af9871759 8362596: RISC-V: Improve _vectorizedHashCode intrinsic
Backport-of: 4189fcbac4
2026-01-30 05:16:23 +04:00
Ao Qi
e6d3da71e0 8363895: Minimal build fails with slowdebug builds after JDK-8354887
Reviewed-by: kvn
Backport-of: 2da0cdadb8
2026-01-30 05:16:23 +04:00
Fei Yang
704361ab8c 8360520: RISC-V: C1: Fix primitive array clone intrinsic regression after JDK-8333154
Backport-of: e6ac956a7a
2026-01-30 05:16:22 +04:00
Sarvesh KumarJain
4da38f76f4 8357799: Improve instructions for JFileChooser/HTMLFileName.java
Backport-of: 53a83d15a1
2026-01-30 05:16:22 +04:00
Aleksey Shipilev
b47b9d2838 8363965: GHA: Switch cross-compiling sysroots to Debian bookworm
Backport-of: 3fe0d29ec3
2026-01-30 05:16:22 +04:00
Matthias Baesken
921854a72c 8351487: [ubsan] jvmti.h runtime error: load of value which is not a valid value
Backport-of: bf3cfbeff4
2026-01-30 05:16:21 +04:00
Matthias Baesken
9dadec6d1a 8360791: [ubsan] Adjust signal handling
Backport-of: aeca49e43f
2026-01-30 05:16:21 +04:00
Matthias Baesken
2a9cf17245 8361959: [GCC static analyzer] java_props_md.c leak of 'temp' variable is reported
Backport-of: bf225c201f
2026-01-30 05:16:21 +04:00
Matthias Baesken
3272f2f7c4 8361888: [GCC static analyzer] ProcessImpl_md.c Java_java_lang_ProcessImpl_forkAndExec error: use of uninitialized value '*(ChildStuff *)p.mode
Backport-of: b85440d085
2026-01-30 05:16:20 +04:00
Hari Prasad Kummari
f5dd1f773b 8354447: Missing test for retroactive @SuppressWarnings("dangling-doc-comments") behavior
Backport-of: 0e725c6fb1
2026-01-30 05:16:20 +04:00
Hari Prasad Kummari
f880f1eab2 8360022: ClassRefDupInConstantPoolTest.java fails when running in repeat
Backport-of: 566279af49
2026-01-30 05:16:20 +04:00
Matthias Baesken
6f3ba3716b 8361198: [AIX] fix misleading error output in thread_cpu_time_unchecked
Backport-of: 2528c620a6
2026-01-30 05:16:19 +04:00
Dingli Zhang
98b25a39bb 8363898: RISC-V: TestRangeCheckHoistingScaledIV.java fails after JDK-8355293 when running without RVV
Backport-of: b746701e57
2026-01-30 05:16:19 +04:00
SendaoYan
0fe8ef08ff 8359827: Test runtime/Thread/ThreadCountLimit.java need loop increasing the limit
Backport-of: fc8038441d
2026-01-30 05:16:18 +04:00
Feilong Jiang
051a468007 8362838: RISC-V: Incorrect matching rule leading to improper oop instruction encoding
Backport-of: 0ba2942c6e
2026-01-30 05:16:18 +04:00
Fei Yang
3b119a1e0c 8361504: RISC-V: Make C1 clone intrinsic platform guard more specific
Backport-of: 54e37629f6
2026-01-30 05:16:17 +04:00
Manukumar V S
7c7127bf8c 8358697: TextLayout/MyanmarTextTest.java passes if no Myanmar font is found
Backport-of: bcad87eacb
2026-01-30 05:16:17 +04:00
Dingli Zhang
5515295b49 8357694: RISC-V: Several IR verification tests fail when vlen=128
Backport-of: 15b5b54ac7
2026-01-30 05:16:16 +04:00
Aleksey Shipilev
debacd66d2 8362582: GHA: Increase bundle retention time to deal with infra overload better
Backport-of: 1bd683b588
2026-01-30 05:16:16 +04:00
Hari Prasad Kummari
4288251be9 8359127: Amend java/nio/channels/DatagramChannel/PromiscuousIPv6.java to use @requires for OS platform selection
Backport-of: 78b1360e7d
2026-01-30 05:16:15 +04:00
Artem Semenov
9b5be66a0c 8360664: Null pointer dereference in src/hotspot/share/prims/jvmtiTagMap.cpp in IterateOverHeapObjectClosure::do_object()
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Artem Semenov <savoptik@altlinux.org>.

Backport-of: e9a434165a
2026-01-30 05:16:14 +04:00
Nibedita Jena
3c6f850c51 8362107: Update the Jan CPU26_01 release date in master branch after forking Oct CPU25_10
Reviewed-by: coffeys, rreddy
2026-01-30 05:16:14 +04:00
23 changed files with 321 additions and 1911 deletions

View File

@@ -295,7 +295,7 @@ define SetupJavaCompilationBody
ifeq ($$($1_PROCESS_JBR_API), true)
# Automatic path conversion doesn't work for two arguments, so call fixpath manually
$1_JBR_API_FLAGS := -Xplugin:"jbr-api $$(call FixPath, $$($1_BIN)/java.base/META-INF/jbrapi) $$(call FixPath, $(TOPDIR)/jb/jbr-api.version)"
$1_JBR_API_FLAGS := -Xplugin:"jbr-api $$(call FixPath, $$($1_BIN)/java.base/META-INF/jbrapi.registry) $$(call FixPath, $(TOPDIR)/jb/jbr-api.version)"
$1_EXTRA_DEPS := $$($1_EXTRA_DEPS) $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_JBR_API_PLUGIN_batch
endif

View File

@@ -198,35 +198,34 @@ public class JBRApiPlugin implements Plugin {
return unresolvedErrors;
}
void read(RandomAccessFile file, boolean internal) throws IOException {
void read(RandomAccessFile file) throws IOException {
String s;
while ((s = file.readLine()) != null) {
String[] tokens = s.split(" ");
switch (tokens[0]) {
case "VERSION" -> {}
case "TYPE" -> {
types.put(tokens[1], new Type(tokens[2], Binding.valueOf(tokens[3])));
if (tokens.length > 4 && tokens[4].equals("INTERNAL")) internal.add(tokens[1]);
}
case "STATIC" -> {
StaticDescriptor descriptor = new StaticDescriptor(new StaticMethod(
tokens[1], tokens[2]), tokens[3]);
methods.put(descriptor, new StaticMethod(tokens[4], tokens[5]));
if (internal) this.internal.add(descriptor);
}
default -> {
types.put(tokens[1], new Type(tokens[2], Binding.valueOf(tokens[0])));
if (internal) this.internal.add(tokens[1]);
if (tokens.length > 6 && tokens[6].equals("INTERNAL")) internal.add(descriptor);
}
}
}
}
void write(RandomAccessFile pub, RandomAccessFile priv) throws IOException {
void write(RandomAccessFile file) throws IOException {
for (var t : types.entrySet()) {
(internal.contains(t.getKey()) ? priv : pub).writeBytes(
t.getValue().binding + " " + t.getKey() + " " + t.getValue().type + "\n");
file.writeBytes("TYPE " + t.getKey() + " " + t.getValue().type + " " + t.getValue().binding +
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
}
for (var t : methods.entrySet()) {
(internal.contains(t.getKey()) ? priv : pub).writeBytes(
"STATIC " + t.getKey().method.type + " " + t.getKey().method.name + " " +
t.getKey().descriptor + " " + t.getValue().type + " " + t.getValue().name + "\n");
file.writeBytes("STATIC " + t.getKey().method.type + " " + t.getKey().method.name + " " +
t.getKey().descriptor + " " + t.getValue().type + " " + t.getValue().name +
(internal.contains(t.getKey()) ? " INTERNAL\n" : "\n"));
}
}
}
@@ -400,7 +399,7 @@ public class JBRApiPlugin implements Plugin {
@Override
public void init(JavacTask jt, String... args) {
Path pubPath = Path.of(args[0] + ".public"), privPath = Path.of(args[0] + ".private");
Path output = Path.of(args[0]);
String implVersion;
try {
implVersion = Files.readString(Path.of(args[1])).strip();
@@ -427,21 +426,18 @@ public class JBRApiPlugin implements Plugin {
}
}.scan(te.getTypeElement(), te.getCompilationUnit());
} else if (te.getKind() == TaskEvent.Kind.COMPILATION) {
try (RandomAccessFile pub = new RandomAccessFile(pubPath.toFile(), "rw");
RandomAccessFile priv = new RandomAccessFile(privPath.toFile(), "rw");
FileChannel channel = pub.getChannel()) {
try (RandomAccessFile file = new RandomAccessFile(output.toFile(), "rw");
FileChannel channel = file.getChannel()) {
for (;;) {
try { if (channel.lock() != null) break; } catch (OverlappingFileLockException ignore) {}
LockSupport.parkNanos(10_000000);
}
Registry r = new Registry();
r.read(pub, false);
r.read(priv, true);
r.read(file);
var unresolvedErrors = r.addBindings();
priv.setLength(0);
pub.setLength(0);
pub.writeBytes("VERSION " + implVersion + "\n");
r.write(pub, priv);
file.setLength(0);
file.writeBytes("VERSION " + implVersion + "\n");
r.write(file);
if (!unresolvedErrors.isEmpty()) {
throw new RuntimeException(String.join("\n", unresolvedErrors));
}

View File

@@ -45,7 +45,10 @@ public class JBRApiBootstrap {
* @return implementation for {@link com.jetbrains.JBR.ServiceApi} interface
*/
public static synchronized Object bootstrap(MethodHandles.Lookup outerLookup) {
System.out.println("JBR API bootstrap in compatibility mode: Object bootstrap(MethodHandles.Lookup)");
if (!JBRApi.ENABLED) return null;
if (JBRApi.VERBOSE) {
System.out.println("JBR API bootstrap in compatibility mode: Object bootstrap(MethodHandles.Lookup)");
}
Class<?> apiInterface;
try {
apiInterface = outerLookup.findClass("com.jetbrains.JBR$ServiceApi");

View File

@@ -52,20 +52,22 @@ public class JBRApiSupport {
* @param extensionExtractor receives method, returns its extension enum, or null
* @return implementation for {@code JBR.ServiceApi} interface
*/
@SuppressWarnings("rawtypes")
public static synchronized Object bootstrap(Class<?> apiInterface,
Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation,
Map<Enum<?>, Class<?>[]> knownExtensions,
Map<Enum<?>, Class[]> knownExtensions,
Function<Method, Enum<?>> extensionExtractor) {
return JBRApi.init(
if (!JBRApi.ENABLED) return null;
JBRApi.init(
null,
apiInterface,
serviceAnnotation,
providedAnnotation,
providesAnnotation,
knownExtensions,
extensionExtractor);
return JBRApi.getService(apiInterface);
}
/**

View File

@@ -46,29 +46,21 @@ import static com.jetbrains.internal.jbrapi.BytecodeUtils.*;
*/
class AccessContext {
static final int DYNAMIC_CALL_TARGET_NAME_OFFSET = 128;
@SuppressWarnings("unchecked")
static Supplier<MethodHandle>[] getDynamicCallTargets(Lookup target) {
try {
return (Supplier<MethodHandle>[]) target.findStaticVarHandle(
target.lookupClass(), "dynamicCallTargets", Supplier[].class).get();
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
private static final DirectMethodHandleDesc BOOTSTRAP_DYNAMIC_DESC = MethodHandleDesc.ofMethod(
DirectMethodHandleDesc.Kind.STATIC, desc(JBRApiSupport.class), "bootstrapDynamic",
desc(CallSite.class, Lookup.class, String.class, MethodType.class));
private final Map<Class<?>, Boolean> accessibleClasses = new HashMap<>();
final Map<Proxy, Boolean> dependencies = new HashMap<>(); // true for required, false for optional
final List<Supplier<MethodHandle>> dynamicCallTargets = new ArrayList<>();
final List<DynamicCallTarget> dynamicCallTargets = new ArrayList<>();
final Lookup caller;
AccessContext(Lookup caller) {
this.caller = caller;
}
record DynamicCallTarget(String name, MethodTypeDesc descriptor, Supplier<MethodHandle> futureHandle) {}
class Method {
final CodeBuilder writer;
private final boolean methodRequired;
@@ -92,9 +84,10 @@ class AccessContext {
}
void invokeDynamic(MethodType type, Supplier<MethodHandle> futureHandle) {
String name = String.valueOf((char) (dynamicCallTargets.size() + DYNAMIC_CALL_TARGET_NAME_OFFSET));
dynamicCallTargets.add(futureHandle);
writer.invokedynamic(DynamicCallSiteDesc.of(BOOTSTRAP_DYNAMIC_DESC, name, desc(erase(type))));
MethodTypeDesc desc = desc(erase(type));
DynamicCallTarget t = new DynamicCallTarget("dynamic" + dynamicCallTargets.size(), desc, futureHandle);
dynamicCallTargets.add(t);
writer.invokedynamic(DynamicCallSiteDesc.of(BOOTSTRAP_DYNAMIC_DESC, t.name, desc));
}
void invokeDirect(MethodHandleInfo handleInfo) {

View File

@@ -37,7 +37,6 @@ import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
import java.util.function.Consumer;
import java.util.function.Supplier;
import static java.lang.classfile.ClassFile.ACC_FINAL;
import static java.lang.classfile.ClassFile.ACC_PUBLIC;
@@ -50,8 +49,6 @@ class BytecodeUtils {
public static final ClassDesc VOID_DESC = desc(void.class);
public static final ClassDesc OBJECT_DESC = desc(Object.class);
public static final ClassDesc OBJECT_ARRAY_DESC = OBJECT_DESC.arrayType();
public static final ClassDesc SUPPLIER_DESC = desc(Supplier.class);
public static final ClassDesc SUPPLIER_ARRAY_DESC = SUPPLIER_DESC.arrayType();
public static final ClassDesc EXTENSION_ARRAY_DESC = desc(long[].class);
public static final ClassDesc PROXY_INTERFACE_DESC = desc(com.jetbrains.exported.JBRApiSupport.Proxy.class);
public static final MethodTypeDesc GET_PROXY_TARGET_DESC = MethodTypeDesc.of(OBJECT_DESC);

View File

@@ -33,7 +33,10 @@ import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Function;
import java.util.function.Supplier;
import static java.lang.invoke.MethodHandles.Lookup;
@@ -47,13 +50,11 @@ import static java.lang.invoke.MethodHandles.Lookup;
* This class is an entry point into JBR API backend.
* @see Proxy
*/
// Root is not considered a service for proxy generation purposes, as its instantiation follows custom rules.
@Provides("JBR.ServiceApi")
public class JBRApi {
/**
* Enable JBR API, it wouldn't init when disabled. Enabled by default.
*/
private static final boolean ENABLED = Utils.property("jetbrains.runtime.api.enabled", true);
public static final boolean ENABLED = Utils.property("jetbrains.runtime.api.enabled", true);
/**
* Enable API extensions. When disabled, extension methods are treated like any other method,
* {@link JBRApi#isExtensionSupported} always returns false, {@link JBRApi#getService(Class, Enum[])}
@@ -63,7 +64,7 @@ public class JBRApi {
/**
* Enable extensive debugging logging. Disabled by default.
*/
static final boolean VERBOSE = Utils.property("jetbrains.runtime.api.verbose", false);
public static final boolean VERBOSE = Utils.property("jetbrains.runtime.api.verbose", false);
/**
* Print warnings about usage of deprecated interfaces and methods to {@link System#err}. Enabled by default.
*/
@@ -77,68 +78,54 @@ public class JBRApi {
*/
private static final boolean EXTEND_REGISTRY = Utils.property("jetbrains.runtime.api.extendRegistry", false);
private final ProxyRepository proxyRepository;
private final Boolean[] supportedExtensions;
private final long[] emptyExtensionsBitfield;
private final Map<Enum<?>, Class<?>[]> knownExtensions;
record DynamicCallTargetKey(Class<?> proxy, String name, String descriptor) {}
static final ConcurrentMap<DynamicCallTargetKey, Supplier<MethodHandle>> dynamicCallTargets = new ConcurrentHashMap<>();
private static final ProxyRepository proxyRepository = new ProxyRepository();
private static Boolean[] supportedExtensions;
private static long[] emptyExtensionsBitfield;
@SuppressWarnings("rawtypes")
private static Map<Enum<?>, Class[]> knownExtensions;
static Function<Method, Enum<?>> extensionExtractor;
@SuppressWarnings("rawtypes")
public static void init(InputStream extendedRegistryStream,
Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation,
Map<Enum<?>, Class[]> knownExtensions,
Function<Method, Enum<?>> extensionExtractor) {
if (extendedRegistryStream != null && !EXTEND_REGISTRY) {
throw new Error("Extending JBR API registry is not supported");
}
proxyRepository.init(extendedRegistryStream, serviceAnnotation, providedAnnotation, providesAnnotation);
private JBRApi(ProxyRepository proxyRepository, Map<Enum<?>, Class<?>[]> knownExtensions) {
this.proxyRepository = proxyRepository;
if (EXTENSIONS_ENABLED) {
this.knownExtensions = knownExtensions;
JBRApi.knownExtensions = knownExtensions;
JBRApi.extensionExtractor = extensionExtractor;
supportedExtensions = new Boolean[
knownExtensions.keySet().stream().mapToInt(Enum::ordinal).max().orElse(-1) + 1];
emptyExtensionsBitfield = new long[(supportedExtensions.length + 63) / 64];
} else {
this.knownExtensions = null;
supportedExtensions = null;
emptyExtensionsBitfield = null;
}
}
public static Object init(InputStream extendedRegistryStream,
Class<?> apiInterface,
Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation,
Map<Enum<?>, Class<?>[]> knownExtensions,
Function<Method, Enum<?>> extensionExtractor) {
if (!ENABLED) return null;
if (VERBOSE) {
System.out.println("JBR API init\n knownExtensions = " + (EXTENSIONS_ENABLED ? knownExtensions.keySet() : "DISABLED"));
}
}
ProxyRepository.Registry registry;
if (extendedRegistryStream != null) {
if (!EXTEND_REGISTRY) throw new Error("Extending JBR API registry is not supported");
registry = new ProxyRepository.Registry(extendedRegistryStream);
} else registry = ProxyRepository.Registry.Builtin.PUBLIC;
ProxyRepository proxyRepository = new ProxyRepository(registry, apiInterface.getClassLoader(),
serviceAnnotation, providedAnnotation, providesAnnotation, extensionExtractor);
JBRApi api = new JBRApi(proxyRepository, knownExtensions);
try {
Proxy p = proxyRepository.getProxy(apiInterface, null);
if (!p.init()) throw new Error("Proxy initialization failed");
MethodHandle constructor = p.getConstructor();
return EXTENSIONS_ENABLED ? constructor.invoke(api, api.emptyExtensionsBitfield) : constructor.invoke(api);
} catch (Throwable e) {
if (VERBOSE) {
synchronized (System.err) {
Utils.log(Utils.BEFORE_JBR, System.err, "Warning: JBR API is not supported");
System.err.print("Caused by: ");
e.printStackTrace(System.err);
}
}
return null;
public static MethodHandle bindDynamic(Lookup caller, String name, MethodType type) {
if (VERBOSE) {
System.out.println("Binding call site " + caller.lookupClass().getName() + "#" + name + ": " + type);
}
if (!caller.hasFullPrivilegeAccess()) throw new Error("Caller lookup must have full privilege access"); // Authenticity check.
return dynamicCallTargets.get(new DynamicCallTargetKey(caller.lookupClass(), name, type.descriptorString())).get().asType(type);
}
/**
* @return JBR API version supported by current implementation.
*/
public String getImplVersion() {
@Provides("JBR.ServiceApi")
public static String getImplVersion() {
return proxyRepository.getVersion();
}
@@ -148,7 +135,8 @@ public class JBRApi {
* @apiNote this method is a part of internal {@link com.jetbrains.JBR.ServiceApi}
* service, but is not directly exposed to user.
*/
public boolean isExtensionSupported(Enum<?> extension) {
@Provides("JBR.ServiceApi")
public static boolean isExtensionSupported(Enum<?> extension) {
if (!EXTENSIONS_ENABLED) return false;
int i = extension.ordinal();
if (supportedExtensions[i] == null) {
@@ -165,13 +153,30 @@ public class JBRApi {
return supportedExtensions[i];
}
public static <T> T getInternalService(Class<T> interFace) {
class Holder {
private static final JBRApi INSTANCE = new JBRApi(
new ProxyRepository(ProxyRepository.Registry.Builtin.PRIVATE, JBRApi.class.getClassLoader(),
null, null, null, null), Map.of());
/**
* @return fully supported service implementation for the given interface with specified extensions, or null
* @apiNote this method is a part of internal {@link com.jetbrains.JBR.ServiceApi}
* service, but is not directly exposed to user.
*/
@Provides("JBR.ServiceApi")
public static <T> T getService(Class<T> interFace, Enum<?>... extensions) {
if (!EXTENSIONS_ENABLED) return getService(interFace);
long[] bitfield = new long[emptyExtensionsBitfield.length];
for (Enum<?> e : extensions) {
if (isExtensionSupported(e)) {
int i = e.ordinal() / 64;
int j = e.ordinal() % 64;
bitfield[i] |= 1L << j;
} else {
if (VERBOSE) {
Utils.log(Utils.BEFORE_JBR, System.err, "Warning: Extension not supported: " + e.name());
}
return null;
}
}
return Holder.INSTANCE.getService(interFace);
return getService(interFace, bitfield, true);
}
/**
@@ -179,36 +184,19 @@ public class JBRApi {
* @apiNote this method is a part of internal {@link com.jetbrains.JBR.ServiceApi}
* service, but is not directly exposed to user.
*/
public <T> T getService(Class<T> interFace) {
return getService(interFace, new Enum<?>[0]);
@Provides("JBR.ServiceApi")
public static <T> T getService(Class<T> interFace) {
return getService(interFace, emptyExtensionsBitfield, true);
}
/**
* @return fully supported service implementation for the given interface with specified extensions, or null
* @apiNote this method is a part of internal {@link com.jetbrains.JBR.ServiceApi}
* service, but is not directly exposed to user.
*/
@SuppressWarnings("unchecked")
public <T> T getService(Class<T> interFace, Enum<?>... extensions) {
long[] bitfield;
if (extensions.length > 0 && EXTENSIONS_ENABLED) {
bitfield = new long[emptyExtensionsBitfield.length];
for (Enum<?> e : extensions) {
if (isExtensionSupported(e)) {
int i = e.ordinal() / 64;
int j = e.ordinal() % 64;
bitfield[i] |= 1L << j;
} else {
if (VERBOSE) {
Utils.log(Utils.BEFORE_JBR, System.err, "Warning: Extension not supported: " + e.name());
}
return null;
}
}
} else bitfield = emptyExtensionsBitfield;
public static <T> T getInternalService(Class<T> interFace) {
return getService(interFace, emptyExtensionsBitfield, false);
}
@SuppressWarnings("unchecked")
private static <T> T getService(Class<T> interFace, long[] extensions, boolean publicService) {
Proxy p = proxyRepository.getProxy(interFace, null);
if ((p.getFlags() & Proxy.SERVICE) == 0) {
if ((p.getFlags() & Proxy.SERVICE) == 0 || (publicService && (p.getFlags() & Proxy.INTERNAL) != 0)) {
if (VERBOSE) {
Utils.log(Utils.BEFORE_JBR, System.err, "Warning: Not allowed as a service: " + interFace.getCanonicalName());
}
@@ -222,7 +210,7 @@ public class JBRApi {
}
try {
MethodHandle constructor = p.getConstructor();
return (T) (EXTENSIONS_ENABLED ? constructor.invoke(bitfield) : constructor.invoke());
return (T) (EXTENSIONS_ENABLED ? constructor.invoke(extensions) : constructor.invoke());
} catch (com.jetbrains.exported.JBRApi.ServiceNotAvailableException | NullPointerException e) {
if (VERBOSE) {
synchronized (System.err) {
@@ -236,15 +224,4 @@ public class JBRApi {
}
return null;
}
public static MethodHandle bindDynamic(Lookup caller, String name, MethodType type) {
int index = name.charAt(0) - AccessContext.DYNAMIC_CALL_TARGET_NAME_OFFSET;
if (VERBOSE) {
System.out.println("Binding call site " + caller.lookupClass().getName() + " #" + index);
}
if (!caller.hasFullPrivilegeAccess()) {
throw new Error("Caller lookup must have full privilege access"); // Authenticity check.
}
return AccessContext.getDynamicCallTargets(caller)[index].get().asType(type);
}
}

View File

@@ -96,7 +96,9 @@ class Proxy {
/**
* @see Proxy.Info#flags
*/
static final int SERVICE = 1;
static final int
INTERNAL = 1,
SERVICE = 2;
private final Proxy inverse;
private final Class<?> interFace, target;

View File

@@ -75,7 +75,6 @@ class ProxyGenerator {
return (method.getModifiers() & (Modifier.STATIC | Modifier.FINAL)) == 0;
}
private final ProxyRepository proxyRepository;
private final Proxy.Info info;
private final Class<?> interFace;
private final Lookup proxyGenLookup;
@@ -99,7 +98,6 @@ class ProxyGenerator {
* Creates new proxy generator from given {@link Proxy.Info},
*/
ProxyGenerator(ProxyRepository proxyRepository, Proxy.Info info, Mapping[] specialization) {
this.proxyRepository = proxyRepository;
this.info = info;
this.interFace = info.interfaceLookup.lookupClass();
this.specialization = specialization;
@@ -195,10 +193,10 @@ class ProxyGenerator {
if (JBRApi.VERBOSE) {
System.out.println("Initializing proxy " + interFace.getName());
}
if (!accessContext.dynamicCallTargets.isEmpty()) {
var table = AccessContext.getDynamicCallTargets(generatedProxy);
for (int i = 0; i < table.length; i++) table[i] = accessContext.dynamicCallTargets.get(i);
for (var t : accessContext.dynamicCallTargets) {
JBRApi.dynamicCallTargets.put(new JBRApi.DynamicCallTargetKey(
generatedProxy.lookupClass(), t.name(), t.descriptor().descriptorString()
), t.futureHandle());
}
}
@@ -210,7 +208,7 @@ class ProxyGenerator {
try {
Object sericeTarget = service && info.targetLookup != null ? createServiceTarget() : null;
generatedProxy = proxyGenLookup.defineHiddenClass(
bytecode, false, Lookup.ClassOption.NESTMATE);
bytecode, false, Lookup.ClassOption.STRONG, Lookup.ClassOption.NESTMATE);
MethodHandle constructor = findConstructor();
if (sericeTarget != null) constructor = MethodHandles.insertArguments(constructor, 0, sericeTarget);
return constructor;
@@ -244,10 +242,10 @@ class ProxyGenerator {
cb.withFlags(ACC_SUPER | ACC_FINAL | ACC_SYNTHETIC)
.withSuperclass(superclassDesc)
.withInterfaceSymbols(superinterfaceDescs);
generateFields(cb);
generateConstructor(cb);
generateTargetGetter(cb);
generateMethods(cb);
generateFields(cb);
});
if (JBRApi.VERIFY_BYTECODE) {
List<VerifyError> errors = ClassFile.of().verify(bytecode);
@@ -267,14 +265,6 @@ class ProxyGenerator {
if (EXTENSIONS_ENABLED) {
cb.withField("extensions", EXTENSION_ARRAY_DESC, ACC_PRIVATE | ACC_FINAL);
}
if (!accessContext.dynamicCallTargets.isEmpty()) {
cb.withField("dynamicCallTargets", SUPPLIER_ARRAY_DESC, ACC_PRIVATE | ACC_FINAL | ACC_STATIC);
cb.withMethodBody("<clinit>", MethodTypeDesc.of(VOID_DESC), ACC_PRIVATE | ACC_STATIC, m -> m
.loadConstant(accessContext.dynamicCallTargets.size())
.anewarray(SUPPLIER_DESC)
.putstatic(proxyDesc, "dynamicCallTargets", SUPPLIER_ARRAY_DESC)
.return_());
}
}
private void generateConstructor(ClassBuilder cb) {
@@ -335,8 +325,8 @@ class ProxyGenerator {
private void generateMethod(ClassBuilder cb, Method method) {
Exception exception = null;
Enum<?> extension = EXTENSIONS_ENABLED && proxyRepository.extensionExtractor != null ?
proxyRepository.extensionExtractor.apply(method) : null;
Enum<?> extension = EXTENSIONS_ENABLED && JBRApi.extensionExtractor != null ?
JBRApi.extensionExtractor.apply(method) : null;
Mapping.Method methodMapping = mappingContext.getMapping(method);
MethodHandle handle;
boolean passInstance;

View File

@@ -35,10 +35,8 @@ import java.io.InputStreamReader;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Stream;
import static java.lang.invoke.MethodHandles.Lookup;
@@ -50,26 +48,15 @@ import static java.lang.invoke.MethodHandles.Lookup;
class ProxyRepository {
private static final Proxy NONE = Proxy.empty(null), INVALID = Proxy.empty(false);
private final Registry registry = new Registry();
private final Map<Key, Proxy> proxies = new HashMap<>();
private final Registry registry;
private final ClassLoader classLoader;
private final Class<? extends Annotation> serviceAnnotation, providedAnnotation, providesAnnotation;
private final Module annotationsModule;
final Function<Method, Enum<?>> extensionExtractor;
ProxyRepository(Registry registry,
ClassLoader classLoader,
Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation,
Function<Method, Enum<?>> extensionExtractor) {
this.registry = registry;
this.classLoader = classLoader;
this.serviceAnnotation = serviceAnnotation;
this.providedAnnotation = providedAnnotation;
this.providesAnnotation = providesAnnotation;
this.extensionExtractor = extensionExtractor;
annotationsModule = serviceAnnotation == null ? null : serviceAnnotation.getModule();
void init(InputStream extendedRegistryStream,
Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation) {
registry.initAnnotations(serviceAnnotation, providedAnnotation, providesAnnotation);
if (extendedRegistryStream != null) registry.readEntries(extendedRegistryStream);
}
String getVersion() {
@@ -80,14 +67,15 @@ class ProxyRepository {
Key key = new Key(clazz, specialization);
Proxy p = proxies.get(key);
if (p == null) {
registry.updateClassLoader(clazz.getClassLoader());
Mapping[] inverseSpecialization = specialization == null ? null :
Stream.of(specialization).map(m -> m == null ? null : m.inverse()).toArray(Mapping[]::new);
Key inverseKey = null;
Registry.Entry entry = registry.entries.get(key.clazz().getCanonicalName());
if (entry != null) { // This is a registered proxy
Proxy.Info infoByInterface = entry.resolve(this),
infoByTarget = entry.inverse != null ? entry.inverse.resolve(this) : null;
Proxy.Info infoByInterface = entry.resolve(),
infoByTarget = entry.inverse != null ? entry.inverse.resolve() : null;
inverseKey = infoByTarget != null && infoByTarget.interfaceLookup != null ?
new Key(infoByTarget.interfaceLookup.lookupClass(), inverseSpecialization) : null;
if ((infoByInterface == null && infoByTarget == null) ||
@@ -135,9 +123,9 @@ class ProxyRepository {
/**
* Registry contains all information about mapping between JBR API interfaces and implementation.
* This mapping information can be {@linkplain Entry#resolve(ProxyRepository) resolved} into {@link Proxy.Info}.
* This mapping information can be {@linkplain Entry#resolve() resolved} into {@link Proxy.Info}.
*/
static class Registry {
private static class Registry {
private record StaticKey(String methodName, String targetMethodDescriptor) {}
private record StaticValue(String targetType, String targetMethodName) {}
@@ -152,12 +140,12 @@ class ProxyRepository {
private Entry(String type) { this.type = type; }
private Proxy.Info resolve(ProxyRepository repository) {
private Proxy.Info resolve() {
if (type == null) return null;
Lookup l, t;
try {
l = resolveType(type, repository.classLoader);
t = target != null ? resolveType(target, repository.classLoader) : null;
l = resolveType(type, classLoader);
t = target != null ? resolveType(target, classLoader) : null;
} catch (ClassNotFoundException e) {
if (JBRApi.VERBOSE) {
System.err.println(type + " not eligible");
@@ -178,18 +166,18 @@ class ProxyRepository {
return INVALID;
}
if (target == null) flags |= Proxy.SERVICE;
if (needsAnnotation(repository, l.lookupClass())) {
if (!hasAnnotation(l.lookupClass(), repository.providedAnnotation)) {
if (needsAnnotation(l.lookupClass())) {
if (!hasAnnotation(l.lookupClass(), providedAnnotation)) {
if (JBRApi.VERBOSE) {
System.err.println(type + " not eligible: no @Provided annotation");
}
return INVALID;
}
if (!hasAnnotation(l.lookupClass(), repository.serviceAnnotation)) flags &= ~Proxy.SERVICE;
if (!hasAnnotation(l.lookupClass(), serviceAnnotation)) flags &= ~Proxy.SERVICE;
}
Proxy.Info info;
if (t != null) {
if (needsAnnotation(repository, t.lookupClass()) && !hasAnnotation(t.lookupClass(), repository.providesAnnotation)) {
if (needsAnnotation(t.lookupClass()) && !hasAnnotation(t.lookupClass(), providesAnnotation)) {
if (JBRApi.VERBOSE) {
System.err.println(target + " not eligible: no @Provides annotation");
}
@@ -203,8 +191,8 @@ class ProxyRepository {
String targetType = method.getValue().targetType;
String targetMethodName = method.getValue().targetMethodName;
try {
Lookup lookup = resolveType(targetType, repository.classLoader);
MethodType mt = MethodType.fromMethodDescriptorString(targetMethodDescriptor, repository.classLoader);
Lookup lookup = resolveType(targetType, classLoader);
MethodType mt = MethodType.fromMethodDescriptorString(targetMethodDescriptor, classLoader);
MethodHandle handle = lookup.findStatic(lookup.lookupClass(), targetMethodName, mt);
info.addStaticMethod(methodName, handle);
} catch (ClassNotFoundException | IllegalArgumentException | TypeNotPresentException |
@@ -242,41 +230,38 @@ class ProxyRepository {
public String toString() { return type; }
}
static class Builtin {
static final Registry PRIVATE, PUBLIC;
static {
try {
PRIVATE = new Registry(BootLoader.findResourceAsStream("java.base", "META-INF/jbrapi.private"));
PUBLIC = new Registry(BootLoader.findResourceAsStream("java.base", "META-INF/jbrapi.public"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
private Class<? extends Annotation> serviceAnnotation, providedAnnotation, providesAnnotation;
private Module annotationsModule;
private ClassLoader classLoader;
private final Map<String, Entry> entries = new HashMap<>();
private final String version;
Registry(InputStream inputStream) {
private Registry() {
try (InputStream registryStream = BootLoader.findResourceAsStream("java.base", "META-INF/jbrapi.registry")) {
version = readEntries(registryStream);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private void initAnnotations(Class<? extends Annotation> serviceAnnotation,
Class<? extends Annotation> providedAnnotation,
Class<? extends Annotation> providesAnnotation) {
this.serviceAnnotation = serviceAnnotation;
this.providedAnnotation = providedAnnotation;
this.providesAnnotation = providesAnnotation;
annotationsModule = serviceAnnotation == null ? null : serviceAnnotation.getModule();
if (annotationsModule != null) classLoader = annotationsModule.getClassLoader();
}
private String readEntries(InputStream inputStream) {
String version = null;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String s;
while ((s = reader.readLine()) != null) {
String[] tokens = s.split(" ");
switch (tokens[0]) {
case "VERSION" -> version = tokens[1];
case "STATIC" -> {
Entry entry = entries.computeIfAbsent(tokens[4], Entry::new);
StaticValue target = new StaticValue(tokens[1], tokens[2]);
StaticValue prev = entry.staticMethods.put(new StaticKey(tokens[5], tokens[3]), target);
if (prev != null && !prev.equals(target)) {
throw new RuntimeException("Conflicting mapping: " +
target.targetType + "#" + target.targetMethodName + " <- " +
tokens[4] + "#" + tokens[5] + " -> " +
prev.targetType + "#" + prev.targetMethodName);
}
}
default -> {
case "TYPE" -> {
Entry a = entries.computeIfAbsent(tokens[1], Entry::new);
Entry b = entries.computeIfAbsent(tokens[2], Entry::new);
if ((a.inverse != null || b.inverse != null) && (a.inverse != b || b.inverse != a)) {
@@ -289,7 +274,7 @@ class ProxyRepository {
b.inverse = a;
a.target = tokens[2];
b.target = tokens[1];
switch (tokens[0]) {
switch (tokens[3]) {
case "SERVICE" -> {
a.type = null;
b.flags |= Proxy.SERVICE;
@@ -297,17 +282,56 @@ class ProxyRepository {
case "PROVIDES" -> a.type = null;
case "PROVIDED" -> b.type = null;
}
if (tokens.length > 4 && tokens[4].equals("INTERNAL")) {
a.flags |= Proxy.INTERNAL;
b.flags |= Proxy.INTERNAL;
}
}
case "STATIC" -> {
Entry entry = entries.computeIfAbsent(tokens[4], Entry::new);
StaticValue target = new StaticValue(tokens[1], tokens[2]);
StaticValue prev = entry.staticMethods.put(new StaticKey(tokens[5], tokens[3]), target);
if (prev != null && !prev.equals(target)) {
throw new RuntimeException("Conflicting mapping: " +
target.targetType + "#" + target.targetMethodName + " <- " +
tokens[4] + "#" + tokens[5] + " -> " +
prev.targetType + "#" + prev.targetMethodName);
}
if (tokens.length > 6 && tokens[6].equals("INTERNAL")) entry.flags |= Proxy.INTERNAL;
}
case "VERSION" -> version = tokens[1];
}
}
} catch (IOException e) {
entries.clear();
throw new RuntimeException(e);
} catch (RuntimeException | Error e) {
entries.clear();
throw e;
}
this.version = version;
return version;
}
private boolean needsAnnotation(ProxyRepository repository, Class<?> c) {
return repository.annotationsModule != null && repository.annotationsModule.equals(c.getModule());
private synchronized void updateClassLoader(ClassLoader newLoader) {
// New loader is descendant of current one -> update
for (ClassLoader cl = newLoader;; cl = cl.getParent()) {
if (cl == classLoader) {
classLoader = newLoader;
return;
}
if (cl == null) break;
}
// Current loader is descendant of the new one -> leave
for (ClassLoader cl = classLoader;; cl = cl.getParent()) {
if (cl == newLoader) return;
if (cl == null) break;
}
// Independent classloaders -> error? Or maybe reset cache and start fresh?
throw new RuntimeException("Incompatible classloader");
}
private boolean needsAnnotation(Class<?> c) {
return annotationsModule != null && annotationsModule.equals(c.getModule());
}
private static boolean hasAnnotation(Class<?> c, Class<? extends Annotation> a) {

View File

@@ -1,89 +0,0 @@
/*
* Copyright 2026 JetBrains s.r.o.
* 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package sun.awt.wl.im.text_input_unstable_v3;
import sun.awt.UNIXToolkit;
import java.awt.Toolkit;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
final class CurrentDesktopInfo {
private CurrentDesktopInfo() {}
public static boolean isGnome() {
Boolean result = isGnome.get();
if (result == null) {
synchronized (CurrentDesktopInfo.class) {
if (Toolkit.getDefaultToolkit() instanceof UNIXToolkit unixToolkit) {
result = "gnome".equals(unixToolkit.getDesktop());
} else {
result = false;
}
isGnome.set(result);
}
return result;
}
return result;
}
// {@code null} if not initialized yet
private static final AtomicReference<Boolean> isGnome = new AtomicReference<>(null);
/** negative if couldn't obtain or the desktop is not GNOME */
public static int getGnomeShellMajorVersion() {
Integer result = gnomeVersion.get();
if (result == null) {
synchronized (CurrentDesktopInfo.class) {
if (!isGnome()) {
result = -1;
} else if (Toolkit.getDefaultToolkit() instanceof UNIXToolkit unixToolkit) {
try {
result = Objects.requireNonNullElse(unixToolkit.getGnomeShellMajorVersion(), -1);
} catch (Exception ignored) {
result = -1;
}
} else {
result = -1;
}
gnomeVersion.set(result);
}
return result;
}
return result;
}
// {@code null} if not initialized yet, negative if couldn't obtain or the desktop is not GNOME
private static final AtomicReference<Integer> gnomeVersion = new AtomicReference<>(null);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2025-2026 JetBrains s.r.o.
* Copyright 2025 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
package sun.awt.wl.im.text_input_unstable_v3;
import java.nio.charset.CharacterCodingException;
import java.util.Arrays;
import java.util.Objects;
@@ -37,25 +36,6 @@ import java.util.Objects;
*/
final class IncomingChanges
{
public static class ConversionException extends java.io.IOException {
@java.io.Serial
private static final long serialVersionUID = 7010594789107134519L;
public ConversionException(String message) {
super(message);
}
public ConversionException(Throwable cause) {
super(cause);
}
public ConversionException(String message, Throwable cause) {
super(message, cause);
}
public ConversionException(Throwable cause, String format, Object... args) {
super(String.format(format, args), cause);
}
}
public IncomingChanges updatePreeditString(byte[] newPreeditStringUtf8, int newPreeditStringCursorBeginUtf8Byte, int newPreeditStringCursorEndUtf8Byte) {
this.doUpdatePreeditString = true;
this.newPreeditStringUtf8 = newPreeditStringUtf8;
@@ -70,30 +50,18 @@ final class IncomingChanges
* @return {@code null} if there are no changes in the preedit string
* (i.e. {@link #updatePreeditString(byte[], int, int)} hasn't been called);
* an instance of JavaPreeditString otherwise.
* @throws ConversionException if failed to convert the data provided in {@link #updatePreeditString(byte[], int, int)}
* to an instance of JavaPreeditString.
* @see JavaPreeditString
*/
public JavaPreeditString getPreeditString() throws ConversionException {
public JavaPreeditString getPreeditString() {
if (cachedResultPreeditString != null) {
return cachedResultPreeditString;
}
try {
cachedResultPreeditString = doUpdatePreeditString
? JavaPreeditString.fromWaylandPreeditString(newPreeditStringUtf8, newPreeditStringCursorBeginUtf8Byte, newPreeditStringCursorEndUtf8Byte)
: null;
cachedResultPreeditString = doUpdatePreeditString
? JavaPreeditString.fromWaylandPreeditString(newPreeditStringUtf8, newPreeditStringCursorBeginUtf8Byte, newPreeditStringCursorEndUtf8Byte)
: null;
return cachedResultPreeditString;
} catch (CharacterCodingException err) {
throw new ConversionException(
err,
"Failed to convert zwp_text_input_v3::preedit_string(%s, %d, %d) to JavaPreeditString",
byteArrayToHexArrayString(newPreeditStringUtf8),
newPreeditStringCursorBeginUtf8Byte,
newPreeditStringCursorEndUtf8Byte
);
}
return cachedResultPreeditString;
}
@@ -109,28 +77,18 @@ final class IncomingChanges
* @return {@code null} if there are no changes in the commit string
* (i.e. {@link #updateCommitString(byte[])} hasn't been called);
* an instance of JavaCommitString otherwise.
* @throws ConversionException if failed to convert the data provided in {@link #updateCommitString(byte[])}
* to an instance of JavaCommitString.
* @see JavaCommitString
*/
public JavaCommitString getCommitString() throws ConversionException {
public JavaCommitString getCommitString() {
if (cachedResultCommitString != null) {
return cachedResultCommitString;
}
try {
cachedResultCommitString = doUpdateCommitString
? JavaCommitString.fromWaylandCommitString(newCommitStringUtf8)
: null;
cachedResultCommitString = doUpdateCommitString
? JavaCommitString.fromWaylandCommitString(newCommitStringUtf8)
: null;
return cachedResultCommitString;
} catch (CharacterCodingException err) {
throw new ConversionException(
err,
"Failed to convert zwp_text_input_v3::commit_string(%s) to JavaCommitString",
byteArrayToHexArrayString(newCommitStringUtf8)
);
}
return cachedResultCommitString;
}
@@ -170,27 +128,4 @@ final class IncomingChanges
private boolean doUpdateCommitString = false;
private byte[] newCommitStringUtf8 = null;
private JavaCommitString cachedResultCommitString = null;
private static String byteArrayToHexArrayString(byte[] arr) {
if (arr == null)
return "null";
final int iMax = Math.min(arr.length - 1, 15);
if (iMax == -1)
return "[]";
final StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; ++i) {
b.append("0x").append(Integer.toHexString(Byte.toUnsignedInt(arr[i])));
if (i == iMax) {
if (iMax < arr.length - 1) {
b.append(", ...");
}
return b.append(']').toString();
}
b.append(", ");
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2025-2026 JetBrains s.r.o.
* Copyright 2025 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,6 @@
package sun.awt.wl.im.text_input_unstable_v3;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
record JavaCommitString(String text) {
@@ -41,39 +34,8 @@ record JavaCommitString(String text) {
public static final JavaCommitString EMPTY = new JavaCommitString("");
/**
* Converts a UTF-8 string received in a {@code zwp_text_input_v3::commit_string} event to its UTF-16 equivalent.
*
* @return an instance of {@code JavaCommitString}. Never returns {@code null}.
* @throws CharacterCodingException if {@code utf8Bytes} doesn't represent a valid UTF-8 string.
*/
public static JavaCommitString fromWaylandCommitString(byte[] utf8Bytes) throws CharacterCodingException {
// The only Unicode code point that can contain zero byte(s) is U+000000.
// It hardly makes sense to have it at the end of preedit/commit strings, so let's trim it.
final int utf8BytesCorrectedLength = Utilities.getLengthOfUtf8BytesWithoutTrailingNULs(utf8Bytes);
if (utf8BytesCorrectedLength < 1) {
return JavaCommitString.EMPTY;
}
final CharsetDecoder utf8Decoder = StandardCharsets.UTF_8.newDecoder()
.onMalformedInput(CodingErrorAction.REPORT)
// there can't be unmappable characters for this
// kind of conversion, so REPLACE is just in case
.onUnmappableCharacter(CodingErrorAction.REPLACE);
final CharBuffer decodingBuffer = CharBuffer.allocate(utf8BytesCorrectedLength + 1);
final ByteBuffer utf8BytesBuffer = ByteBuffer.wrap(utf8Bytes, 0, utf8BytesCorrectedLength);
CoderResult decodingResult = utf8Decoder.decode(utf8BytesBuffer, decodingBuffer, true);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
decodingResult = utf8Decoder.flush(decodingBuffer);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
return new JavaCommitString(decodingBuffer.flip().toString());
/** Never returns {@code null}. */
public static JavaCommitString fromWaylandCommitString(byte[] utf8Bytes) {
return new JavaCommitString(Utilities.utf8BytesToJavaString(utf8Bytes));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2025-2026 JetBrains s.r.o.
* Copyright 2025 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,6 @@
package sun.awt.wl.im.text_input_unstable_v3;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
/**
@@ -51,11 +44,10 @@ import java.util.Objects;
* @param cursorEndCodeUnit UTF-16 equivalent of {@code preedit_string.cursor_end}.
* It's not explicitly stated in the protocol specification, but it seems to be a valid
* situation when cursor_end < cursor_begin, which means
* the highlight extends to the left from the caret.
*
* @see #fromWaylandPreeditString(byte[], int, int)
* the highlight extends to the right from the caret
* (e.g., when the text gets selected with Shift + Left Arrow).
*/
public record JavaPreeditString(String text, int cursorBeginCodeUnit, int cursorEndCodeUnit) {
record JavaPreeditString(String text, int cursorBeginCodeUnit, int cursorEndCodeUnit) {
public JavaPreeditString {
Objects.requireNonNull(text, "text");
}
@@ -63,43 +55,13 @@ public record JavaPreeditString(String text, int cursorBeginCodeUnit, int cursor
public static final JavaPreeditString EMPTY = new JavaPreeditString("", 0, 0);
public static final JavaPreeditString EMPTY_NO_CARET = new JavaPreeditString("", -1, -1);
/**
* Converts a UTF-8 string and indices to it received in a {@code zwp_text_input_v3::preedit_string} event to their UTF-16 equivalents.
* <p>
* This is how data inconsistencies are handled:
* <ul>
* <li>If {@code utf8Bytes} doesn't represent a valid UTF-8 string, a {@link CharacterCodingException} is thrown.</li>
* <li>Otherwise, if {@code cursorBeginUtf8Byte} points to a middle byte of a code point,
* it's considered as violating the protocol specification.
* In this case both {@link #cursorBeginCodeUnit} and {@link #cursorEndCodeUnit} of the resulting {@code JavaPreeditString}
* will point to the end of its {@link #text}.</li>
* <li>Also, if {@code cursorEndUtf8Byte} points to a middle byte of a code point,
* it's considered as violating the protocol specification.
* In this case {@link #cursorEndCodeUnit} of the resulting {@code JavaPreeditString}
* will be set equal to its {@link #cursorBeginCodeUnit}.</li>
* <li>If {@code cursorBeginUtf8Byte} or {@code cursorEndUtf8Byte} > {@code utf8Bytes.length},
* the corresponding {@link #cursorBeginCodeUnit} or {@link #cursorEndCodeUnit} of the resulting {@code JavaPreeditString}
* will be set to the length of its {@link #text}.</li>
* </ul>
*
* @param utf8Bytes an UTF-8 encoded string
* @param cursorBeginUtf8Byte {@code cursor_begin} parameter of the same {@code zwp_text_input_v3::preedit_string} event
* @param cursorEndUtf8Byte {@code cursor_end} parameter of the same {@code zwp_text_input_v3::preedit_string} event
*
* @return an instance of {@code JavaPreeditString}. Never returns {@code null}
*
* @throws CharacterCodingException if {@code utf8Bytes} doesn't represent a valid UTF-8 string
*/
// The method is tested via test/jdk/java/awt/wakefield/im/text_input_unstable_v3/WaylandPreeditStringToJavaConversionTest.java
public static JavaPreeditString fromWaylandPreeditString(
final byte[] utf8Bytes,
final int cursorBeginUtf8Byte,
final int cursorEndUtf8Byte
) throws CharacterCodingException {
// The only Unicode code point that can contain zero byte(s) is U+000000.
// It hardly makes sense to have it at the end of preedit/commit strings, so let's trim it.
final int utf8BytesCorrectedLength = Utilities.getLengthOfUtf8BytesWithoutTrailingNULs(utf8Bytes);
) {
// Java's UTF-8 -> UTF-16 conversion doesn't like trailing NUL codepoints, so let's trim them
final int utf8BytesWithoutNulLength = Utilities.getLengthOfUtf8BytesWithoutTrailingNULs(utf8Bytes);
// cursorBeginUtf8Byte, cursorEndUtf8Byte normalized relatively to the valid values range.
final int fixedCursorBeginUtf8Byte;
@@ -107,116 +69,37 @@ public record JavaPreeditString(String text, int cursorBeginCodeUnit, int cursor
if (cursorBeginUtf8Byte < 0 || cursorEndUtf8Byte < 0) {
fixedCursorBeginUtf8Byte = fixedCursorEndUtf8Byte = -1;
} else {
// 0 <= cursorBeginUtf8Byte <= fixedCursorBeginUtf8Byte <= utf8BytesCorrectedLength
fixedCursorBeginUtf8Byte = Math.min(cursorBeginUtf8Byte, utf8BytesCorrectedLength);
// 0 <= cursorEndUtf8Byte <= fixedCursorEndUtf8Byte <= utf8BytesCorrectedLength
fixedCursorEndUtf8Byte = Math.min(cursorEndUtf8Byte, utf8BytesCorrectedLength);
// 0 <= cursorBeginUtf8Byte <= fixedCursorBeginUtf8Byte <= utf8BytesWithoutNulLength
fixedCursorBeginUtf8Byte = Math.min(cursorBeginUtf8Byte, utf8BytesWithoutNulLength);
// 0 <= cursorEndUtf8Byte <= fixedCursorEndUtf8Byte <= utf8BytesWithoutNulLength
fixedCursorEndUtf8Byte = Math.min(cursorEndUtf8Byte, utf8BytesWithoutNulLength);
}
if (utf8BytesCorrectedLength < 1) {
return fixedCursorBeginUtf8Byte < 0 || fixedCursorEndUtf8Byte < 0
? JavaPreeditString.EMPTY_NO_CARET
: JavaPreeditString.EMPTY;
}
final CharsetDecoder utf8Decoder = StandardCharsets.UTF_8.newDecoder()
.onMalformedInput(CodingErrorAction.REPORT)
// there can't be unmappable characters for this
// kind of conversion, so REPLACE is just in case
.onUnmappableCharacter(CodingErrorAction.REPLACE);
final CharBuffer decodingBuffer = CharBuffer.allocate(utf8BytesCorrectedLength + 1);
final ByteBuffer utf8BytesBuffer = ByteBuffer.wrap(utf8Bytes, 0, utf8BytesCorrectedLength);
CoderResult decodingResult;
// The decoding will be performed in 3 sections:
// [0; decodingPoint1) + [decodingPoint1; decodingPoint2) + [decodingPoint2; utf8BytesCorrectedLength),
// where decodingPoint1, decodingPoint2 are the fixedCursor[Begin|End]Utf8Byte
// This way we can translate the fixedCursor[Begin|End]Utf8Byte to their UTF-16 equivalents right while decoding.
final int decodingPoint1 = Math.min(fixedCursorBeginUtf8Byte, fixedCursorEndUtf8Byte);
final int decodingPoint2 = Math.max(fixedCursorBeginUtf8Byte, fixedCursorEndUtf8Byte);
final int decodedPoint1;
final int decodedPoint2;
// [0; decodingPoint1)
if (decodingPoint1 > 0) {
utf8BytesBuffer.limit(decodingPoint1);
decodingResult = utf8Decoder.decode(utf8BytesBuffer, decodingBuffer, false);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
decodedPoint1 = decodingBuffer.position();
} else {
decodedPoint1 = decodingPoint1 < 0 ? -1 : 0;
}
// [decodingPoint1; decodingPoint2)
if (decodingPoint2 > 0 && decodingPoint2 > decodingPoint1) {
utf8BytesBuffer.limit(decodingPoint2);
decodingResult = utf8Decoder.decode(utf8BytesBuffer, decodingBuffer, false);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
decodedPoint2 = decodingBuffer.position();
} else {
decodedPoint2 = decodingPoint2 < 0 ? -1 : decodedPoint1;
}
// [decodingPoint2; utf8BytesCorrectedLength)
{
utf8BytesBuffer.limit(utf8BytesCorrectedLength);
decodingResult = utf8Decoder.decode(utf8BytesBuffer, decodingBuffer, true);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
}
// last decoding step
decodingResult = utf8Decoder.flush(decodingBuffer);
if (decodingResult.isError() || decodingResult.isOverflow()) {
decodingResult.throwException();
}
// From now on we know that utf8Bytes really represents a properly encoded UTF-8 string.
// -1 <= decodedPoint1 <= decodedPoint2 <= utf8BytesCorrectedLength
assert(decodedPoint1 >= -1);
assert(decodedPoint2 >= decodedPoint1);
assert(decodedPoint2 <= utf8BytesCorrectedLength);
final String resultText = decodingBuffer.flip().toString();
final int resultCursorBeginCodeUnit;
final int resultCursorEndCodeUnit;
final var resultText = Utilities.utf8BytesToJavaString(utf8Bytes, 0, utf8BytesWithoutNulLength);
if (fixedCursorBeginUtf8Byte < 0 || fixedCursorEndUtf8Byte < 0) {
resultCursorBeginCodeUnit = resultCursorEndCodeUnit = -1;
} else {
// 0 <= decodedPoint1 <= decodedPoint2 <= utf8BytesCorrectedLength
assert(decodedPoint1 >= 0);
if (Utilities.isUtf8CharBoundary(fixedCursorBeginUtf8Byte, utf8Bytes, utf8BytesCorrectedLength)) {
resultCursorBeginCodeUnit = fixedCursorBeginUtf8Byte < fixedCursorEndUtf8Byte
? decodedPoint1
: decodedPoint2;
if (Utilities.isUtf8CharBoundary(fixedCursorEndUtf8Byte, utf8Bytes, utf8BytesCorrectedLength)) {
resultCursorEndCodeUnit = fixedCursorBeginUtf8Byte < fixedCursorEndUtf8Byte
? decodedPoint2
: decodedPoint1;
} else {
resultCursorEndCodeUnit = resultCursorBeginCodeUnit;
}
} else {
resultCursorBeginCodeUnit = resultCursorEndCodeUnit = resultText.length();
}
return new JavaPreeditString(resultText, -1, -1);
}
return new JavaPreeditString(resultText, resultCursorBeginCodeUnit, resultCursorEndCodeUnit);
if (resultText == null) {
assert fixedCursorBeginUtf8Byte == 0 : "Cursor begin byte must be zero for an empty string";
assert fixedCursorEndUtf8Byte == 0 : "Cursor end byte must be zero for an empty string";
return JavaPreeditString.EMPTY;
}
final String javaPrefixBeforeCursorBegin = (fixedCursorBeginUtf8Byte == 0)
? ""
: Utilities.utf8BytesToJavaString(utf8Bytes, 0, fixedCursorBeginUtf8Byte);
final String javaPrefixBeforeCursorEnd = (fixedCursorEndUtf8Byte == 0)
? ""
: Utilities.utf8BytesToJavaString(utf8Bytes, 0, fixedCursorEndUtf8Byte);
return new JavaPreeditString(
resultText,
javaPrefixBeforeCursorBegin.length(),
javaPrefixBeforeCursorEnd.length()
);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2025-2026 JetBrains s.r.o.
* Copyright 2025 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
package sun.awt.wl.im.text_input_unstable_v3;
import java.nio.charset.StandardCharsets;
interface Utilities {
static int getLengthOfUtf8BytesWithoutTrailingNULs(final byte[] utf8Bytes) {
@@ -38,34 +40,20 @@ interface Utilities {
return (lastNonNulIndex < 0) ? 0 : lastNonNulIndex + 1;
}
/**
* Checks that {@code index}-th byte is the first byte in a UTF-8 code point sequence or the end of the string.
*
* @param index index of the byte in {@code utf8StrBytes} to check
* @param utf8StrBytes byte array representing a correctly encoded UTF-8 string
* @param utf8StrBytesLength if non-negative, will be considered as the array length instead of {@code utf8StrBytes.length}
* @return {@code true} if either {@code index} points to the end of the string or to a first byte of a code point
*/
static boolean isUtf8CharBoundary(final int index, final byte[] utf8StrBytes, int utf8StrBytesLength) {
utf8StrBytesLength = utf8StrBytesLength < 0 ? utf8StrBytes.length : utf8StrBytesLength;
if (utf8StrBytesLength > utf8StrBytes.length) {
throw new ArrayIndexOutOfBoundsException("utf8StrBytesLength");
}
if (index < 0 || index > utf8StrBytesLength) {
throw new ArrayIndexOutOfBoundsException("index");
static String utf8BytesToJavaString(final byte[] utf8Bytes) {
if (utf8Bytes == null) {
return "";
}
if (index == utf8StrBytesLength) {
return true;
}
return utf8BytesToJavaString(
utf8Bytes,
0,
// Java's UTF-8 -> UTF-16 conversion doesn't like trailing NUL codepoints, so let's trim them
getLengthOfUtf8BytesWithoutTrailingNULs(utf8Bytes)
);
}
final byte utf8Byte = utf8StrBytes[index];
// In a valid UTF-8 string, a byte is the first byte of an encoded code point if and only if
// its binary representation does NOT start with 10, i.e. does NOT match 0b10......
final int utf8ByteUnsigned = Byte.toUnsignedInt(utf8Byte);
return ((utf8ByteUnsigned & 0b1100_0000) != 0b1000_0000);
static String utf8BytesToJavaString(final byte[] utf8Bytes, final int offset, final int length) {
return utf8Bytes == null ? "" : new String(utf8Bytes, offset, length, StandardCharsets.UTF_8);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2025-2026 JetBrains s.r.o.
* Copyright 2025 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -659,12 +659,18 @@ final class WLInputMethodZwpTextInputV3 extends InputMethodAdapter {
final int highlightEndCodeUnitIndex =
Math.max(0, Math.min(preeditString.cursorEndCodeUnit(), preeditString.text().length()));
imeCaret = TextHitInfo.beforeOffset(highlightBeginCodeUnitIndex);
// Mutter doesn't seem to send preedit_string events with highlighting
// (i.e. they never have cursor_begin != cursor_end) at all.
// KWin, however, always uses highlighting. Looking at how it changes when we navigate within the
// preedit text with arrow keys, it becomes clear KWin expects the caret to be put at the end
// of the highlighting and not at the beginning.
// That's why highlightEndCodeUnitIndex is used here and not highlightBeginCodeUnitIndex.
imeCaret = TextHitInfo.beforeOffset(highlightEndCodeUnitIndex);
// cursor_begin and cursor_end
// "could be represented by the client as a line if both values are the same,
// or as a text highlight otherwise"
if (highlightBeginCodeUnitIndex == highlightEndCodeUnitIndex) {
if (highlightEndCodeUnitIndex == highlightBeginCodeUnitIndex) {
// Only basic highlighting
awtInstallIMHighlightingInto(imeText, commitString.text().length(), preeditString.text().length(), 0, 0);
} else {
@@ -739,6 +745,8 @@ final class WLInputMethodZwpTextInputV3 extends InputMethodAdapter {
// (e.g. via environment variables).
// For now we're adjusting to iBus, because it seems to be the most widespread engine.
final InputMethodHighlight IM_BASIC_HIGHLIGHTING = InputMethodHighlight.UNSELECTED_CONVERTED_TEXT_HIGHLIGHT;
// I'm not sure if the "text highlight" mentioned in zwp_text_input_v3::preedit_string means the text
// should look selected.
final InputMethodHighlight IM_SPECIAL_HIGHLIGHTING = InputMethodHighlight.SELECTED_CONVERTED_TEXT_HIGHLIGHT;
if (specialPreeditHighlightingBegin == specialPreeditHighlightingEnd) {
@@ -1196,29 +1204,6 @@ final class WLInputMethodZwpTextInputV3 extends InputMethodAdapter {
return wlIncomingChanges;
}
private JavaPreeditString wlFixPreeditStringIfBroken(final JavaPreeditString preeditString) {
if (preeditString == null) {
return null;
}
final boolean isGNOME46OrBelow;
if (CurrentDesktopInfo.isGnome()) {
final int gnomeVersion = CurrentDesktopInfo.getGnomeShellMajorVersion();
isGNOME46OrBelow = gnomeVersion >= 0 && gnomeVersion <= 46;
} else {
isGNOME46OrBelow = false;
}
// https://gitlab.gnome.org/GNOME/mutter/-/issues/3547.
// Working around it here by resetting cursor_end to cursor_begin.
if (isGNOME46OrBelow) {
return new JavaPreeditString(preeditString.text(), preeditString.cursorBeginCodeUnit(), preeditString.cursorBeginCodeUnit());
}
return preeditString;
}
/** Called by {@link ClientComponentCaretPositionTracker} */
boolean wlUpdateCursorRectangle(final boolean forceUpdate) {
assert EventQueue.isDispatchThread() : "Method must only be invoked on EDT";
@@ -1335,9 +1320,9 @@ final class WLInputMethodZwpTextInputV3 extends InputMethodAdapter {
}
if (wlInputContextState.getCurrentWlSurfacePtr() != leftWlSurfacePtr) {
if (log.isLoggable(PlatformLogger.Level.INFO)) {
log.info("zwp_text_input_v3_onLeave: leftWlSurfacePtr==0x{0} isn''t equal to the currently known one 0x{1}.",
Long.toHexString(leftWlSurfacePtr), Long.toHexString(wlInputContextState.getCurrentWlSurfacePtr()));
if (log.isLoggable(PlatformLogger.Level.WARNING)) {
log.warning("zwp_text_input_v3_onLeave: leftWlSurfacePtr==0x{0} isn''t equal to the currently known one 0x{1}.",
Long.toHexString(leftWlSurfacePtr), Long.toHexString(wlInputContextState.getCurrentWlSurfacePtr()));
}
}
@@ -1438,34 +1423,8 @@ final class WLInputMethodZwpTextInputV3 extends InputMethodAdapter {
preeditStringToApply = PropertiesInitials.PREEDIT_STRING;
commitStringToApply = PropertiesInitials.COMMIT_STRING;
} else {
JavaPreeditString preeditStringToApplyInitializer;
try {
preeditStringToApplyInitializer = incomingChangesToApply.getPreeditString();
} catch (IncomingChanges.ConversionException err) {
preeditStringToApplyInitializer = JavaPreeditString.EMPTY;
if (log.isLoggable(PlatformLogger.Level.WARNING)) {
log.warning(
String.format("Failed to obtain the preedit string from the incoming changes, instead will use %s.", preeditStringToApplyInitializer),
err
);
}
}
preeditStringToApplyInitializer = wlFixPreeditStringIfBroken(preeditStringToApplyInitializer);
preeditStringToApply = Objects.requireNonNullElse(preeditStringToApplyInitializer, PropertiesInitials.PREEDIT_STRING);
JavaCommitString commitStringToApplyInitializer;
try {
commitStringToApplyInitializer = incomingChangesToApply.getCommitString();
} catch (IncomingChanges.ConversionException err) {
commitStringToApplyInitializer = JavaCommitString.EMPTY;
if (log.isLoggable(PlatformLogger.Level.WARNING)) {
log.warning(
String.format("Failed to obtain the commit string from the incoming changes, instead will use %s.", commitStringToApplyInitializer),
err
);
}
}
commitStringToApply = Objects.requireNonNullElse(commitStringToApplyInitializer, PropertiesInitials.COMMIT_STRING);
preeditStringToApply = Objects.requireNonNullElse(incomingChangesToApply.getPreeditString(), PropertiesInitials.PREEDIT_STRING);
commitStringToApply = Objects.requireNonNullElse(incomingChangesToApply.getCommitString(), PropertiesInitials.COMMIT_STRING);
}
this.wlInputContextState.syncWithAppliedIncomingChanges(preeditStringToApply, commitStringToApply, doneSerial);

View File

@@ -1,11 +1,11 @@
PROVIDES com.jetbrains.test.jbr.MethodMapping.SimpleEmptyImpl com.jetbrains.test.api.MethodMapping.SimpleEmpty
SERVICE com.jetbrains.test.jbr.MethodMapping.PlainImpl com.jetbrains.test.api.MethodMapping.Plain
TYPE com.jetbrains.test.jbr.MethodMapping.SimpleEmptyImpl com.jetbrains.test.api.MethodMapping.SimpleEmpty PROVIDES
TYPE com.jetbrains.test.jbr.MethodMapping.PlainImpl com.jetbrains.test.api.MethodMapping.Plain SERVICE
STATIC MethodMappingTest main ([Ljava/lang/String;)V com.jetbrains.test.api.MethodMapping.Plain c
SERVICE com.jetbrains.test.jbr.MethodMapping.PlainFailImpl com.jetbrains.test.api.MethodMapping.PlainFail
PROVIDED com.jetbrains.test.jbr.MethodMapping.Callback com.jetbrains.test.api.MethodMapping.ApiCallback
TWO_WAY com.jetbrains.test.jbr.MethodMapping.JBRTwoWay com.jetbrains.test.api.MethodMapping.ApiTwoWay
TWO_WAY com.jetbrains.test.jbr.MethodMapping.ConversionImpl com.jetbrains.test.api.MethodMapping.Conversion
PROVIDES com.jetbrains.test.jbr.MethodMapping.ConversionSelfImpl com.jetbrains.test.api.MethodMapping.ConversionSelf
PROVIDES com.jetbrains.test.jbr.MethodMapping.ConversionFailImpl com.jetbrains.test.api.MethodMapping.ConversionFail
PROVIDES com.jetbrains.test.jbr.MethodMapping.ArrayConversionImpl com.jetbrains.test.api.MethodMapping.ArrayConversion
PROVIDES com.jetbrains.test.jbr.MethodMapping.GenericConversionImpl com.jetbrains.test.api.MethodMapping.GenericConversion
TYPE com.jetbrains.test.jbr.MethodMapping.PlainFailImpl com.jetbrains.test.api.MethodMapping.PlainFail SERVICE
TYPE com.jetbrains.test.jbr.MethodMapping.Callback com.jetbrains.test.api.MethodMapping.ApiCallback PROVIDED
TYPE com.jetbrains.test.jbr.MethodMapping.JBRTwoWay com.jetbrains.test.api.MethodMapping.ApiTwoWay TWO_WAY
TYPE com.jetbrains.test.jbr.MethodMapping.ConversionImpl com.jetbrains.test.api.MethodMapping.Conversion TWO_WAY
TYPE com.jetbrains.test.jbr.MethodMapping.ConversionSelfImpl com.jetbrains.test.api.MethodMapping.ConversionSelf PROVIDES
TYPE com.jetbrains.test.jbr.MethodMapping.ConversionFailImpl com.jetbrains.test.api.MethodMapping.ConversionFail PROVIDES
TYPE com.jetbrains.test.jbr.MethodMapping.ArrayConversionImpl com.jetbrains.test.api.MethodMapping.ArrayConversion PROVIDES
TYPE com.jetbrains.test.jbr.MethodMapping.GenericConversionImpl com.jetbrains.test.api.MethodMapping.GenericConversion PROVIDES

View File

@@ -1,7 +1,7 @@
PROVIDES absentImpl com.jetbrains.test.api.ProxyInfoResolving.InterfaceWithoutImplementation
TYPE absentImpl com.jetbrains.test.api.ProxyInfoResolving.InterfaceWithoutImplementation PROVIDES
STATIC NoClass foo ()V com.jetbrains.test.api.ProxyInfoResolving.ServiceWithoutImplementation foo
PROVIDES com.jetbrains.test.jbr.ProxyInfoResolving.ValidApiImpl com.jetbrains.test.api.ProxyInfoResolving.ValidApi
PROVIDES com.jetbrains.test.jbr.ProxyInfoResolving.ProxyClassImpl com.jetbrains.test.api.ProxyInfoResolving.ProxyClass
PROVIDED com.jetbrains.test.jbr.ProxyInfoResolving.ClientProxyClass com.jetbrains.test.api.ProxyInfoResolving.ClientProxyClassImpl
SERVICE com.jetbrains.test.jbr.ProxyInfoResolving.ServiceWithoutAnnotationImpl com.jetbrains.test.api.ProxyInfoResolving.ServiceWithoutAnnotation
TYPE com.jetbrains.test.jbr.ProxyInfoResolving.ValidApiImpl com.jetbrains.test.api.ProxyInfoResolving.ValidApi PROVIDES
TYPE com.jetbrains.test.jbr.ProxyInfoResolving.ProxyClassImpl com.jetbrains.test.api.ProxyInfoResolving.ProxyClass PROVIDES
TYPE com.jetbrains.test.jbr.ProxyInfoResolving.ClientProxyClass com.jetbrains.test.api.ProxyInfoResolving.ClientProxyClassImpl PROVIDED
TYPE com.jetbrains.test.jbr.ProxyInfoResolving.ServiceWithoutAnnotationImpl com.jetbrains.test.api.ProxyInfoResolving.ServiceWithoutAnnotation SERVICE
STATIC NoClass foo ()V com.jetbrains.test.api.ProxyInfoResolving.ServiceWithExtension foo

View File

@@ -31,8 +31,6 @@
import com.jetbrains.Extensions;
import com.jetbrains.internal.jbrapi.JBRApi;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -43,25 +41,11 @@ import static com.jetbrains.test.api.Real.*;
public class RealTest {
public static void main(String[] args) throws Throwable {
// Plain run.
run();
// Run in an isolated classloader at least 2 times until the proxy gets GC'ed.
WeakReference<?> weak = null;
for (int i = 0; i < 2 || weak.get() != null; i++) {
System.gc();
new IsolatedLoader().loadClass(RealTest.class.getName()).getMethod("run").invoke(null);
if (weak == null) weak = new WeakReference<>(getProxy(Proxy.class));
if (i > 300) throw new Error("Proxy was not collected after 300 iterations");
}
}
public static void run() {
init("RealTest", Map.of(Extensions.FOO, new Class<?>[] {Proxy.class}, Extensions.BAR, new Class<?>[] {Proxy.class}));
public static void main(String[] args) {
init("RealTest", Map.of(Extensions.FOO, new Class[] {Proxy.class}, Extensions.BAR, new Class[] {Proxy.class}));
// Get service
Service service = Objects.requireNonNull(api.getService(Service.class));
Service service = Objects.requireNonNull(JBRApi.getService(Service.class));
// Proxy passthrough
Proxy p = Objects.requireNonNull(service.getProxy());
@@ -102,10 +86,10 @@ public class RealTest {
}
// Check extensions
if (!api.isExtensionSupported(Extensions.FOO)) {
if (!JBRApi.isExtensionSupported(Extensions.FOO)) {
throw new Error("FOO extension must be supported");
}
if (api.isExtensionSupported(Extensions.BAR)) {
if (JBRApi.isExtensionSupported(Extensions.BAR)) {
throw new Error("BAR extension must not be supported");
}
try {
@@ -117,10 +101,10 @@ public class RealTest {
throw new Error("BAR extension was disabled but call succeeded");
} catch (UnsupportedOperationException ignore) {}
// foo() must succeed when enabled
api.getService(Service.class, Extensions.FOO).getProxy().foo();
JBRApi.getService(Service.class, Extensions.FOO).getProxy().foo();
// Asking for BAR must return null, as it is not supported
requireNull(api.getService(Service.class, Extensions.FOO, Extensions.BAR));
requireNull(api.getService(Service.class, Extensions.BAR));
requireNull(JBRApi.getService(Service.class, Extensions.FOO, Extensions.BAR));
requireNull(JBRApi.getService(Service.class, Extensions.BAR));
// Test specialized (implicit) List proxy
List<Api2Way> list = Objects.requireNonNull(service.testList(null));
@@ -149,25 +133,4 @@ public class RealTest {
value = o;
}
}
private static class IsolatedLoader extends ClassLoader {
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
if (name.equals("RealClassloadersTest") ||
(name.startsWith("com.jetbrains.") && !name.startsWith("com.jetbrains.test.jbr.") &&
!name.startsWith("com.jetbrains.exported.") && !name.startsWith("com.jetbrains.internal."))) {
Class<?> c = findLoadedClass(name);
if (c != null) return c;
String path = name.replace('.', '/').concat(".class");
try (var stream = getResourceAsStream(path)) {
if (stream == null) throw new ClassNotFoundException(name);
byte[] b = stream.readAllBytes();
return defineClass(name, b, 0, b.length);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return super.loadClass(name, resolve);
}
}
}

View File

@@ -1,5 +1,5 @@
SERVICE com.jetbrains.test.jbr.Real.ServiceImpl com.jetbrains.test.api.Real.Service
PROVIDES com.jetbrains.test.jbr.Real.ProxyImpl com.jetbrains.test.api.Real.Proxy
PROVIDED com.jetbrains.test.jbr.Real.Client com.jetbrains.test.api.Real.ClientImpl
TWO_WAY com.jetbrains.test.jbr.Real.JBR2Way com.jetbrains.test.api.Real.Api2Way
TWO_WAY com.jetbrains.test.jbr.Real.JBRLazyNumber com.jetbrains.test.api.Real.ApiLazyNumber
TYPE com.jetbrains.test.jbr.Real.ServiceImpl com.jetbrains.test.api.Real.Service SERVICE
TYPE com.jetbrains.test.jbr.Real.ProxyImpl com.jetbrains.test.api.Real.Proxy PROVIDES
TYPE com.jetbrains.test.jbr.Real.Client com.jetbrains.test.api.Real.ClientImpl PROVIDED
TYPE com.jetbrains.test.jbr.Real.JBR2Way com.jetbrains.test.api.Real.Api2Way TWO_WAY
TYPE com.jetbrains.test.jbr.Real.JBRLazyNumber com.jetbrains.test.api.Real.ApiLazyNumber TWO_WAY

View File

@@ -28,7 +28,5 @@ package com.jetbrains;
*/
public class JBR {
@Service
@Provided
public interface ServiceApi {}
}

View File

@@ -32,40 +32,31 @@ import java.util.Map;
public class Util {
public static JBRApi api;
private static Object proxyRepository;
private static Method getProxy, inverse, generate;
/**
* Invoke internal {@link JBRApi#init} bypassing {@link com.jetbrains.exported.JBRApiSupport#bootstrap}.
*/
public static void init(String registryName, Map<Enum<?>, Class<?>[]> extensionClasses) {
try (InputStream in = new SequenceInputStream(
new ByteArrayInputStream("PROVIDES com.jetbrains.internal.jbrapi.JBRApi com.jetbrains.JBR.ServiceApi\n".getBytes()),
new FileInputStream(new File(System.getProperty("test.src", "."), registryName + ".registry")))) {
Object api = JBRApi.init(in, JBR.ServiceApi.class, Service.class, Provided.class, Provides.class, extensionClasses, m -> {
public static void init(String registryName, Map<Enum<?>, Class[]> extensionClasses) {
try (InputStream in = new FileInputStream(new File(System.getProperty("test.src", "."), registryName + ".registry"))) {
JBRApi.init(in, Service.class, Provided.class, Provides.class, extensionClasses, m -> {
Extension e = m.getAnnotation(Extension.class);
return e == null ? null : e.value();
});
Field f = api.getClass().getDeclaredField("target");
f.setAccessible(true);
Util.api = (JBRApi) f.get(api);
proxyRepository = null;
getProxy = inverse = generate = null;
} catch (IOException | NoSuchFieldException | IllegalAccessException e) {
} catch (IOException e) {
throw new Error(e);
}
}
private static Object proxyRepository;
public static Object getProxyRepository() throws Throwable {
if (proxyRepository == null) {
Field f = JBRApi.class.getDeclaredField("proxyRepository");
f.setAccessible(true);
proxyRepository = f.get(api);
proxyRepository = f.get(null);
}
return proxyRepository;
}
private static Method getProxy;
public static Object getProxy(Class<?> interFace) throws Throwable {
var repo = getProxyRepository();
if (getProxy == null) {
@@ -76,6 +67,7 @@ public class Util {
return getProxy.invoke(repo, interFace, null);
}
private static Method inverse;
public static Object inverse(Object proxy) throws Throwable {
if (inverse == null) {
inverse = proxy.getClass().getDeclaredMethod("inverse");
@@ -84,6 +76,7 @@ public class Util {
return inverse.invoke(proxy);
}
private static Method generate;
public static boolean isSupported(Object proxy) throws Throwable {
if (generate == null) {
generate = proxy.getClass().getDeclaredMethod("generate");