From 7ad562f0fea4a0cddfe8fb45ad3ee5c8b5de7fcd Mon Sep 17 00:00:00 2001 From: Alexander Biryukov Date: Mon, 20 May 2019 18:12:46 +0300 Subject: [PATCH] Version 1.0.5 - Added Runnable overload for Applocker.Builder#onFail - Removed Spotbugs and PMD - pom.xml tweaks --- .travis.yml | 2 -- CHANGELOG.md | 5 +++ README.md | 4 +-- checkstyle/{checks.xml => checkstyle.xml} | 0 gh-pages/_config.yml | 3 ++ gh-pages/_layouts/default.html | 6 ++-- pom.xml | 33 ++----------------- .../github/sanyarnd/applocker/AppLocker.java | 14 +++++++- 8 files changed, 28 insertions(+), 39 deletions(-) rename checkstyle/{checks.xml => checkstyle.xml} (100%) diff --git a/.travis.yml b/.travis.yml index fead6ff..b345951 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,6 @@ install: after_success: - mvn org.jacoco:jacoco-maven-plugin:report - mvn pvsstudio:pvsCredentials pvsstudio:pvsAnalyze - - mvn spotbugs:spotbugs - - mvn pmd:pmd - mvn sonar:sonar -DskipTests=true -Dmaven.install.skip=true # there is no deploy without tag (yet?), diff --git a/CHANGELOG.md b/CHANGELOG.md index def965c..2eb68b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.0.5 +- `Runnable` overload for `onFail` method +- Removed Spotbugs amd PMD +- pom.xml changes + # 1.0.4 - Nonnull by default for all API - Spotbugs and PMD integration diff --git a/README.md b/README.md index 2e5c57d..98b9632 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Maven: io.github.sanyarnd app-locker - 1.0.4 + 1.0.5 @@ -68,7 +68,7 @@ Maven: ``` Gradle: ```gradle -compile 'io.github.sanyarnd:app-locker:1.0.4' +compile 'io.github.sanyarnd:app-locker:1.0.5' repositories { maven { diff --git a/checkstyle/checks.xml b/checkstyle/checkstyle.xml similarity index 100% rename from checkstyle/checks.xml rename to checkstyle/checkstyle.xml diff --git a/gh-pages/_config.yml b/gh-pages/_config.yml index 04eb4eb..8e36f29 100644 --- a/gh-pages/_config.yml +++ b/gh-pages/_config.yml @@ -6,6 +6,9 @@ description: Provides file-based locking mechanism with inter-process communicat show_downloads: true github: + owner_name: Alexander Biryukov jar_url: https://github.com/sanyarnd/applocker/releases pom_url: https://bintray.com/sanya-rnd/maven-projects/applocker api_url: https://sanyarnd.github.io/applocker/apidocs/index.html + +google_analytics: "UA-140515150-1" diff --git a/gh-pages/_layouts/default.html b/gh-pages/_layouts/default.html index 0fb0b55..954ab63 100644 --- a/gh-pages/_layouts/default.html +++ b/gh-pages/_layouts/default.html @@ -25,9 +25,9 @@

{{ site.description | default: site.github.project_tagl {% if site.show_downloads %}
- Download this project as a Maven/Gradle dependency - Download this project as a .jar file - Download this project as a .jar file + Download this project as a .jar file + Download this project as a .jar file + Download this project as a Maven/Gradle dependency
{% endif %} diff --git a/pom.xml b/pom.xml index c415a1f..7c7963d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.sanyarnd app-locker - 1.0.4 + 1.0.5 https://sanyarnd.github.io/applocker/ jar @@ -39,8 +39,6 @@ target/sonar-reports/jacoco.xml target/sonar-reports/pvs-output.xml - target/sonar-reports/spotbugsXml.xml - target/sonar-reports/pmd.xml 3.8.1 3.1.0 @@ -60,11 +58,8 @@ 7.02.32034 0.8.4 3.6.0.1398 - 3.12.0 3.1.0 8.20 - 3.1.11 - 1.9.0 1.18.8 3.0.2 @@ -126,7 +121,7 @@ check - checkstyle/checks.xml + checkstyle/checkstyle.xml @@ -149,30 +144,6 @@ sonar-maven-plugin ${sonar-maven-plugin.version} - - com.github.spotbugs - spotbugs-maven-plugin - ${spotbugs-maven-plugin.version} - - target/sonar-reports - - - com.h3xstream.findsecbugs - findsecbugs-plugin - ${spotbugs-findsec-maven-plugin.version} - - - - - - org.apache.maven.plugins - maven-pmd-plugin - ${maven-pmd-plugin.version} - - target/sonar-reports - xml - - com.pvsstudio pvsstudio-maven-plugin diff --git a/src/main/java/io/github/sanyarnd/applocker/AppLocker.java b/src/main/java/io/github/sanyarnd/applocker/AppLocker.java index 7f261ed..277a22d 100644 --- a/src/main/java/io/github/sanyarnd/applocker/AppLocker.java +++ b/src/main/java/io/github/sanyarnd/applocker/AppLocker.java @@ -308,7 +308,7 @@ public Builder onBusy(final Serializable message, final * @return builder */ public Builder onBusy(final Serializable message, final Runnable handler) { - busyHandler = (appLocker, ex) -> { + busyHandler = (appLocker, ignoredException) -> { appLocker.sendMessage(message); handler.run(); }; @@ -327,6 +327,18 @@ public Builder onFail(final Consumer handler) { return this; } + /** + * Defines an action in situations when locking is impossible.
+ * Default value is identity function (re-throws exception). + * + * @param handler error processing function + * @return builder + */ + public Builder onFail(final Runnable handler) { + failedHandler = ignoredException -> handler.run(); + return this; + } + /** * Build AppLocker. *