You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Override
public <R extends SLCommandResponseType> R serverSend(
final SLServerName serverName,
final SLCommandType<R> command)
throws SLException
{
final var server =
this.findServer(serverName);
final var r =
this.send(server, server.commandURI(), command);
return switch (r) {
case final SLError e -> throw errorServer(e);
case SLCommandType<?> _,
SLLoginCommandType _,
SLLoginInfo _,
SLLoginResponseType _,
SLTransaction _,
SLTransactionResponse _ -> {
throw errorUnexpectedResponse(r);
}
case final SLCommandResponseType res -> {
final var expectedType = command.responseClass();
if (Objects.equals(res.getClass(), expectedType)) {
yield expectedType.cast(res);
} else {
throw errorUnexpectedResponse(res);
}
}
};
}
It seems that the current Eclipse formatter doesn't understand patterns in cases like that. It seems that no matter what formatter settings I try to use, the method ends up formatted looking like this:
@Override
public <R extends SLCommandResponseType> R serverSend(
final SLServerName serverName,
final SLCommandType<R> command)
throws SLException
{
final var server =
this.findServer(serverName);
final var r =
this.send(server, server.commandURI(), command);
return switch (r) {
case final SLError e -> throw errorServer(e);
case
SLCommandType<?> _,SLLoginCommandType _,SLLoginInfo _,SLLoginResponseType _,SLTransaction _,SLTransactionResponse _ -> {
throw errorUnexpectedResponse(r);
}
case final SLCommandResponseType res -> {
final var expectedType =
command.responseClass();
if (Objects.equals(res.getClass(), expectedType)) {
yield expectedType.cast(res);
} else {
throw errorUnexpectedResponse(res);
}
}
};
}
It will even exceed the 80 column limit to format like this.
I can obviously use @formatter:off, but I don't really want to have to do this around pretty much every switch expression.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I have the following method:
It seems that the current Eclipse formatter doesn't understand patterns in cases like that. It seems that no matter what formatter settings I try to use, the method ends up formatted looking like this:
It will even exceed the 80 column limit to format like this.
I can obviously use
@formatter:off, but I don't really want to have to do this around pretty much every switch expression.Is this a known issue?
All reactions