Skip to content

Commit 7ad562f

Browse files
committed
Version 1.0.5
- Added Runnable overload for Applocker.Builder#onFail - Removed Spotbugs and PMD - pom.xml tweaks
1 parent 64e1744 commit 7ad562f

File tree

8 files changed

+28
-39
lines changed

8 files changed

+28
-39
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ install:
2828
after_success:
2929
- mvn org.jacoco:jacoco-maven-plugin:report
3030
- mvn pvsstudio:pvsCredentials pvsstudio:pvsAnalyze
31-
- mvn spotbugs:spotbugs
32-
- mvn pmd:pmd
3331
- mvn sonar:sonar -DskipTests=true -Dmaven.install.skip=true
3432

3533
# there is no deploy without tag (yet?),

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.0.5
2+
- `Runnable` overload for `onFail` method
3+
- Removed Spotbugs amd PMD
4+
- pom.xml changes
5+
16
# 1.0.4
27
- Nonnull by default for all API
38
- Spotbugs and PMD integration

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Maven:
5555
<dependency>
5656
<groupId>io.github.sanyarnd</groupId>
5757
<artifactId>app-locker</artifactId>
58-
<version>1.0.4</version>
58+
<version>1.0.5</version>
5959
</dependency>
6060

6161
<repositories>
@@ -68,7 +68,7 @@ Maven:
6868
```
6969
Gradle:
7070
```gradle
71-
compile 'io.github.sanyarnd:app-locker:1.0.4'
71+
compile 'io.github.sanyarnd:app-locker:1.0.5'
7272
7373
repositories {
7474
maven {

gh-pages/_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ description: Provides file-based locking mechanism with inter-process communicat
66
show_downloads: true
77

88
github:
9+
owner_name: Alexander Biryukov
910
jar_url: https://github.com/sanyarnd/applocker/releases
1011
pom_url: https://bintray.com/sanya-rnd/maven-projects/applocker
1112
api_url: https://sanyarnd.github.io/applocker/apidocs/index.html
13+
14+
google_analytics: "UA-140515150-1"

gh-pages/_layouts/default.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ <h2 id="project_tagline">{{ site.description | default: site.github.project_tagl
2525

2626
{% if site.show_downloads %}
2727
<section id="downloads">
28-
<a class="pom_download_link" href="{{ site.github.pom_url }}">Download this project as a Maven/Gradle dependency</a>
29-
<a class="jar_download_link" href="{{ site.github.jar_url }}">Download this project as a .jar file</a>
30-
<a class="api_download_link" href="{{ site.github.api_url }}">Download this project as a .jar file</a>
28+
<a class="api_download_link" href="{{ site.github.api_url }}">Download this project as a .jar file</a>
29+
<a class="jar_download_link" href="{{ site.github.jar_url }}">Download this project as a .jar file</a>
30+
<a class="pom_download_link" href="{{ site.github.pom_url }}">Download this project as a Maven/Gradle dependency</a>
3131
</section>
3232
{% endif %}
3333
</header>

pom.xml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.sanyarnd</groupId>
88
<artifactId>app-locker</artifactId>
9-
<version>1.0.4</version>
9+
<version>1.0.5</version>
1010
<url>https://sanyarnd.github.io/applocker/</url>
1111
<packaging>jar</packaging>
1212

@@ -39,8 +39,6 @@
3939

4040
<sonar.coverage.jacoco.xmlReportPaths>target/sonar-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
4141
<sonar.pvs-studio.reportPath>target/sonar-reports/pvs-output.xml</sonar.pvs-studio.reportPath>
42-
<sonar.java.spotbugs.reportPaths>target/sonar-reports/spotbugsXml.xml</sonar.java.spotbugs.reportPaths>
43-
<sonar.java.pmd.reportPaths>target/sonar-reports/pmd.xml</sonar.java.pmd.reportPaths>
4442

4543
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
4644
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
@@ -60,11 +58,8 @@
6058
<pvsstudio-maven-plugin.version>7.02.32034</pvsstudio-maven-plugin.version>
6159
<jacoco-maven-plugin.version>0.8.4</jacoco-maven-plugin.version>
6260
<sonar-maven-plugin.version>3.6.0.1398</sonar-maven-plugin.version>
63-
<maven-pmd-plugin.version>3.12.0</maven-pmd-plugin.version>
6461
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
6562
<checkstyle.version>8.20</checkstyle.version>
66-
<spotbugs-maven-plugin.version>3.1.11</spotbugs-maven-plugin.version>
67-
<spotbugs-findsec-maven-plugin.version>1.9.0</spotbugs-findsec-maven-plugin.version>
6863

6964
<lombok.version>1.18.8</lombok.version>
7065
<jsr305.version>3.0.2</jsr305.version>
@@ -126,7 +121,7 @@
126121
<goal>check</goal>
127122
</goals>
128123
<configuration>
129-
<configLocation>checkstyle/checks.xml</configLocation>
124+
<configLocation>checkstyle/checkstyle.xml</configLocation>
130125
</configuration>
131126
</execution>
132127
</executions>
@@ -149,30 +144,6 @@
149144
<artifactId>sonar-maven-plugin</artifactId>
150145
<version>${sonar-maven-plugin.version}</version>
151146
</plugin>
152-
<plugin>
153-
<groupId>com.github.spotbugs</groupId>
154-
<artifactId>spotbugs-maven-plugin</artifactId>
155-
<version>${spotbugs-maven-plugin.version}</version>
156-
<configuration>
157-
<spotbugsXmlOutputDirectory>target/sonar-reports</spotbugsXmlOutputDirectory>
158-
<plugins>
159-
<plugin>
160-
<groupId>com.h3xstream.findsecbugs</groupId>
161-
<artifactId>findsecbugs-plugin</artifactId>
162-
<version>${spotbugs-findsec-maven-plugin.version}</version>
163-
</plugin>
164-
</plugins>
165-
</configuration>
166-
</plugin>
167-
<plugin>
168-
<groupId>org.apache.maven.plugins</groupId>
169-
<artifactId>maven-pmd-plugin</artifactId>
170-
<version>${maven-pmd-plugin.version}</version>
171-
<configuration>
172-
<targetDirectory>target/sonar-reports</targetDirectory>
173-
<format>xml</format>
174-
</configuration>
175-
</plugin>
176147
<plugin>
177148
<groupId>com.pvsstudio</groupId>
178149
<artifactId>pvsstudio-maven-plugin</artifactId>

src/main/java/io/github/sanyarnd/applocker/AppLocker.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public <T extends Serializable> Builder onBusy(final Serializable message, final
308308
* @return builder
309309
*/
310310
public Builder onBusy(final Serializable message, final Runnable handler) {
311-
busyHandler = (appLocker, ex) -> {
311+
busyHandler = (appLocker, ignoredException) -> {
312312
appLocker.sendMessage(message);
313313
handler.run();
314314
};
@@ -327,6 +327,18 @@ public Builder onFail(final Consumer<LockingException> handler) {
327327
return this;
328328
}
329329

330+
/**
331+
* Defines an action in situations when locking is impossible.<br>
332+
* Default value is identity function (re-throws exception).
333+
*
334+
* @param handler error processing function
335+
* @return builder
336+
*/
337+
public Builder onFail(final Runnable handler) {
338+
failedHandler = ignoredException -> handler.run();
339+
return this;
340+
}
341+
330342
/**
331343
* Build AppLocker.
332344
*

0 commit comments

Comments
 (0)