Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复一些规范上的错误 #131

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
23 changes: 23 additions & 0 deletions vjkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<junit.version>4.12</junit.version>
<assertj.version>2.6.0</assertj.version>
<mockito.version>2.18.3</mockito.version>
<httpclient.version>4.5.6</httpclient.version>
<okhttp.version>3.11.0</okhttp.version>


<!-- Plugin的属性 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -41,6 +44,26 @@
<version>${commons-lang3.version}</version>
</dependency>

<!-- apache httpclient组件 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/fluent-hc -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>${httpclient.version}</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>


<!-- Log -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* 为什么不用Guava的{@code com.google.common.base.Preconditions} , 一是少打几个字而已, 二是Validate的方法多,比如noNullElements()判断多个元素都不为空
*
* 目前主要参考 {@code com.google.common.math.MathPreconditions} , 补充数字为正数或非负数的校验
*
*
*/
public class MoreValidate extends org.apache.commons.lang3.Validate {
public class Validate extends org.apache.commons.lang3.Validate {

/**
* 校验为正数则返回该数字,否则抛出异常.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,47 @@ public ConcurrentHashSet() {
s = m.keySet();
}

@Override
public void clear() {
m.clear();
}

@Override
public int size() {
return m.size();
}

@Override
public boolean isEmpty() {
return m.isEmpty();
}

@Override
public boolean contains(Object o) {
return m.containsKey(o);
}

@Override
public boolean remove(Object o) {
return m.remove(o) != null;
}

@Override
public boolean add(E e) {
return m.put(e, Boolean.TRUE) == null;
}

@Override
public Iterator<E> iterator() {
return s.iterator();
}

@Override
public Object[] toArray() {
return s.toArray();
}

@Override
public <T> T[] toArray(T[] a) {
return s.toArray(a);
}
Expand All @@ -68,22 +77,27 @@ public String toString() {
return s.toString();
}

@Override
public int hashCode() {
return s.hashCode();
}

@Override
public boolean equals(Object o) {
return o == this || s.equals(o);
}

@Override
public boolean containsAll(Collection<?> c) {
return s.containsAll(c);
}

@Override
public boolean removeAll(Collection<?> c) {
return s.removeAll(c);
}

@Override
public boolean retainAll(Collection<?> c) {
return s.retainAll(c);
}
Expand Down
Loading