You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2019/05/02 09:43:49 UTC
[commons-daemon] branch master updated: Fix missing @Override
warnings
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git
The following commit(s) were added to refs/heads/master by this push:
new 9d54de1 Fix missing @Override warnings
9d54de1 is described below
commit 9d54de14bd4c3560ddd3d2573d9e60838d9b5583
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu May 2 10:43:39 2019 +0100
Fix missing @Override warnings
---
src/samples/AloneService.java | 1 +
src/samples/ProcrunService.java | 2 ++
src/samples/ServiceDaemon.java | 5 +++++
src/samples/ServiceDaemonReadThread.java | 1 +
src/samples/SimpleApplication.java | 4 ++++
src/samples/SimpleDaemon.java | 7 +++++++
6 files changed, 20 insertions(+)
diff --git a/src/samples/AloneService.java b/src/samples/AloneService.java
index 1f5c086..073b047 100644
--- a/src/samples/AloneService.java
+++ b/src/samples/AloneService.java
@@ -32,6 +32,7 @@ public class AloneService {
private ServiceDaemonReadThread readout[] = null;
private ServiceDaemonReadThread readerr[] = null;
+ @Override
protected void finalize() {
System.err.println("ServiceDaemon: instance "+this.hashCode()+
" garbage collected");
diff --git a/src/samples/ProcrunService.java b/src/samples/ProcrunService.java
index a84f299..d5ba620 100644
--- a/src/samples/ProcrunService.java
+++ b/src/samples/ProcrunService.java
@@ -218,6 +218,7 @@ public class ProcrunService implements Runnable {
* This method performs the work of the service.
* In this case, it just logs a message every so often.
*/
+ @Override
public void run() {
log("Started thread in "+System.getProperty("user.dir"));
logSystemEnvironment();
@@ -237,6 +238,7 @@ public class ProcrunService implements Runnable {
System.out.println(df.format(new Date())+msg);
}
+ @Override
protected void finalize(){
log("Finalize called from thread "+Thread.currentThread());
}
diff --git a/src/samples/ServiceDaemon.java b/src/samples/ServiceDaemon.java
index 1ded4a6..9f7ba5f 100644
--- a/src/samples/ServiceDaemon.java
+++ b/src/samples/ServiceDaemon.java
@@ -39,6 +39,7 @@ public class ServiceDaemon implements Daemon {
" created");
}
+ @Override
protected void finalize() {
System.err.println("ServiceDaemon: instance "+this.hashCode()+
" garbage collected");
@@ -47,6 +48,7 @@ public class ServiceDaemon implements Daemon {
/**
* init and destroy were added in jakarta-tomcat-daemon.
*/
+ @Override
public void init(DaemonContext context)
throws Exception {
/* Set the err */
@@ -78,6 +80,7 @@ public class ServiceDaemon implements Daemon {
System.err.println("ServiceDaemon: init done ");
}
+ @Override
public void start() {
/* Dump a message */
System.err.println("ServiceDaemon: starting");
@@ -103,6 +106,7 @@ public class ServiceDaemon implements Daemon {
}
}
+ @Override
public void stop()
throws IOException, InterruptedException {
/* Dump a message */
@@ -123,6 +127,7 @@ public class ServiceDaemon implements Daemon {
System.err.println("ServiceDaemon: stopped");
}
+ @Override
public void destroy() {
System.err.println("ServiceDaemon: instance "+this.hashCode()+
" destroy");
diff --git a/src/samples/ServiceDaemonReadThread.java b/src/samples/ServiceDaemonReadThread.java
index c7e0ded..34a3159 100644
--- a/src/samples/ServiceDaemonReadThread.java
+++ b/src/samples/ServiceDaemonReadThread.java
@@ -26,6 +26,7 @@ public class ServiceDaemonReadThread extends Thread {
ServiceDaemonReadThread(InputStream in) {
this.in = new BufferedReader(new InputStreamReader(in));
}
+ @Override
public void run() {
String buff;
for (;;) {
diff --git a/src/samples/SimpleApplication.java b/src/samples/SimpleApplication.java
index 91bab1e..c050024 100644
--- a/src/samples/SimpleApplication.java
+++ b/src/samples/SimpleApplication.java
@@ -47,6 +47,7 @@ public class SimpleApplication implements Runnable {
this.handlers = new Vector<Handler>();
}
+ @Override
protected void finalize() {
System.err.println("SimpleApplication: instance "+this.hashCode()+
" garbage collected");
@@ -114,6 +115,7 @@ public class SimpleApplication implements Runnable {
" destroy");
}
+ @Override
public void run()
{
int number=0;
@@ -165,6 +167,7 @@ public class SimpleApplication implements Runnable {
{
this.instance = instance;
}
+ @Override
public void run()
{
System.out.println("Shutting down");
@@ -190,6 +193,7 @@ public class SimpleApplication implements Runnable {
this.parent=p;
}
+ @Override
public void run() {
this.parent.addHandler(this);
System.err.println("SimpleApplication: connection "+this.number+
diff --git a/src/samples/SimpleDaemon.java b/src/samples/SimpleDaemon.java
index 7752241..8eea844 100644
--- a/src/samples/SimpleDaemon.java
+++ b/src/samples/SimpleDaemon.java
@@ -52,6 +52,7 @@ public class SimpleDaemon implements Daemon, Runnable {
this.handlers = new Vector<Handler>();
}
+ @Override
protected void finalize() {
System.err.println("SimpleDaemon: instance "+this.hashCode()+
" garbage collected");
@@ -60,6 +61,7 @@ public class SimpleDaemon implements Daemon, Runnable {
/**
* init and destroy were added in jakarta-tomcat-daemon.
*/
+ @Override
public void init(DaemonContext context)
throws Exception {
System.err.println("SimpleDaemon: instance "+this.hashCode()+
@@ -87,6 +89,7 @@ public class SimpleDaemon implements Daemon, Runnable {
this.thread=new Thread(this);
}
+ @Override
public void start() {
/* Dump a message */
System.err.println("SimpleDaemon: starting");
@@ -95,6 +98,7 @@ public class SimpleDaemon implements Daemon, Runnable {
this.thread.start();
}
+ @Override
public void stop()
throws IOException, InterruptedException {
/* Dump a message */
@@ -109,11 +113,13 @@ public class SimpleDaemon implements Daemon, Runnable {
System.err.println("SimpleDaemon: stopped");
}
+ @Override
public void destroy() {
System.err.println("SimpleDaemon: instance "+this.hashCode()+
" destroy");
}
+ @Override
public void run() {
int number=0;
@@ -171,6 +177,7 @@ public class SimpleDaemon implements Daemon, Runnable {
this.controller=c;
}
+ @Override
public void run() {
this.parent.addHandler(this);
System.err.println("SimpleDaemon: connection "+this.number+