Skip to content

Remove "throws IOExcpetion" from methods that do not need to throw it #934

@jonahgraham

Description

@jonahgraham

As part of the API cleanup for 1.0.0, there are some methods that don't throw IOExceptions despite declaring they do. Originally we were planning on simply hiding the warnings to leave API as is, but this discussion lead to this new issue: #932 (comment)

These are the cases under consideratin:

  • org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.createLeft(L)
  • org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.createRight(R)
  • org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(InputStream, Headers)
  • org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.EitherTypeArgument.read(JsonElement)
  • and the subclasses that override those methods

Note that LSP4J tries to avoid exceptions bubbling up, and prefers to log errors at message boundaries (such as done in StreamMessageProducer.handleMessage). Otherwise all the processing on reading/writing stops due to a single message error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions