格式化相关代码

This commit is contained in:
lisang 2024-06-27 21:10:38 +08:00
parent 3661cfa8e7
commit 7d80883b4a
11 changed files with 115 additions and 133 deletions

53
pom.xml
View File

@ -1,35 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc</artifactId> <artifactId>rpc</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.0</version> <version>1.0</version>
<modules> <modules>
<module>rpc-api</module> <module>rpc-api</module>
<module>rpc-server</module> <module>rpc-server</module>
<module>rpc-client</module> <module>rpc-client</module>
</modules> </modules>
<name>rpc</name> <name>rpc</name>
<!-- FIXME change it to the project's website --> <url>https://answer.prisoncode.com/</url>
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -1,29 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc-api</artifactId> <artifactId>rpc-api</artifactId>
<version>1.0</version> <version>1.0</version>
<name>rpc-api</name> <name>rpc-api</name>
<!-- FIXME change it to the project's website --> <url>https://answer.prisoncode.com/</url>
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -2,12 +2,9 @@ package com.shockkid;
/** /**
* Hello world! * Hello world!
*
*/ */
public class App public class App {
{ public static void main(String[] args) {
public static void main( String[] args ) System.out.println("Hello World!");
{
System.out.println( "Hello World!" );
} }
} }

View File

@ -7,14 +7,12 @@ import org.junit.Test;
/** /**
* Unit test for simple App. * Unit test for simple App.
*/ */
public class AppTest public class AppTest {
{
/** /**
* Rigorous Test :-) * Rigorous Test :-)
*/ */
@Test @Test
public void shouldAnswerWithTrue() public void shouldAnswerWithTrue() {
{ assertTrue(true);
assertTrue( true );
} }
} }

View File

@ -1,34 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc-client</artifactId> <artifactId>rpc-client</artifactId>
<version>1.0</version> <version>1.0</version>
<name>rpc-client</name> <name>rpc-client</name>
<!-- FIXME change it to the project's website --> <url>https://answer.prisoncode.com/</url>
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc-api</artifactId> <artifactId>rpc-api</artifactId>
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -7,14 +7,12 @@ import org.junit.Test;
/** /**
* Unit test for simple App. * Unit test for simple App.
*/ */
public class AppTest public class AppTest {
{
/** /**
* Rigorous Test :-) * Rigorous Test :-)
*/ */
@Test @Test
public void shouldAnswerWithTrue() public void shouldAnswerWithTrue() {
{ assertTrue(true);
assertTrue( true );
} }
} }

View File

@ -1,34 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc-server</artifactId> <artifactId>rpc-server</artifactId>
<version>1.0</version> <version>1.0</version>
<name>rpc-server</name> <name>rpc-server</name>
<!-- FIXME change it to the project's website --> <url>https://answer.prisoncode.com/</url>
<url>http://www.example.com</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.shockkid</groupId> <groupId>com.shockkid</groupId>
<artifactId>rpc-api</artifactId> <artifactId>rpc-api</artifactId>
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -13,7 +13,7 @@ import java.util.concurrent.Executors;
public class RpcProxyServer { public class RpcProxyServer {
private ExecutorService executorService = Executors.newCachedThreadPool(); private ExecutorService executorService = Executors.newCachedThreadPool();
public void publisher(Object server,int prot) { public void publisher(Object server, int prot) {
ServerSocket serverSocket = null; ServerSocket serverSocket = null;
try { try {
serverSocket = new ServerSocket(prot); serverSocket = new ServerSocket(prot);

View File

@ -7,14 +7,12 @@ import org.junit.Test;
/** /**
* Unit test for simple App. * Unit test for simple App.
*/ */
public class AppTest public class AppTest {
{
/** /**
* Rigorous Test :-) * Rigorous Test :-)
*/ */
@Test @Test
public void shouldAnswerWithTrue() public void shouldAnswerWithTrue() {
{ assertTrue(true);
assertTrue( true );
} }
} }

View File

@ -2,12 +2,9 @@ package com.shockkid;
/** /**
* Hello world! * Hello world!
*
*/ */
public class App public class App {
{ public static void main(String[] args) {
public static void main( String[] args ) System.out.println("Hello World!");
{
System.out.println( "Hello World!" );
} }
} }

View File

@ -7,14 +7,12 @@ import org.junit.Test;
/** /**
* Unit test for simple App. * Unit test for simple App.
*/ */
public class AppTest public class AppTest {
{
/** /**
* Rigorous Test :-) * Rigorous Test :-)
*/ */
@Test @Test
public void shouldAnswerWithTrue() public void shouldAnswerWithTrue() {
{ assertTrue(true);
assertTrue( true );
} }
} }