Repository navigation
chore: replace the deprecated IntelliJ APIs that have a replacement in 2024.2 - #2032
Merged
lagergren merged 1 commit intoNov 20, 2026
Merged
Conversation
…n 2024.2 Part of redhat-developer#1971. The plugin verifier reports 50 uses of deprecated IntelliJ APIs against 2026.3. This replaces 14 of them, whose replacement exists in 2024.2, LSP4IJ's minimum, and isn't deprecated up to 2026.3: - `ProcessAdapter` becomes `ProcessListener`, whose methods have defaults (`ExecTask`). - The override of `InlayHintsProviderFactory.getProvidersInfo(Project)` is removed: its default calls `getProvidersInfo()`, which `LSPInlayHintProvidersFactory` overrides. - `FileChooserDescriptorFactory.createSingleFileDescriptor()` becomes `new FileChooserDescriptor(true, true, true, true, false, false)`, which is what it returns in 2024.2: a file, a folder or a jar. `createSingleFileNoJarsDescriptor()` and `singleFile()` only take files, and a program to debug can be a folder, such as a Go package (`DebugAdapterServerPanel`). - `new URL(String)` becomes `URI.create(String).toURL()` (`GitHubAssetFetcher`, `MavenArtifactFetcher`). Both URLs are built from a template's owner and repository, or from an encoded query, and an `IllegalArgumentException` lands in the same `catch (Exception)`. - `ReadAction.compute` and `ReadAction.run` become `Application.runReadAction` (`LSPPendingHoverDocumentationTarget`, `LSPLinkedEditingRangeSynchronizer`, `LSPParameterInfoHandler`, `DAPValue`). The calls that return a value cast their lambda to `Computable`, since 2026.3 has no `runReadAction(ThrowableComputable)`. - `DynamicBundle(String)` becomes `DynamicBundle(Class, String)` (`LanguageServerBundle`, `DAPBundle`). - `Document.addDocumentListener(DocumentListener)` becomes `addDocumentListener(DocumentListener, Disposable)` in `WorkspaceFoldersPanel`, which `LanguageServerPanel` disposes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2032 +/- ##
==========================================
- Coverage 49.39% 49.39% -0.01%
==========================================
Files 813 813
Lines 33323 33324 +1
Branches 5191 5191
==========================================
Hits 16461 16461
+ Misses 14290 14288 -2
- Partials 2572 2575 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 20, 2026
lagergren
added a commit
that referenced
this pull request
Nov 21, 2026
…#2035) `DAPLoopbackConnectionTest.withoutAnAddressTheWaitForTheDAPServerSeesItsSocketOnTheIPv6LoopbackAddress` failed in the 2026.3 job of #2032, which doesn't touch DAP: org.opentest4j.AssertionFailedError: expected: <false> but was: <true> at ...DAPLoopbackConnectionTest.java:59 The three tests of the class listen on a port of `::1` that the system picks, and expect nothing on the same port of `127.0.0.1`: a connection there must be refused, and a client without an address must fall through to `::1`. A port that is free on `::1` can be in use on `127.0.0.1` by another program or test, and then the connection is accepted and the test fails. The tests now also bind that port of `127.0.0.1` with a socket that doesn't listen, and take another port when it is in use. While it is bound, nothing else can listen there, so a connection to it is refused. ### Tests Checked on macOS, with another process as the other program: - a program can listen on `127.0.0.1` on the port that the test has on `::1`, and a connection to it is then accepted, which is the failure of the job; - then the reservation can't bind the port (`Address already in use`), and the test takes another one; - once the port is reserved, another program can't listen on it, even with `SO_REUSEADDR`, nor can a `ServerSocket` with `SO_REUSEADDR`, and a connection to it is refused. `DAPLoopbackConnectionTest` passes on a default JVM and on one that prefers IPv6 addresses. Not here: two tests of `SocketStreamConnectionProviderTest` have the same race, `testWithoutAHostItReachesALanguageServerWhichListensOnTheIPv6LoopbackAddressOnly` and `testAnIPv4AddressAsTheHostIsNotTriedOverIPv6`. #2033 and #2034 change that file, so they can follow once those are merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1971.
The plugin verifier reports 50 uses of deprecated IntelliJ APIs against
2026.3. This replaces 14 of them, whose replacement exists in 2024.2,
LSP4IJ's minimum, and isn't deprecated up to 2026.3:
ProcessAdapterbecomesProcessListener, whose methods havedefaults (
ExecTask).InlayHintsProviderFactory.getProvidersInfo(Project)is removed: its default calls
getProvidersInfo(), whichLSPInlayHintProvidersFactoryoverrides.FileChooserDescriptorFactory.createSingleFileDescriptor()becomesnew FileChooserDescriptor(true, true, true, true, false, false),which is what it returns in 2024.2: a file, a folder or a jar.
createSingleFileNoJarsDescriptor()andsingleFile()only takefiles, and a program to debug can be a folder, such as a Go package
(
DebugAdapterServerPanel).new URL(String)becomesURI.create(String).toURL()(
GitHubAssetFetcher,MavenArtifactFetcher). Both URLs are builtfrom a template's owner and repository, or from an encoded query, and
an
IllegalArgumentExceptionlands in the samecatch (Exception).ReadAction.computeandReadAction.runbecomeApplication.runReadAction(LSPPendingHoverDocumentationTarget,LSPLinkedEditingRangeSynchronizer,LSPParameterInfoHandler,DAPValue). The calls that return a value cast their lambda toComputable, since 2026.3 has norunReadAction(ThrowableComputable).DynamicBundle(String)becomesDynamicBundle(Class, String)(
LanguageServerBundle,DAPBundle).Document.addDocumentListener(DocumentListener)becomesaddDocumentListener(DocumentListener, Disposable)inWorkspaceFoldersPanel, whichLanguageServerPaneldisposes.Not here, and left in #1971:
DebugAdapterServerPanel'saddDocumentListener: the owners of the panel (DebugAdapterServerView,DAPSettingsEditor,NewDebugAdapterServerDialog) dispose it with a direct call ofdispose(), not through theDisposer, so it can't be the parent of a listener. (Corrected after the merge: this said that nothing disposes the panel. chore: replace three more deprecated IntelliJ APIs of #1971 #2040 moves the listener toEditorTextField.addDocumentListener.)JarUriConverter'snew URL(uri):URI.createrejects unencoded characters thatnew URLaccepts.JsonTextField'saddDocumentListener, which needs aDisposablepassed in.Tests
LSPLinkedEditingRangeSynchronizerTest,LSPParameterInfoHandlerTest,HoverWithoutWaitingTest,DAPValueSourcePositionTest,WorkspaceFoldersPanelTest,ExecTaskFactoryTestand the inlay hint tests).compileJavapasses against IU 2026.3 too (-PplatformVersion=2026.3 -PplatformType=IU).runReadAction(Computable)andrunReadAction(Runnable), which 2026.3 has (checked withjavap).