aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-ws
diff options
context:
space:
mode:
authorJulien Camus <julien.camus@sonarsource.com>2024-12-17 17:37:43 +0100
committerSteve Marion <steve.marion@sonarsource.com>2024-12-18 11:13:24 +0100
commit108e25bce0062be83ab15c587aecfa1e51ba5cf1 (patch)
tree8102236ce649305a1d270a56cc284d5d12a4c31c /server/sonar-webserver-ws
parent16e6a0469c02298a8b5c478313dd68c93705922e (diff)
downloadsonarqube-108e25bce0062be83ab15c587aecfa1e51ba5cf1.tar.gz
sonarqube-108e25bce0062be83ab15c587aecfa1e51ba5cf1.zip
SONAR-24004 Replace lambda with method reference
Diffstat (limited to 'server/sonar-webserver-ws')
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java2
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/MessageFormattingUtilsTest.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
index 149e2e84d24..1c51990cc48 100644
--- a/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
@@ -192,7 +192,7 @@ public class WebServiceEngine implements LocalConnector, Startable {
}
private static boolean isRequestAbortedByClient(Exception exception) {
- return Throwables.getCausalChain(exception).stream().anyMatch(t -> t instanceof ClientAbortException);
+ return Throwables.getCausalChain(exception).stream().anyMatch(ClientAbortException.class::isInstance);
}
private static boolean isResponseCommitted(Response response) {
diff --git a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/MessageFormattingUtilsTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/MessageFormattingUtilsTest.java
index 250cd849bd5..d943cca692b 100644
--- a/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/MessageFormattingUtilsTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/MessageFormattingUtilsTest.java
@@ -36,6 +36,7 @@ public class MessageFormattingUtilsTest {
public void nullFormattingListShouldBeEmptyList() {
assertThat(MessageFormattingUtils.dbMessageFormattingListToWs(null)).isEmpty();
}
+
@Test
public void singleEntryShouldBeIdentical() {
DbIssues.MessageFormattings formattings = DbIssues.MessageFormattings.newBuilder()
@@ -48,7 +49,7 @@ public class MessageFormattingUtilsTest {
assertThat(MessageFormattingUtils.dbMessageFormattingToWs(
formattings).get(0))
- .extracting(e -> e.getStart(), e -> e.getEnd(), e -> e.getType())
+ .extracting(Common.MessageFormatting::getStart, Common.MessageFormatting::getEnd, Common.MessageFormatting::getType)
.containsExactly(0, 4, Common.MessageFormattingType.CODE);
}