Skip to content

Commit 294c93e

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
Formatted with Google Java Formatter
1 parent b8c8ef4 commit 294c93e

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class ObjectOutputInputStreamExample {
4-
}
3+
public class ObjectOutputInputStreamExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class RandomAccessFileExample {
4-
}
3+
public class RandomAccessFileExample {}

src/test/java/com/examplehub/basics/io/ObjectOutputInputStreamExampleTest.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.*;
66
import java.nio.file.Files;
77
import java.nio.file.Paths;
8+
import org.junit.jupiter.api.Test;
89

9-
import static org.junit.jupiter.api.Assertions.*;
10-
11-
class User implements Serializable{
12-
//@Serial TODO
10+
class User implements Serializable {
11+
// @Serial TODO
1312
private static final long serialVersionUID = 100L;
1413
private final String username;
1514
private final String password;
@@ -23,13 +22,19 @@ public User(String username, String password, int age) {
2322

2423
@Override
2524
public String toString() {
26-
return "User{" +
27-
"username='" + username + '\'' +
28-
", password='" + password + '\'' +
29-
", age=" + age +
30-
'}';
25+
return "User{"
26+
+ "username='"
27+
+ username
28+
+ '\''
29+
+ ", password='"
30+
+ password
31+
+ '\''
32+
+ ", age="
33+
+ age
34+
+ '}';
3135
}
3236
}
37+
3338
class ObjectOutputInputStreamExampleTest {
3439
@Test
3540
void testWriteRead() throws IOException, ClassNotFoundException {
@@ -45,4 +50,4 @@ void testWriteRead() throws IOException, ClassNotFoundException {
4550
}
4651
assertTrue(Files.deleteIfExists(Paths.get(filename)));
4752
}
48-
}
53+
}

src/test/java/com/examplehub/basics/io/RandomAccessFileExampleTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.FileOutputStream;
66
import java.io.IOException;
@@ -9,14 +9,13 @@
99
import java.nio.charset.StandardCharsets;
1010
import java.nio.file.Files;
1111
import java.nio.file.Paths;
12-
13-
import static org.junit.jupiter.api.Assertions.*;
12+
import org.junit.jupiter.api.Test;
1413

1514
class RandomAccessFileExampleTest {
1615
@Test
1716
void testSeek() throws IOException {
1817
String filename = "example.txt";
19-
try(PrintStream printStream = new PrintStream(new FileOutputStream(filename));
18+
try (PrintStream printStream = new PrintStream(new FileOutputStream(filename));
2019
RandomAccessFile randomAccessFile = new RandomAccessFile(filename, "rw")) {
2120
printStream.write("Java".getBytes(StandardCharsets.UTF_8));
2221
printStream.flush();
@@ -30,4 +29,4 @@ void testSeek() throws IOException {
3029
}
3130
assertTrue(Files.deleteIfExists(Paths.get(filename)));
3231
}
33-
}
32+
}

0 commit comments

Comments
 (0)