From e1b56b3cc136406aef9f0a2d4bbc7d33cfc26491 Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Tue, 1 Dec 2020 13:43:36 +0100 Subject: [PATCH] Cleanup. --- .gitignore | 8 +++++--- build.gradle | 9 ++++----- gradle.properties | 2 +- src/main/java/biz/nellemann/syslogd/LogEvent.java | 2 ++ src/main/java/biz/nellemann/syslogd/TcpServer.java | 4 ++-- src/main/java/biz/nellemann/syslogd/UdpServer.java | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 0e13346..bdd497e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ -# Ignore Gradle project-specific cache directory +.classpath +.settings +.project .gradle +.vscode .idea - -# Ignore Gradle build output directory build +bin diff --git a/build.gradle b/build.gradle index f3265c7..1d6d727 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'groovy' id 'application' - id "com.github.johnrengelman.shadow" version "6.0.0" + id "com.github.johnrengelman.shadow" version "6.1.0" id "net.nemerosa.versioning" version "2.14.0" id "nebula.ospackage" version "8.4.1" } @@ -12,13 +12,13 @@ repositories { } dependencies { - compile 'info.picocli:picocli:4.5.1' - annotationProcessor 'info.picocli:picocli-codegen:4.5.1' + compile 'info.picocli:picocli:4.5.2' + annotationProcessor 'info.picocli:picocli-codegen:4.5.2' implementation 'org.slf4j:slf4j-api:1.7.+' runtimeOnly 'ch.qos.logback:logback-classic:1.+' - testImplementation('org.spockframework:spock-core:2.0-M3-groovy-3.0') + testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0') testImplementation("org.slf4j:slf4j-simple:1.7.+") } @@ -60,7 +60,6 @@ buildRpm { buildDeb { dependsOn startShadowScripts - requires('default-jre-headless') } jar { diff --git a/gradle.properties b/gradle.properties index bff5e14..7edf4dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ id = syslogd group = biz.nellemann.syslogd -version = 1.0.4 +version = 1.0.5 diff --git a/src/main/java/biz/nellemann/syslogd/LogEvent.java b/src/main/java/biz/nellemann/syslogd/LogEvent.java index 2eb8eeb..76650c3 100644 --- a/src/main/java/biz/nellemann/syslogd/LogEvent.java +++ b/src/main/java/biz/nellemann/syslogd/LogEvent.java @@ -20,6 +20,7 @@ import java.util.EventObject; public class LogEvent extends EventObject { + private static final long serialVersionUID = 1L; private final String message; public LogEvent(final Object source, final String message ) { @@ -30,4 +31,5 @@ public class LogEvent extends EventObject { public String getMessage() { return message; } + } diff --git a/src/main/java/biz/nellemann/syslogd/TcpServer.java b/src/main/java/biz/nellemann/syslogd/TcpServer.java index aca61ee..b31ec6c 100644 --- a/src/main/java/biz/nellemann/syslogd/TcpServer.java +++ b/src/main/java/biz/nellemann/syslogd/TcpServer.java @@ -100,9 +100,9 @@ public class TcpServer { private synchronized void sendEvent(String message) { LogEvent event = new LogEvent( this, message ); - Iterator listeners = eventListeners.iterator(); + Iterator listeners = eventListeners.iterator(); while( listeners.hasNext() ) { - ( (LogListener) listeners.next() ).onLogEvent( event ); + listeners.next().onLogEvent( event ); } } diff --git a/src/main/java/biz/nellemann/syslogd/UdpServer.java b/src/main/java/biz/nellemann/syslogd/UdpServer.java index 3383003..b2b1d67 100644 --- a/src/main/java/biz/nellemann/syslogd/UdpServer.java +++ b/src/main/java/biz/nellemann/syslogd/UdpServer.java @@ -57,9 +57,9 @@ public class UdpServer extends Thread { private synchronized void sendEvent(String message) { LogEvent event = new LogEvent( this, message); - Iterator listeners = eventListeners.iterator(); + Iterator listeners = eventListeners.iterator(); while( listeners.hasNext() ) { - ( (LogListener) listeners.next() ).onLogEvent( event ); + listeners.next().onLogEvent( event ); } }