From 4fb8a9517863877ce6af03ae14e1ba5e42cb5fd1 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 12 Jun 2026 12:56:46 -0700 Subject: [PATCH] chore: trim comments --- .../main/java/com/microsoft/playwright/impl/ChannelOwner.java | 3 +-- .../main/java/com/microsoft/playwright/impl/Connection.java | 4 +--- .../src/main/java/com/microsoft/playwright/impl/Protocol.java | 1 - .../com/microsoft/playwright/impl/ServerErrorWithDetails.java | 3 +-- .../java/com/microsoft/playwright/tools/ApiGenerator.java | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/ChannelOwner.java b/playwright/src/main/java/com/microsoft/playwright/impl/ChannelOwner.java index 8d797322..729c300f 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/ChannelOwner.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/ChannelOwner.java @@ -110,8 +110,7 @@ class ChannelOwner extends LoggingSupport { return connection.sendMessageAsync(guid, method, params); } - // Fire-and-forget: the server intentionally never replies to this message, - // so silently drop it if the object was collected. + // Fire-and-forget: silently drop if the object was collected. void sendMessageNoReply(String method, JsonObject params) { if (wasCollected) { return; diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java b/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java index 369daf68..46354abf 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java @@ -136,7 +136,7 @@ public class Connection { return internalSendMessage(guid, method, params, true, true); } - // Fire-and-forget: the server intentionally never replies to this message. + // Fire-and-forget: the server never replies. public void sendMessageNoReply(String guid, String method, JsonObject params) { internalSendMessage(guid, method, params, false, false); } @@ -269,8 +269,6 @@ public class Connection { } else { exception = new DriverException(message.error.error + callLog); } - // The server attaches errorDetails to errors of the methods that declare them - // in the protocol (currently only Frame.expect and Page.expectScreenshot). if (message.errorDetails != null) { exception = new ServerErrorWithDetails(exception, message.errorDetails, message.log); } diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/Protocol.java b/playwright/src/main/java/com/microsoft/playwright/impl/Protocol.java index 02d93bb2..b7e02eed 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/Protocol.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/Protocol.java @@ -122,7 +122,6 @@ class FrameExpectResult { List log; } -// Sent by the server as `errorDetails` when Frame.expect fails. class FrameExpectErrorDetails { FrameExpectResult.Received received; Boolean timedOut; diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/ServerErrorWithDetails.java b/playwright/src/main/java/com/microsoft/playwright/impl/ServerErrorWithDetails.java index edaa64b7..64bc1917 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/ServerErrorWithDetails.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/ServerErrorWithDetails.java @@ -24,7 +24,6 @@ import com.microsoft.playwright.PlaywrightException; import java.util.ArrayList; import java.util.List; -// Server error with the structured details declared in the protocol for the failed method. class ServerErrorWithDetails extends PlaywrightException { private final JsonObject errorDetails; private final JsonArray log; @@ -35,7 +34,7 @@ class ServerErrorWithDetails extends PlaywrightException { this.log = log; } - // Used to rethrow with the stack trace of the calling thread, see WaitableResult.get(). + // Rethrown with the calling thread's stack trace, see WaitableResult.get(). ServerErrorWithDetails(ServerErrorWithDetails cause) { super(cause.getMessage(), cause); this.errorDetails = cause.errorDetails; diff --git a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java index ad441816..a41df3f8 100644 --- a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java +++ b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java @@ -997,7 +997,7 @@ class Interface extends TypeDefinition { } void writeTo(List output, String offset) { - // Interfaces with a static factory method delegating to the Impl class, see Method.writeTo. + // Interfaces with a static factory method, see Method.writeTo. if (asList("Playwright", "FormData", "RequestOptions").contains(jsonName) && methods.stream().anyMatch(m -> "create".equals(m.jsonName))) { output.add("import com.microsoft.playwright.impl." + jsonName + "Impl;"); }