[ISSUE ##7131] replaced with lambda (#7136)

* can be replaced with lambda

* can be replaced with <>
This commit is contained in:
李晓双 Li Xiao Shuang 2021-10-28 10:14:08 +08:00 committed by GitHub
parent 70f7c5674e
commit 72bbd24c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,9 +284,7 @@ public class CacheData {
name, dataId, group, md5, listener);
return;
}
Runnable job = new Runnable() {
@Override
public void run() {
Runnable job = () -> {
long start = System.currentTimeMillis();
ClassLoader myClassLoader = Thread.currentThread().getContextClassLoader();
ClassLoader appClassLoader = listener.getClass().getClassLoader();
@ -332,7 +330,6 @@ public class CacheData {
listenerWrap.inNotifying = false;
Thread.currentThread().setContextClassLoader(myClassLoader);
}
}
};
final long startNotify = System.currentTimeMillis();
@ -396,7 +393,7 @@ public class CacheData {
this.dataId = dataId;
this.group = group;
this.tenant = TenantUtil.getUserTenantForAcm();
listeners = new CopyOnWriteArrayList<ManagerListenerWrap>();
listeners = new CopyOnWriteArrayList<>();
this.isInitializing = true;
this.content = loadCacheContentFromDiskLocal(name, dataId, group, tenant);
this.md5 = getMd5String(content);
@ -413,7 +410,7 @@ public class CacheData {
this.dataId = dataId;
this.group = group;
this.tenant = tenant;
listeners = new CopyOnWriteArrayList<ManagerListenerWrap>();
listeners = new CopyOnWriteArrayList<>();
this.isInitializing = true;
this.content = loadCacheContentFromDiskLocal(name, dataId, group, tenant);
this.md5 = getMd5String(content);