Skip to content

Commit

Permalink
Formatted code using google code style for java
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Oct 8, 2024
1 parent 19a6131 commit 0f759bf
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 375 deletions.
13 changes: 13 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
-XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom
2 changes: 1 addition & 1 deletion apt-test-generator/src/main/resources/stub.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package {{client.jpackage}};

import java.util.concurrent.atomic.AtomicInteger;
import feign.Experimental;
import java.util.concurrent.atomic.AtomicInteger;

public class {{client.className}}Stub
implements {{client.fullQualifiedName}} {
Expand Down
64 changes: 24 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
<mockito.version>5.14.1</mockito.version>
<fastjson2.version>2.0.53</fastjson2.version>

<git-code-format-maven-plugin.version>5.3</git-code-format-maven-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-install-plugin.version>3.1.3</maven-install-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
Expand Down Expand Up @@ -704,23 +705,33 @@
</executions>
</plugin>
<plugin>
<groupId>com.marvinformatics.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<lineEnding>LF</lineEnding>
<configFile>${main.basedir}/src/config/eclipse-java-style.xml</configFile>
<excludes>
<exclude>travis/**</exclude>
<exclude>**/SAXDecoderTest.java</exclude>
</excludes>
</configuration>
<groupId>com.cosium.code</groupId>
<artifactId>git-code-format-maven-plugin</artifactId>
<version>${git-code-format-maven-plugin.version}</version>
<dependencies>
<!-- Enable https://github.com/google/google-java-format -->
<dependency>
<groupId>com.cosium.code</groupId>
<artifactId>google-java-format</artifactId>
<version>${git-code-format-maven-plugin.version}</version>
</dependency>
</dependencies>
<executions>
<!-- On commit, format the modified files -->
<execution>
<id>install-formatter-hook</id>
<goals>
<goal>format</goal>
<goal>install-hooks</goal>
</goals>
<inherited>false</inherited>
</execution>
<!-- On Maven verify phase, fail if any file (including unmodified) is
badly formatted -->
<execution>
<id>validate-code-format</id>
<goals>
<goal>validate-code-format</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -882,33 +893,6 @@
</properties>
</profile>

<profile>
<id>validateCodeFormat</id>

<build>
<plugins>
<plugin>
<groupId>com.marvinformatics.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<lineEnding>LF</lineEnding>
<configFile>${main.basedir}/src/config/eclipse-java-style.xml</configFile>
</configuration>
<executions>
<execution>
<id>validate-only</id>
<goals>
<goal>validate</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<build>
Expand Down
2 changes: 1 addition & 1 deletion soap-jakarta/src/test/java/feign/soap/SOAPCodecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void changeSoapProtocolAndSetHeader() {
+ (System.getProperty("java.version").startsWith("1.8")
? "<wss:Security xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">"
: "<wss:Security xmlns=\"http://schemas.xmlsoap.org/ws/2002/12/secext\""
+ " xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">")
+ " xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">")
+ "<wss:UsernameToken>"
+ "<wss:Username>test</wss:Username>"
+ "<wss:Password>test</wss:Password>"
Expand Down
2 changes: 1 addition & 1 deletion soap/src/test/java/feign/soap/SOAPCodecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void changeSoapProtocolAndSetHeader() {
+ (System.getProperty("java.version").startsWith("1.8")
? "<wss:Security xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">"
: "<wss:Security xmlns=\"http://schemas.xmlsoap.org/ws/2002/12/secext\""
+ " xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">")
+ " xmlns:wss=\"http://schemas.xmlsoap.org/ws/2002/12/secext\">")
+ "<wss:UsernameToken>"
+ "<wss:Username>test</wss:Username>"
+ "<wss:Password>test</wss:Password>"
Expand Down
Loading

0 comments on commit 0f759bf

Please sign in to comment.