Skip to content

Commit

Permalink
- remove spring utils (make it provided)
Browse files Browse the repository at this point in the history
- change the method compute on the more productivity computeIfAbsent
- a little style fixes in tests
  • Loading branch information
antkorwin committed Jul 26, 2018
1 parent 09a308c commit e5e4157
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 7,164 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jdk:
- oraclejdk8

script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.exclusions="src/main/java/com/antkorwin/xsync/springframework/util/*" -Dsonar.issue.ignore.multicriteria="e1" -Dsonar.issue.ignore.multicriteria.e1.ruleKey="squid:S00119" -Dsonar.issue.ignore.multicriteria.e1.resourceKey="**/*.java"
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.issue.ignore.multicriteria="e1" -Dsonar.issue.ignore.multicriteria.e1.ruleKey="squid:S00119" -Dsonar.issue.ignore.multicriteria.e1.resourceKey="**/*.java"

addons:
sonarcloud:
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.0.7.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/antkorwin/xsync/XMutex.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Getter
public class XMutex<KeyT> {

private KeyT key;
private final KeyT key;

public XMutex(KeyT key) {
this.key = key;
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/antkorwin/xsync/XMutexFactory.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.antkorwin.xsync;


import com.antkorwin.xsync.springframework.util.ConcurrentReferenceHashMap;


import org.springframework.util.ConcurrentReferenceHashMap;

import java.util.concurrent.ConcurrentMap;

Expand Down Expand Up @@ -51,7 +53,8 @@ public XMutexFactory(int concurrencyLevel,
* then returns the same reference of the mutex.
*/
public XMutex<KeyT> getMutex(KeyT key) {
return this.map.compute(key, (k, v) -> (v == null) ? new XMutex<>(k) : v);
//return this.map.compute(key, (k, v) -> (v == null) ? new XMutex<>(k) : v);

This comment has been minimized.

Copy link
@underkoder

underkoder Jul 26, 2018

И здесь что-то оставил

return this.map.computeIfAbsent(key, XMutex::new);
}

/**
Expand Down
Loading

0 comments on commit e5e4157

Please sign in to comment.