style: format
This commit is contained in:
parent
d8515a32f7
commit
5dd1255df7
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,6 +8,7 @@ target/
|
|||||||
.settings
|
.settings
|
||||||
.springBeans
|
.springBeans
|
||||||
.sts4-cache
|
.sts4-cache
|
||||||
|
maven-wrapper.jar
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
### IntelliJ IDEA ###
|
||||||
.idea
|
.idea
|
||||||
|
4
.mvn/wrapper/maven-wrapper.properties
vendored
4
.mvn/wrapper/maven-wrapper.properties
vendored
@ -14,5 +14,5 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
|
||||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
|
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
|
@ -119,7 +119,7 @@ public class DynamicDataSourceCreatorAutoConfiguration {
|
|||||||
/**
|
/**
|
||||||
* 存在Atomikos数据源时, 加入创建器
|
* 存在Atomikos数据源时, 加入创建器
|
||||||
*/
|
*/
|
||||||
@ConditionalOnClass({AtomikosDataSourceBean.class,TransactionFactory.class})
|
@ConditionalOnClass({AtomikosDataSourceBean.class, TransactionFactory.class})
|
||||||
@Configuration
|
@Configuration
|
||||||
static class AtomikosDataSourceCreatorConfiguration {
|
static class AtomikosDataSourceCreatorConfiguration {
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>11</java.version>
|
<java.version>11</java.version>
|
||||||
<spring-boot-dependencies.version>3.1.0</spring-boot-dependencies.version>
|
<spring-boot-dependencies.version>3.1.1</spring-boot-dependencies.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -17,6 +17,7 @@ package com.baomidou.dynamic.datasource.tx;
|
|||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -36,24 +37,24 @@ public final class LocalTxUtil {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static UUID randomUUID(){
|
public static UUID randomUUID() {
|
||||||
SecureRandom ng = SECURE_RANDOM_HOLDER.get();
|
SecureRandom ng = SECURE_RANDOM_HOLDER.get();
|
||||||
byte[] randomBytes = new byte[16];
|
byte[] randomBytes = new byte[16];
|
||||||
ng.nextBytes(randomBytes);
|
ng.nextBytes(randomBytes);
|
||||||
// clear version
|
// clear version
|
||||||
randomBytes[6] &= 0x0f;
|
randomBytes[6] &= 0x0f;
|
||||||
// set to version 4
|
// set to version 4
|
||||||
randomBytes[6] |= 0x40;
|
randomBytes[6] |= 0x40;
|
||||||
// clear variant
|
// clear variant
|
||||||
randomBytes[8] &= 0x3f;
|
randomBytes[8] &= 0x3f;
|
||||||
// set to IETF variant
|
// set to IETF variant
|
||||||
randomBytes[8] |= 0x80;
|
randomBytes[8] |= 0x80;
|
||||||
long msb = 0;
|
long msb = 0;
|
||||||
long lsb = 0;
|
long lsb = 0;
|
||||||
for (int i=0; i<8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
msb = (msb << 8) | (randomBytes[i] & 0xff);
|
msb = (msb << 8) | (randomBytes[i] & 0xff);
|
||||||
}
|
}
|
||||||
for (int i=8; i<16; i++) {
|
for (int i = 8; i < 16; i++) {
|
||||||
lsb = (lsb << 8) | (randomBytes[i] & 0xff);
|
lsb = (lsb << 8) | (randomBytes[i] & 0xff);
|
||||||
}
|
}
|
||||||
return new UUID(msb, lsb);
|
return new UUID(msb, lsb);
|
||||||
|
4
pom.xml
4
pom.xml
@ -61,9 +61,9 @@
|
|||||||
<seata.version>1.4.2</seata.version>
|
<seata.version>1.4.2</seata.version>
|
||||||
<lombok.version>1.18.28</lombok.version>
|
<lombok.version>1.18.28</lombok.version>
|
||||||
|
|
||||||
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
|
<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
|
||||||
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
|
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
|
||||||
<maven-surefire-plugin.version>3.1.0</maven-surefire-plugin.version>
|
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
|
||||||
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
||||||
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
|
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
|
||||||
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
|
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user