Repository: alibaba/fescar (java)

Issue:
change version to 0.4.0-SNAPSHOT
- [ ] I have searched the [issues](https://github.com/alibaba/fescar/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description

change version to 0.4.0-SNAPSHOT

### Ⅱ. Describe what happened

  If there is an exception, please attach the exception trace:

```
Just paste your stack trace here!
```


### Ⅲ. Describe what you expected to happen


### Ⅳ. How to reproduce it (as minimally and precisely as possible)

1. xxx
2. xxx
3. xxx

### Ⅴ. Anything else we need to know?


### Ⅵ. Environment:

- JDK version :
- OS :
- Others:

Pull request:
 fix #618 change version to 0.4.0-SNAPSHOT and code optimization
<!-- Please make sure you have read and understood the contributing guidelines -->

### Ⅰ. Describe what this PR did

change version to 0.4.0-SNAPSHOT and code optimization

### Ⅱ. Does this pull request fix one issue?

 fix #618 change version to 0.4.0-SNAPSHOT and code optimization


### Ⅲ. Why don't you add test cases (unit test/integration test)? 


### Ⅳ. Describe how to verify it


### Ⅴ. Special notes for reviews



Patch:
diff --git a/common/pom.xml b/common/pom.xml
index 5dabc7270..ea99b1111 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-common</artifactId>
diff --git a/common/src/main/java/com/alibaba/fescar/common/exception/NotSupportYetException.java b/common/src/main/java/com/alibaba/fescar/common/exception/NotSupportYetException.java
index 402d522ed..3abbacd42 100644
--- a/common/src/main/java/com/alibaba/fescar/common/exception/NotSupportYetException.java
+++ b/common/src/main/java/com/alibaba/fescar/common/exception/NotSupportYetException.java
@@ -18,6 +18,8 @@ package com.alibaba.fescar.common.exception;
 
 /**
  * The type Not support yet exception.
+ *
+ * @author jimin.jm @alibaba-inc.com
  */
 public class NotSupportYetException extends RuntimeException {
 
diff --git a/common/src/main/java/com/alibaba/fescar/common/exception/ShouldNeverHappenException.java b/common/src/main/java/com/alibaba/fescar/common/exception/ShouldNeverHappenException.java
index 6044c8a9f..c6080c4ff 100644
--- a/common/src/main/java/com/alibaba/fescar/common/exception/ShouldNeverHappenException.java
+++ b/common/src/main/java/com/alibaba/fescar/common/exception/ShouldNeverHappenException.java
@@ -18,6 +18,8 @@ package com.alibaba.fescar.common.exception;
 
 /**
  * The type Should never happen exception.
+ *
+ * @author jimin.jm @alibaba-inc.com
  */
 public class ShouldNeverHappenException extends RuntimeException {
 
diff --git a/common/src/main/java/com/alibaba/fescar/common/thread/RejectedPolicies.java b/common/src/main/java/com/alibaba/fescar/common/thread/RejectedPolicies.java
index 32f661642..d1060bfbd 100644
--- a/common/src/main/java/com/alibaba/fescar/common/thread/RejectedPolicies.java
+++ b/common/src/main/java/com/alibaba/fescar/common/thread/RejectedPolicies.java
@@ -23,7 +23,7 @@ import java.util.concurrent.ThreadPoolExecutor;
 /**
  * Policies for RejectedExecutionHandler
  *
- * Created by guoyao on 2019/2/26.
+ * @author guoyao
  */
 public final class RejectedPolicies {
 
diff --git a/common/src/main/java/com/alibaba/fescar/common/util/BlobUtils.java b/common/src/main/java/com/alibaba/fescar/common/util/BlobUtils.java
index a1cc3bd24..9954a14c7 100644
--- a/common/src/main/java/com/alibaba/fescar/common/util/BlobUtils.java
+++ b/common/src/main/java/com/alibaba/fescar/common/util/BlobUtils.java
@@ -26,6 +26,8 @@ import com.alibaba.fescar.common.exception.ShouldNeverHappenException;
 
 /**
  * The type Blob utils.
+ *
+ * @author jimin.jm @alibaba-inc.com
  */
 public class BlobUtils {
 
diff --git a/common/src/main/java/com/alibaba/fescar/common/util/StringUtils.java b/common/src/main/java/com/alibaba/fescar/common/util/StringUtils.java
index f4f20e556..94a771031 100644
--- a/common/src/main/java/com/alibaba/fescar/common/util/StringUtils.java
+++ b/common/src/main/java/com/alibaba/fescar/common/util/StringUtils.java
@@ -26,6 +26,8 @@ import javax.sql.rowset.serial.SerialBlob;
 
 /**
  * The type String utils.
+ *
+ * @author jimin.jm @alibaba-inc.com
  */
 public class StringUtils {
 
diff --git a/config/pom.xml b/config/pom.xml
index f97ca0a36..fbe508635 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-config</artifactId>
diff --git a/config/src/main/java/com/alibaba/fescar/config/ConfigType.java b/config/src/main/java/com/alibaba/fescar/config/ConfigType.java
index fc4728f91..1889a6ad9 100644
--- a/config/src/main/java/com/alibaba/fescar/config/ConfigType.java
+++ b/config/src/main/java/com/alibaba/fescar/config/ConfigType.java
@@ -16,9 +16,6 @@
 
 package com.alibaba.fescar.config;
 
-
-import com.alibaba.fescar.common.exception.NotSupportYetException;
-
 /**
  * The enum Config type.
  *
diff --git a/config/src/main/java/com/alibaba/fescar/config/ConfigurationFactory.java b/config/src/main/java/com/alibaba/fescar/config/ConfigurationFactory.java
index bc5ec4ba1..3e2742b7e 100644
--- a/config/src/main/java/com/alibaba/fescar/config/ConfigurationFactory.java
+++ b/config/src/main/java/com/alibaba/fescar/config/ConfigurationFactory.java
@@ -79,7 +79,7 @@ public final class ConfigurationFactory {
                 break;
             case ZK:
                 try {
-                    configuration = new ZKConfiguration();
+                    configuration = new ZookeeperConfiguration();
                 } catch (Exception e) {
                     throw new RuntimeException(e);
                 }
diff --git a/config/src/main/java/com/alibaba/fescar/config/FileConfiguration.java b/config/src/main/java/com/alibaba/fescar/config/FileConfiguration.java
index 6a347c4f0..51e4291c5 100644
--- a/config/src/main/java/com/alibaba/fescar/config/FileConfiguration.java
+++ b/config/src/main/java/com/alibaba/fescar/config/FileConfiguration.java
@@ -60,9 +60,9 @@ public class FileConfiguration extends AbstractConfiguration<ConfigChangeListene
 
     private static final String REGISTRY_TYPE = "file";
 
-    private final ConcurrentMap<String, List<ConfigChangeListener>> configListenersMap = new ConcurrentHashMap<>();
+    private final ConcurrentMap<String, List<ConfigChangeListener>> configListenersMap = new ConcurrentHashMap<>(8);
 
-    private final ConcurrentMap<String, String> listenedConfigMap = new ConcurrentHashMap<>();
+    private final ConcurrentMap<String, String> listenedConfigMap = new ConcurrentHashMap<>(8);
 
     /**
      * Instantiates a new File configuration.
@@ -242,8 +242,8 @@ public class FileConfiguration extends AbstractConfiguration<ConfigChangeListene
                 try {
                     Map<String, List<ConfigChangeListener>> configListenerMap;
                     if (null != dataId && null != listener) {
-                        configListenerMap = new ConcurrentHashMap<>();
-                        configListenerMap.put(dataId, new ArrayList<ConfigChangeListener>());
+                        configListenerMap = new ConcurrentHashMap<>(8);
+                        configListenerMap.put(dataId, new ArrayList<>());
                         configListenerMap.get(dataId).add(listener);
                     } else {
                         configListenerMap = configListenersMap;
diff --git a/config/src/main/java/com/alibaba/fescar/config/ZKConfiguration.java b/config/src/main/java/com/alibaba/fescar/config/ZookeeperConfiguration.java
similarity index 97%
rename from config/src/main/java/com/alibaba/fescar/config/ZKConfiguration.java
rename to config/src/main/java/com/alibaba/fescar/config/ZookeeperConfiguration.java
index 51daf4ad0..36dfcff20 100644
--- a/config/src/main/java/com/alibaba/fescar/config/ZKConfiguration.java
+++ b/config/src/main/java/com/alibaba/fescar/config/ZookeeperConfiguration.java
@@ -40,8 +40,8 @@ import static com.alibaba.fescar.config.ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
  * @author crazier.huang
  * @date 2019/2/18
  */
-public class ZKConfiguration extends AbstractConfiguration<IZkDataListener> {
-    private final static Logger LOGGER = LoggerFactory.getLogger(ZKConfiguration.class);
+public class ZookeeperConfiguration extends AbstractConfiguration<IZkDataListener> {
+    private final static Logger LOGGER = LoggerFactory.getLogger(ZookeeperConfiguration.class);
 
     private static final String REGISTRY_TYPE = "zk";
     private static final String ZK_PATH_SPLIT_CHAR = "/";
@@ -59,7 +59,7 @@ public class ZKConfiguration extends AbstractConfiguration<IZkDataListener> {
         new NamedThreadFactory("ZKConfigThread", THREAD_POOL_NUM));
     private static volatile ZkClient zkClient;
 
-    public ZKConfiguration() {
+    public ZookeeperConfiguration() {
         if (zkClient == null) {
             zkClient = new ZkClient(FILE_CONFIG.getConfig(FILE_CONFIG_KEY_PREFIX + SERVER_ADDR_KEY),
                 FILE_CONFIG.getInt(FILE_CONFIG_KEY_PREFIX + SESSION_TIME_OUT_KEY),
diff --git a/core/pom.xml b/core/pom.xml
index c398d3312..7df21360f 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-core</artifactId>
diff --git a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
index 01b54bf4b..2bfc4c7d1 100644
--- a/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
+++ b/core/src/main/java/com/alibaba/fescar/core/protocol/Version.java
@@ -25,13 +25,15 @@ import io.netty.channel.Channel;
 
 /**
  * The type Version.
+ *
+ * @author jimin.jm @alibaba-inc.com
  */
 public class Version {
 
     /**
      * The constant CURRENT.
      */
-    public static final String CURRENT = "0.3.1";
+    public static final String CURRENT = "0.4.0";
 
     /**
      * The constant VERSION_MAP.
diff --git a/discovery/pom.xml b/discovery/pom.xml
index 0c04563f1..407064bfe 100644
--- a/discovery/pom.xml
+++ b/discovery/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <packaging>jar</packaging>
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
index 03bd988dd..1372a3878 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/RegistryFactory.java
@@ -62,7 +62,7 @@ public class RegistryFactory {
                 registryService = FileRegistryServiceImpl.getInstance();
                 break;
             case ZK:
-                registryService = ZKRegisterServiceImpl.getInstance();
+                registryService = ZookeeperRegisterServiceImpl.getInstance();
                 break;
             default:
                 throw new NotSupportYetException("not support register type:" + registryType);
diff --git a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZKRegisterServiceImpl.java b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZookeeperRegisterServiceImpl.java
similarity index 94%
rename from discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZKRegisterServiceImpl.java
rename to discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZookeeperRegisterServiceImpl.java
index 2c47c5559..eb93e4d7b 100644
--- a/discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZKRegisterServiceImpl.java
+++ b/discovery/src/main/java/com/alibaba/fescar/discovery/registry/ZookeeperRegisterServiceImpl.java
@@ -16,6 +16,12 @@
 
 package com.alibaba.fescar.discovery.registry;
 
+import java.net.InetSocketAddress;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
 import com.alibaba.fescar.common.util.NetUtil;
 import com.alibaba.fescar.config.Configuration;
 import com.alibaba.fescar.config.ConfigurationFactory;
@@ -26,12 +32,6 @@ import org.I0Itec.zkclient.ZkClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.net.InetSocketAddress;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
 import static com.alibaba.fescar.common.Constants.IP_PORT_SPLIT_CHAR;
 
 /**
@@ -40,10 +40,10 @@ import static com.alibaba.fescar.common.Constants.IP_PORT_SPLIT_CHAR;
  * @author crazier.huang
  * @date 2019/2/15
  */
-public class ZKRegisterServiceImpl implements RegistryService<IZkChildListener> {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ZKRegisterServiceImpl.class);
+public class ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperRegisterServiceImpl.class);
 
-    private static volatile ZKRegisterServiceImpl instance;
+    private static volatile ZookeeperRegisterServiceImpl instance;
     private static volatile ZkClient zkClient;
     private static final Configuration FILE_CONFIG = ConfigurationFactory.FILE_INSTANCE;
     private static final String ZK_PATH_SPLIT_CHAR = "/";
@@ -63,13 +63,13 @@ public class ZKRegisterServiceImpl implements RegistryService<IZkChildListener>
     private static final ConcurrentMap<String, List<InetSocketAddress>> CLUSTER_ADDRESS_MAP = new ConcurrentHashMap<>();
     private static final ConcurrentMap<String, List<IZkChildListener>> LISTENER_SERVICE_MAP = new ConcurrentHashMap<>();
 
-    private ZKRegisterServiceImpl() {}
+    private ZookeeperRegisterServiceImpl() {}
 
-    public static ZKRegisterServiceImpl getInstance() {
+    public static ZookeeperRegisterServiceImpl getInstance() {
         if (null == instance) {
-            synchronized (ZKRegisterServiceImpl.class) {
+            synchronized (ZookeeperRegisterServiceImpl.class) {
                 if (null == instance) {
-                    instance = new ZKRegisterServiceImpl();
+                    instance = new ZookeeperRegisterServiceImpl();
                 }
             }
         }
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 059d5bbc1..81871b68b 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-distribution</artifactId>
diff --git a/dubbo-alibaba/pom.xml b/dubbo-alibaba/pom.xml
index 33ef4def1..8ac707e85 100644
--- a/dubbo-alibaba/pom.xml
+++ b/dubbo-alibaba/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/dubbo/pom.xml b/dubbo/pom.xml
index 26249388a..921877457 100644
--- a/dubbo/pom.xml
+++ b/dubbo/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-dubbo</artifactId>
diff --git a/pom.xml b/pom.xml
index 809d87f58..8a5ae55fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
     <groupId>com.alibaba.fescar</groupId>
     <artifactId>fescar-all</artifactId>
-    <version>0.3.1</version>
+    <version>0.4.0-SNAPSHOT</version>
     <modules>
         <module>config</module>
         <module>common</module>
diff --git a/rm-datasource/pom.xml b/rm-datasource/pom.xml
index 095ba27d5..adf6194bd 100644
--- a/rm-datasource/pom.xml
+++ b/rm-datasource/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-rm-datasource</artifactId>
diff --git a/server/pom.xml b/server/pom.xml
index eaa734528..d2a134afd 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-server</artifactId>
diff --git a/spring/pom.xml b/spring/pom.xml
index 16f296dd9..fb6496e26 100644
--- a/spring/pom.xml
+++ b/spring/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-spring</artifactId>
diff --git a/tm/pom.xml b/tm/pom.xml
index 2e4d9d4d6..7824bfb30 100644
--- a/tm/pom.xml
+++ b/tm/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-tm</artifactId>


Test patch:
diff --git a/test/pom.xml b/test/pom.xml
index 952a3d052..05ee4978b 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -20,7 +20,7 @@
     <parent>
         <artifactId>fescar-all</artifactId>
         <groupId>com.alibaba.fescar</groupId>
-        <version>0.3.1</version>
+        <version>0.4.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>fescar-test</artifactId>
@@ -81,10 +81,6 @@
             <artifactId>spring-jdbc</artifactId>
             <version>4.3.18.RELEASE</version>
         </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>fescar-rm-datasource</artifactId>
-        </dependency>
         <dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>