Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Breaking API changes:
* Type of `Diagnostic.message` changed from `String` to `Either<String, MarkupContent>`
* Type of `DocumentFilter.pattern` changed from `String` to `Either<String, RelativePattern>`
* Type of `NotebookDocumentFilter.pattern` changed from `String` to `Either<String, RelativePattern>`
* Removed `throws IOException` from methods that do not need to throw it [#934](https://github.com/eclipse-lsp4j/lsp4j/issues/934)
* `EitherTypeAdapter.createLeft`
* `EitherTypeAdapter.createRight`
* `EitherTypeAdapter.EitherTypeArgument.read(JsonElement)`
* `StreamMessageProducer.handleMessage`

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class StreamMessageConsumerBenchmark {
private StreamMessageConsumer consumer;
private RequestMessage message;

@SuppressWarnings("resource")
@Setup
public void setup() {
consumer = new StreamMessageConsumer(OutputStream.nullOutputStream(), new MessageJsonHandler(emptyMap()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected void parseHeader(String line, Headers headers) {
*
* @return {@code true} if we should continue reading from the input stream, {@code false} if we should stop
*/
protected boolean handleMessage(InputStream input, Headers headers) throws IOException {
protected boolean handleMessage(InputStream input, Headers headers) {
if (callback == null)
callback = message -> LOG.log(Level.INFO, "Received message: " + message);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ protected Either<L, R> create(JsonToken nextToken, JsonReader in) throws IOExcep
}

@SuppressWarnings("unchecked")
protected Either<L, R> createLeft(L obj) throws IOException {
protected Either<L, R> createLeft(L obj) {
if (Either3.class.isAssignableFrom(typeToken.getRawType()))
return (Either<L, R>) Either3.forLeft3(obj);
return Either.forLeft(obj);
}

@SuppressWarnings("unchecked")
protected Either<L, R> createRight(R obj) throws IOException {
protected Either<L, R> createRight(R obj) {
if (Either3.class.isAssignableFrom(typeToken.getRawType()))
return (Either<L, R>) Either3.forRight3((Either<?, ?>) obj);
return Either.forRight(obj);
Expand Down Expand Up @@ -275,7 +275,7 @@ public T read(JsonReader in) throws IOException {
return this.adapter.read(in);
}

public T read(JsonElement element) throws IOException {
public T read(JsonElement element) {
return this.adapter.fromJsonTree(element);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
******************************************************************************/
package org.eclipse.lsp4j.adapters;

import java.io.IOException;

import org.eclipse.lsp4j.DocumentDiagnosticReport;
import org.eclipse.lsp4j.RelatedFullDocumentDiagnosticReport;
import org.eclipse.lsp4j.RelatedUnchangedDocumentDiagnosticReport;
Expand All @@ -37,13 +35,12 @@ public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
gson, ELEMENT_TYPE, leftChecker, rightChecker) {

@Override
protected DocumentDiagnosticReport createLeft(RelatedFullDocumentDiagnosticReport obj) throws IOException {
protected DocumentDiagnosticReport createLeft(RelatedFullDocumentDiagnosticReport obj) {
return new DocumentDiagnosticReport(obj);
}

@Override
protected DocumentDiagnosticReport createRight(RelatedUnchangedDocumentDiagnosticReport obj)
throws IOException {
protected DocumentDiagnosticReport createRight(RelatedUnchangedDocumentDiagnosticReport obj) {
return new DocumentDiagnosticReport(obj);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
******************************************************************************/
package org.eclipse.lsp4j.adapters;

import java.io.IOException;
import java.util.ArrayList;

import org.eclipse.lsp4j.WorkspaceDocumentDiagnosticReport;
Expand All @@ -37,12 +36,12 @@ public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
final var rightChecker = new PropertyChecker("kind", "unchanged");
final var elementTypeAdapter = new EitherTypeAdapter<>(gson, ELEMENT_TYPE, leftChecker, rightChecker) {
@Override
protected WorkspaceDocumentDiagnosticReport createLeft(WorkspaceFullDocumentDiagnosticReport obj) throws IOException {
protected WorkspaceDocumentDiagnosticReport createLeft(WorkspaceFullDocumentDiagnosticReport obj) {
return new WorkspaceDocumentDiagnosticReport(obj);
}

@Override
protected WorkspaceDocumentDiagnosticReport createRight(WorkspaceUnchangedDocumentDiagnosticReport obj) throws IOException {
protected WorkspaceDocumentDiagnosticReport createRight(WorkspaceUnchangedDocumentDiagnosticReport obj) {
return new WorkspaceDocumentDiagnosticReport(obj);
}
};
Expand Down
Loading