Skip to content

Commit

Permalink
v6.5.5
Browse files Browse the repository at this point in the history
v6.5.5
  • Loading branch information
839128 committed Aug 2, 2022
2 parents 06419c7 + f804ddb commit 38a567a
Show file tree
Hide file tree
Showing 382 changed files with 4,491 additions and 11,502 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=org.aoju">
<img src="https://img.shields.io/badge/maven--central-v6.5.3-blue.svg?label=Maven%20Central" />
<img src="https://img.shields.io/badge/maven--central-v6.5.5-blue.svg?label=Maven%20Central" />
</a>
<a target="_blank" href="https://travis-ci.org/aoju/bus">
<img src="https://travis-ci.com/aoju/bus.svg?branch=main">
Expand All @@ -15,7 +15,7 @@
<img src="https://img.shields.io/badge/Java-17+-green.svg">
</a>
<a target="_blank" href="https://spring.io/projects/spring-boot">
<img src="https://img.shields.io/badge/Spring Boot-2.6.6-brightgreen.svg">
<img src="https://img.shields.io/badge/Spring Boot-2.7.0-brightgreen.svg">
</a>
<a target="_blank" href="https://www.mysql.com">
<img src="https://img.shields.io/badge/Mysql-8.x-blue.svg">
Expand Down Expand Up @@ -97,7 +97,7 @@ Bus (应用/服务总线) 是一个基础框架、服务套件,它基于Java17
<dependency>
<groupId>org.aoju</groupId>
<artifactId>bus-all</artifactId>
<version>6.5.3</version>
<version>6.5.5</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions bus-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

<groupId>org.aoju</groupId>
<artifactId>bus-all</artifactId>
<version>6.5.3</version>
<version>6.5.5</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<description>Bus All</description>
<description>Bus All In One</description>
<url>https://github.com/aoju/bus</url>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion bus-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-base</artifactId>
<version>6.5.3</version>
<version>6.5.5</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
18 changes: 9 additions & 9 deletions bus-base/src/main/java/org/aoju/bus/base/advice/ErrorAdvice.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
package org.aoju.bus.base.advice;

