style: format

This commit is contained in:
HuaYan 2023-07-09 21:16:04 +08:00
parent d8515a32f7
commit 5dd1255df7
6 changed files with 15 additions and 13 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ target/
.settings
.springBeans
.sts4-cache
maven-wrapper.jar
### IntelliJ IDEA ###
.idea

View File

@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# 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
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
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.2.0/maven-wrapper-3.2.0.jar

View File

@ -119,7 +119,7 @@ public class DynamicDataSourceCreatorAutoConfiguration {
/**
* 存在Atomikos数据源时, 加入创建器
*/
@ConditionalOnClass({AtomikosDataSourceBean.class,TransactionFactory.class})
@ConditionalOnClass({AtomikosDataSourceBean.class, TransactionFactory.class})
@Configuration
static class AtomikosDataSourceCreatorConfiguration {

View File

@ -17,7 +17,7 @@
<properties>
<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>
<dependencies>

View File

@ -17,6 +17,7 @@ package com.baomidou.dynamic.datasource.tx;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import java.security.SecureRandom;
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();
byte[] randomBytes = new byte[16];
ng.nextBytes(randomBytes);
// clear version
randomBytes[6] &= 0x0f;
randomBytes[6] &= 0x0f;
// set to version 4
randomBytes[6] |= 0x40;
randomBytes[6] |= 0x40;
// clear variant
randomBytes[8] &= 0x3f;
randomBytes[8] &= 0x3f;
// set to IETF variant
randomBytes[8] |= 0x80;
randomBytes[8] |= 0x80;
long msb = 0;
long lsb = 0;
for (int i=0; i<8; i++) {
for (int i = 0; i < 8; i++) {
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);
}
return new UUID(msb, lsb);

View File

@ -61,9 +61,9 @@
<seata.version>1.4.2</seata.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-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-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>