Skip to content

Commit

Permalink
Supply a Preconditions in common location
Browse files Browse the repository at this point in the history
This is a follow-up to #798, which handles `Preconditions` similarly to
`ToStringBuilder`.

See #742 for detailed discussion.
  • Loading branch information
pisv committed Feb 13, 2024
1 parent 8266805 commit dbc2a66
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 41 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Breaking API changes:
* The name field in WorkspaceFolder is no longer optional according to the specification.
* See [#741](https://github.com/eclipse-lsp4j/lsp4j/issues/741) for detailed discussion.
* The LSP4J generator when applied to `@JsonRpcData` annotated classes generates a dependency on package `org.eclipse.lsp4j.jsonrpc.util` in the `org.eclipse.lsp4j.jsonrpc` bundle.
* This removes the implied requirement in LSP4J 0.21.0 that there is a class called `ToStringBuilder` in a sub-package called `util`.
* This removes the implied requirement in LSP4J 0.21.0 that there are classes called `ToStringBuilder` and `Preconditions` in a sub-package called `util`;
instead, the generator now uses classes `ToStringBuilder` and `Preconditions` in package `org.eclipse.lsp4j.jsonrpc.util`.
* Duplicate classes `ToStringBuilder` and `Preconditions` have been removed from `org.eclipse.lsp4j.util` and `org.eclipse.lsp4j.debug.util` packages.
* See [#742](https://github.com/eclipse-lsp4j/lsp4j/issues/742) for detailed discussion.

Nightly japicmp report: <https://download.eclipse.org/lsp4j/builds/main/japicmp-report/>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,7 @@ class JsonRpcDataProcessor extends AbstractClassProcessor {
}

private def getPreconditionsUtil(Type type, extension TransformationContext context) {
if (type.qualifiedName.startsWith('org.eclipse.lsp4j.debug'))
newTypeReference('org.eclipse.lsp4j.debug.util.Preconditions')
else
newTypeReference('org.eclipse.lsp4j.util.Preconditions')
newTypeReference('org.eclipse.lsp4j.jsonrpc.util.Preconditions')
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
******************************************************************************/
package org.eclipse.lsp4j.util;
package org.eclipse.lsp4j.jsonrpc.util;

/**
* Utilities for checking method and constructor arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import org.eclipse.lsp4j.jsonrpc.messages.Either
import org.eclipse.lsp4j.jsonrpc.messages.Either3
import org.eclipse.lsp4j.jsonrpc.messages.ResponseErrorCode
import org.eclipse.lsp4j.jsonrpc.messages.Tuple
import org.eclipse.lsp4j.jsonrpc.util.Preconditions
import org.eclipse.lsp4j.jsonrpc.validation.NonNull
import org.eclipse.lsp4j.util.Preconditions

@JsonRpcData
class DynamicRegistrationCapabilities {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Queue;

import org.eclipse.lsp4j.DocumentSymbol;
import org.eclipse.lsp4j.jsonrpc.util.Preconditions;

/**
* Utilities for {@link DocumentSymbol document symbols}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package org.eclipse.lsp4j.util;

import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.jsonrpc.util.Preconditions;

/**
* Utilities for the {@link Position}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import org.eclipse.lsp4j.Position;
import org.eclipse.lsp4j.Range;
import org.eclipse.lsp4j.jsonrpc.util.Preconditions;

/**
* Utility class for {@link Range}.
Expand Down

0 comments on commit dbc2a66

Please sign in to comment.