import org.aoju.bus.base.service.ErrorService;
import org.aoju.bus.core.toolkit.ObjectKit;
import org.aoju.bus.core.toolkit.RuntimeKit;
import org.aoju.bus.logger.Logger;
import org.aoju.bus.spring.SpringBuilder;
Expand All @@ -48,16 +47,17 @@ public class ErrorAdvice {
* @return 如果执行链应该继续执行, 则为:true 否则:false
*/
public boolean handler(Exception ex) {
ErrorService errorService = null;
try {
ErrorService errorService = SpringBuilder.getBean(ErrorService.class);
if (ObjectKit.isNotNull(errorService)) {
errorService.before(ex);
errorService.after(ex);
} else {
Logger.error(RuntimeKit.getStackTrace(ex));
}
errorService = SpringBuilder.getBean(ErrorService.class);
} catch (RuntimeException ignore) {
return false;

}
if (null != errorService) {
errorService.before(ex);
errorService.after(ex);
} else {
Logger.error(RuntimeKit.getStackTrace(ex));
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion bus-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-bom</artifactId>
<version>6.5.3</version>
<version>6.5.5</version>
<packaging>pom</packaging>

<name>${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion bus-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.aoju</groupId>
<artifactId>bus-cache</artifactId>
<version>6.5.3</version>
<version>6.5.5</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
6 changes: 3 additions & 3 deletions bus-cache/src/main/java/org/aoju/bus/cache/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
********************************************************************************/
package org.aoju.bus.cache;

import com.google.common.base.Preconditions;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
Expand All @@ -34,6 +33,7 @@
import org.aoju.bus.cache.magic.AbstractReader;
import org.aoju.bus.cache.magic.MultiCacheReader;
import org.aoju.bus.cache.magic.SingleCacheReader;
import org.aoju.bus.core.lang.Assert;
import org.aoju.bus.core.toolkit.CollKit;

import java.util.Optional;
Expand Down Expand Up @@ -67,8 +67,8 @@ public synchronized static Complex coreInstance(Context config) {
*/
@Override
protected void configure() {
Preconditions.checkArgument(null != config, "config param can not be null.");
Preconditions.checkArgument(CollKit.isNotEmpty(config.getCaches()), "caches param can not be empty.");
Assert.isTrue(null != config, "config param can not be null.");
Assert.isTrue(CollKit.isNotEmpty(config.getCaches()), "caches param can not be empty.");

bind(Context.class).toInstance(config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
********************************************************************************/
package org.aoju.bus.cache.metric;

import com.google.common.collect.Sets;
import org.aoju.bus.cache.CacheX;
import org.aoju.bus.core.toolkit.CollKit;
import org.ehcache.PersistentCacheManager;
import org.ehcache.config.CacheConfiguration;
import org.ehcache.config.ResourcePools;
Expand Down Expand Up @@ -110,7 +110,7 @@ public void write(Map<String, Object> keyValueMap, long expire) {

@Override
public void remove(String... keys) {
ehcache.removeAll(Sets.newHashSet(keys));
ehcache.removeAll(CollKit.newHashSet(keys));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
*/
public abstract class AbstractSerializer implements BaseSerializer {

protected abstract byte[] doSerialize(Object obj) throws Throwable;
protected abstract byte[] doSerialize(Object object) throws Throwable;

protected abstract Object doDeserialize(byte[] bytes) throws Throwable;

@Override
public <T> byte[] serialize(T obj) {
if (null == obj) {
public <T> byte[] serialize(T object) {
if (null == object) {
return null;
}
try {
return doSerialize(obj);
return doSerialize(object);
} catch (Throwable t) {
Logger.error("{} serialize error.", this.getClass().getName(), t);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
public interface BaseSerializer {

<T> byte[] serialize(T obj);
<T> byte[] serialize(T object);

<T> T deserialize(byte[] bytes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public FastJsonSerializer(Class<?> type) {
}

@Override
protected byte[] doSerialize(Object obj) throws Throwable {
String json = JsonKit.toJsonString(obj);
protected byte[] doSerialize(Object object) throws Throwable {
String json = JsonKit.toJsonString(object);
return json.getBytes(Charset.DEFAULT_UTF_8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
public class Hessian2Serializer extends AbstractSerializer {

@Override
protected byte[] doSerialize(Object obj) throws Throwable {
protected byte[] doSerialize(Object object) throws Throwable {
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
Hessian2Output out = new Hessian2Output(os);
out.writeObject(obj);
out.writeObject(object);
os.close();
return os.toByteArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@
public class JdkGzipSerializer extends AbstractSerializer {

@Override
protected byte[] doSerialize(Object obj) throws Throwable {
protected byte[] doSerialize(Object object) throws Throwable {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
GZIPOutputStream gzout = new GZIPOutputStream(bos);
ObjectOutputStream out = new ObjectOutputStream(gzout)) {

out.writeObject(obj);
out.writeObject(object);
return bos.toByteArray();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
*/
public class JdkSerializer extends AbstractSerializer {

private static void serialize(Serializable obj, OutputStream outputStream) {
private static void serialize(Serializable object, OutputStream outputStream) {
if (null == outputStream) {
throw new IllegalArgumentException("The OutputStream must not be null");
} else {
ObjectOutputStream out = null;

try {
out = new ObjectOutputStream(outputStream);
out.writeObject(obj);
out.writeObject(object);
} catch (IOException e) {
throw new InstrumentException(e);
} finally {
Expand Down Expand Up @@ -86,9 +86,9 @@ private static Object deserialize(InputStream inputStream) {
}

@Override
protected byte[] doSerialize(Object obj) {
protected byte[] doSerialize(Object object) {
ByteArrayOutputStream baos = new ByteArrayOutputStream(Normal._512);
serialize((Serializable) obj, baos);
serialize((Serializable) object, baos);
return baos.toByteArray();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public Addable addAll(List<Object> list) {
return this;
}

list.stream().map(obj -> (Map.Entry) obj).forEach(entry -> instance.put(entry.getKey(), entry.getValue()));
list.stream().map(object -> (Map.Entry) object).forEach(entry -> instance.put(entry.getKey(), entry.getValue()));

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
********************************************************************************/
package org.aoju.bus.cache.support;

import com.google.common.base.Strings;
import org.aoju.bus.cache.annotation.CacheKey;
import org.aoju.bus.cache.annotation.Cached;
import org.aoju.bus.cache.annotation.CachedGet;
Expand All @@ -35,6 +34,7 @@
import org.aoju.bus.cache.magic.CachePair;
import org.aoju.bus.cache.magic.MethodHolder;
import org.aoju.bus.core.lang.Normal;
import org.aoju.bus.core.toolkit.StringKit;
import org.aoju.bus.logger.Logger;

import java.lang.annotation.Annotation;
Expand Down Expand Up @@ -176,7 +176,7 @@ private static boolean isMulti(CacheKey cacheKey) {
}

String value = cacheKey.value();
if (Strings.isNullOrEmpty(value)) {
if (StringKit.isEmpty(value)) {
return false;
}

Expand All @@ -190,7 +190,7 @@ private static boolean isInvalidParam(Class<?>[] pTypes, AnnoHolder annoHolder)
return (null == pTypes
|| pTypes.length == 0
|| cacheKeyMap.isEmpty())
&& Strings.isNullOrEmpty(prefix);
&& StringKit.isEmpty(prefix);
}

private static boolean isInvalidMultiCount(Map<Integer, CacheKey> keyMap) {
Expand All @@ -210,16 +210,16 @@ private static boolean isInvalidMultiCount(Map<Integer, CacheKey> keyMap) {
private static boolean isInvalidIdentifier(boolean isMapReturn,
boolean isCollectionReturn,
String field) {
if (isMapReturn && !Strings.isNullOrEmpty(field)) {
if (isMapReturn && !StringKit.isEmpty(field)) {
Logger.warn("@CacheKey's 'field = \"{}\"' is useless.", field);
return false;
}

return !Strings.isNullOrEmpty(field) && !isCollectionReturn;
return !StringKit.isEmpty(field) && !isCollectionReturn;
}

private static boolean isInvalidResult(boolean isCollectionReturn, String id) {
return isCollectionReturn && Strings.isNullOrEmpty(id);
return isCollectionReturn && StringKit.isEmpty(id);
}

private static boolean isInvalidMulti(Class<?> paramType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
********************************************************************************/
package org.aoju.bus.cache.support;

import com.google.common.base.Strings;
import org.aoju.bus.cache.Context;
import org.aoju.bus.core.toolkit.StringKit;

import java.util.Collection;
import java.util.HashMap;
Expand All @@ -46,7 +46,7 @@ public static Map<String, Object> mapToKeyValue(Map proceedEntryValueMap,
Map<String, Object> keyValueMap = new HashMap<>(proceedEntryValueMap.size());
proceedEntryValueMap.forEach((multiArgEntry, value) -> {
String key = multiEntry2Key.get(multiArgEntry);
if (Strings.isNullOrEmpty(key)) {
if (StringKit.isEmpty(key)) {
return;
}

Expand All @@ -69,7 +69,7 @@ public static Map<String, Object> collectionToKeyValue(Collection proceedCollect
Object id = SpelCalculator.calcSpelWithNoContext(idSpel, value);
String key = id2Key.get(id);

if (!Strings.isNullOrEmpty(key)) {
if (StringKit.isEmpty(key)) {
missKeys.remove(key);
keyValueMap.put(key, value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
public class PreventObjects {

public static Object getPreventObject() {
return PreventObj.INSTANCE;
return PreventObject.INSTANCE;
}

public static boolean isPrevent(Object object) {
return object == PreventObj.INSTANCE || object instanceof PreventObj;
return object == PreventObject.INSTANCE || object instanceof PreventObject;
}

private static final class PreventObj implements Serializable {
private static final class PreventObject implements Serializable {

private static final long serialVersionUID = 1L;

private static final PreventObj INSTANCE = new PreventObj();
private static final PreventObject INSTANCE = new PreventObject();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
********************************************************************************/
package org.aoju.bus.cache.support;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import org.aoju.bus.core.lang.Assert;
import org.aoju.bus.core.toolkit.StringKit;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
Expand All @@ -43,14 +43,14 @@ public class SpelCalculator {
private static final ExpressionParser parser = new SpelExpressionParser();

public static Object calcSpelValueWithContext(String spel, String[] argNames, Object[] argValues, Object defaultValue) {
if (Strings.isNullOrEmpty(spel)) {
if (StringKit.isEmpty(spel)) {
return defaultValue;
}

// 将[参数名->参数值]导入spel环境
EvaluationContext context = new StandardEvaluationContext();

Preconditions.checkState(argNames.length == argValues.length);
Assert.isTrue(argNames.length == argValues.length);
for (int i = 0; i < argValues.length; ++i) {
context.setVariable(argNames[i], argValues[i]);
}
Expand All @@ -65,7 +65,7 @@ public static Object calcSpelValueWithContext(String spel, String[] argNames, Ob
}

public static Object calcSpelWithNoContext(String spel, Object defaultValue) {
if (Strings.isNullOrEmpty(spel)) {
if (StringKit.isEmpty(spel)) {
return defaultValue;
}

Expand Down
Loading

0 comments on commit 38a567a

Please sign in to comment.