Skip to content

Commit 8982cf8

Browse files
committed
批量格式化代码
1 parent 5f88773 commit 8982cf8

File tree

223 files changed

+2361
-2729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+2361
-2729
lines changed

build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
allprojects {
1+
allprojects {
22
apply plugin: 'maven'
33

44
group = 'com.github.binarywang'
@@ -19,15 +19,15 @@ subprojects {
1919

2020

2121
dependencies {
22-
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.10'
23-
compile group: 'org.apache.httpcomponents', name: 'httpmime', version:'4.5'
24-
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5'
25-
compile group: 'com.google.code.gson', name: 'gson', version:'2.7'
26-
compile group: 'com.google.guava', name: 'guava', version:'19.0'
27-
compile group: 'commons-codec', name: 'commons-codec', version:'1.10'
28-
compile group: 'commons-io', name: 'commons-io', version:'2.5'
29-
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.4'
30-
compile group: 'redis.clients', name: 'jedis', version:'2.9.0'
31-
testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.2'
22+
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.10'
23+
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5'
24+
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5'
25+
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
26+
compile group: 'com.google.guava', name: 'guava', version: '19.0'
27+
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
28+
compile group: 'commons-io', name: 'commons-io', version: '2.5'
29+
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
30+
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
31+
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.2'
3232
}
3333
}

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0"?>
22
<project
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
5+
xmlns="http://maven.apache.org/POM/4.0.0">
56
<modelVersion>4.0.0</modelVersion>
67
<groupId>com.github.binarywang</groupId>
78
<artifactId>weixin-java-parent</artifactId>

weixin-java-common/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
description = 'WeiXin Java Tools - Common'
32
dependencies {
4-
compile group: 'com.thoughtworks.xstream', name: 'xstream', version:'1.4.7'
5-
testCompile group: 'junit', name: 'junit', version:'4.11'
6-
testCompile group: 'org.testng', name: 'testng', version:'6.8.7'
7-
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
8-
testCompile group: 'com.google.inject', name: 'guice', version:'3.0'
9-
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.RC0'
10-
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.RC0'
3+
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.7'
4+
testCompile group: 'junit', name: 'junit', version: '4.11'
5+
testCompile group: 'org.testng', name: 'testng', version: '6.8.7'
6+
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
7+
testCompile group: 'com.google.inject', name: 'guice', version: '3.0'
8+
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.0.RC0'
9+
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.0.RC0'
1110
}
1211
test.useTestNG()

weixin-java-common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<project
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4-
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.github.binarywang</groupId>

weixin-java-common/src/main/java/me/chanjar/weixin/common/annotation/Required.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
/**
99
* 标识某个字段是否是必填的
10-
*
10+
* <p>
1111
* Created by Binary Wang on 2016/9/25.
12-
* @author binarywang (https://github.com/binarywang)
1312
*
13+
* @author binarywang (https://github.com/binarywang)
1414
*/
1515
@Retention(RetentionPolicy.RUNTIME)
1616
@Target(ElementType.FIELD)
1717
public @interface Required {
1818

19-
}
19+
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/result/WxMediaUploadResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void setThumbMediaId(String thumbMediaId) {
5151
@Override
5252
public String toString() {
5353
return "WxUploadResult [type=" + this.type + ", media_id=" + this.mediaId + ", thumb_media_id=" + this.thumbMediaId
54-
+ ", created_at=" + this.createdAt + "]";
54+
+ ", created_at=" + this.createdAt + "]";
5555
}
5656

5757
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/session/StandardSessionManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class StandardSessionManager implements WxSessionManager, InternalSessionManager {
1515

1616
protected static final StringManager sm =
17-
StringManager.getManager(Constants.Package);
17+
StringManager.getManager(Constants.Package);
1818
/**
1919
* The descriptive name of this Manager implementation (for logging).
2020
*/
@@ -82,7 +82,7 @@ public WxSession getSession(String sessionId) {
8282
public WxSession getSession(String sessionId, boolean create) {
8383
if (sessionId == null) {
8484
throw new IllegalStateException
85-
(sm.getString("sessionManagerImpl.getSession.ise"));
85+
(sm.getString("sessionManagerImpl.getSession.ise"));
8686
}
8787

8888
InternalSession session = findSession(sessionId);
@@ -135,15 +135,15 @@ public InternalSession findSession(String id) {
135135
public InternalSession createSession(String sessionId) {
136136
if (sessionId == null) {
137137
throw new IllegalStateException
138-
(sm.getString("sessionManagerImpl.createSession.ise"));
138+
(sm.getString("sessionManagerImpl.createSession.ise"));
139139
}
140140

141141
if ((this.maxActiveSessions >= 0) &&
142-
(getActiveSessions() >= this.maxActiveSessions)) {
142+
(getActiveSessions() >= this.maxActiveSessions)) {
143143
this.rejectedSessions++;
144144
throw new TooManyActiveSessionsException(
145-
sm.getString("sessionManagerImpl.createSession.tmase"),
146-
this.maxActiveSessions);
145+
sm.getString("sessionManagerImpl.createSession.tmase"),
146+
this.maxActiveSessions);
147147
}
148148

149149
// Recycle or create a Session instance

weixin-java-common/src/main/java/me/chanjar/weixin/common/session/TooManyActiveSessionsException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* reached and the server is refusing to create any new sessions.
2222
*/
2323
public class TooManyActiveSessionsException
24-
extends IllegalStateException {
24+
extends IllegalStateException {
2525
private static final long serialVersionUID = 1L;
2626

2727
/**

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/ToStringUtils.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,10 @@
1313
*/
1414
public class ToStringUtils {
1515
public static final ToStringStyle THE_STYLE = new SimpleMultiLineToStringStyle();
16-
private static class SimpleMultiLineToStringStyle extends ToStringStyle {
17-
private static final long serialVersionUID = 4645306494220335355L;
18-
private static final String LINE_SEPARATOR = "\n";
19-
private static final String NULL_TEXT = "<null>";
20-
21-
public SimpleMultiLineToStringStyle() {
22-
super();
23-
this.setContentStart("[");
24-
this.setFieldSeparator(LINE_SEPARATOR + " ");
25-
this.setFieldSeparatorAtStart(true);
26-
this.setContentEnd(LINE_SEPARATOR + "]");
27-
this.setNullText(NULL_TEXT);
28-
this.setUseShortClassName(true);
29-
this.setUseIdentityHashCode(false);
30-
}
31-
}
3216

3317
/**
3418
* 用于产生去掉空值属性并以换行符分割各属性键值的toString字符串
19+
*
3520
* @param obj
3621
*/
3722
public static String toSimpleString(Object obj) {
@@ -58,4 +43,21 @@ public static String toSimpleString(Object obj) {
5843

5944
return result.deleteCharAt(result.length() - 1).toString();
6045
}
46+
47+
private static class SimpleMultiLineToStringStyle extends ToStringStyle {
48+
private static final long serialVersionUID = 4645306494220335355L;
49+
private static final String LINE_SEPARATOR = "\n";
50+
private static final String NULL_TEXT = "<null>";
51+
52+
public SimpleMultiLineToStringStyle() {
53+
super();
54+
this.setContentStart("[");
55+
this.setFieldSeparator(LINE_SEPARATOR + " ");
56+
this.setFieldSeparatorAtStart(true);
57+
this.setContentEnd(LINE_SEPARATOR + "]");
58+
this.setNullText(NULL_TEXT);
59+
this.setUseShortClassName(true);
60+
this.setUseIdentityHashCode(false);
61+
}
62+
}
6163
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/SHA1.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package me.chanjar.weixin.common.util.crypto;
22

3-
import java.util.Arrays;
4-
53
import org.apache.commons.codec.digest.DigestUtils;
64

5+
import java.util.Arrays;
6+
77
/**
88
* Created by Daniel Qian on 14/10/19.
99
*/

0 commit comments

Comments
 (0)