Skip to content

Commit a65b9dd

Browse files
committed
[java] Stop using features introduced in Java 9+
1 parent c2745b9 commit a65b9dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/client/src/org/openqa/selenium/devtools/CdpClientGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static void main(String[] args) throws IOException {
6767
Model model = new Model("org.openqa.selenium.devtools");
6868
Stream.of("browser_protocol.json", "js_protocol.json").forEach(protoFile -> {
6969
try {
70-
String text = Files.readString(source.resolve(protoFile));
70+
String text = String.join("\n", Files.readAllLines(source.resolve(protoFile)));
7171
Map<String, Object> json = new Json().toType(text, Json.MAP_TYPE);
7272
model.parse(json);
7373
} catch (IOException e) {
@@ -307,7 +307,7 @@ private void dumpMainClass(Path target) {
307307
ensureFileDoesNotExists(commandFile);
308308

309309
try {
310-
Files.writeString(commandFile, unit.toString());
310+
Files.write(commandFile, unit.toString().getBytes());
311311
} catch (IOException e) {
312312
throw new UncheckedIOException(e);
313313
}
@@ -371,7 +371,7 @@ public void dumpTo(Path target) {
371371
ensureFileDoesNotExists(eventFile);
372372

373373
try {
374-
Files.writeString(eventFile, unit.toString());
374+
Files.write(eventFile, unit.toString().getBytes());
375375
} catch (IOException e) {
376376
throw new UncheckedIOException(e);
377377
}
@@ -450,7 +450,7 @@ public void dumpTo(Path target) {
450450
ensureFileDoesNotExists(typeFile);
451451

452452
try {
453-
Files.writeString(typeFile, unit.toString());
453+
Files.write(typeFile, unit.toString().getBytes());
454454
} catch (IOException e) {
455455
throw new UncheckedIOException(e);
456456
}

0 commit comments

Comments
 (0)