This is an automated email from the ASF dual-hosted git repository.

tv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/turbine-core.git

commit 796d917178767ee7b3445b08078e2137124514da
Author: Thomas Vandahl <[email protected]>
AuthorDate: Sun Dec 14 20:43:19 2025 +0100

    Use default interface methods
---
 src/java/org/apache/turbine/om/OMTool.java          | 21 ---------------------
 .../apache/turbine/services/intake/IntakeTool.java  | 10 ----------
 .../turbine/services/pull/ApplicationTool.java      | 10 +++++++---
 .../services/pull/PipelineDataApplicationTool.java  |  8 ++++++--
 .../services/pull/RunDataApplicationTool.java       |  8 ++++++--
 .../turbine/services/pull/tools/ContentTool.java    |  9 ---------
 .../turbine/services/pull/tools/TemplateLink.java   |  9 ---------
 .../turbine/services/pull/util/DateFormatter.java   | 13 -------------
 .../services/pull/util/DateTimeFormatterTool.java   | 13 -------------
 .../turbine/services/pull/util/SessionData.java     |  9 ---------
 .../turbine/services/schedule/SchedulerTool.java    |  9 ---------
 .../turbine/services/session/SessionTool.java       | 12 ------------
 .../turbine/util/template/HtmlPageAttributes.java   |  9 ---------
 13 files changed, 19 insertions(+), 121 deletions(-)

diff --git a/src/java/org/apache/turbine/om/OMTool.java 
b/src/java/org/apache/turbine/om/OMTool.java
index 5d8c8461..93e27422 100644
--- a/src/java/org/apache/turbine/om/OMTool.java
+++ b/src/java/org/apache/turbine/om/OMTool.java
@@ -66,27 +66,6 @@ public class OMTool implements ApplicationTool, Recyclable
         this.omFactory = 
(RetrieverFactory)Class.forName(className).getDeclaredConstructor().newInstance();
     }
 
-    /**
-     * Prepares tool for a single request
-     *
-     * @param data the initialization data
-     */
-    @Override
-    public void init(Object data)
-    {
-        // data = (RunData)data;
-    }
-
-    /**
-     * Implementation of ApplicationTool interface is not needed for this
-     * method as the tool is request scoped
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Inner class to present a nice interface to the template designer
      */
diff --git a/src/java/org/apache/turbine/services/intake/IntakeTool.java 
b/src/java/org/apache/turbine/services/intake/IntakeTool.java
index f6fdff7c..992e1079 100644
--- a/src/java/org/apache/turbine/services/intake/IntakeTool.java
+++ b/src/java/org/apache/turbine/services/intake/IntakeTool.java
@@ -245,16 +245,6 @@ public class IntakeTool
         groups.values().forEach(Group::resetDeclared);
     }
 
-    /**
-     * Implementation of ApplicationTool interface is not needed for this
-     * tool as it is request scoped
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Inner class to present a nice interface to the template designer
      */
diff --git a/src/java/org/apache/turbine/services/pull/ApplicationTool.java 
b/src/java/org/apache/turbine/services/pull/ApplicationTool.java
index f11c0508..dbb88196 100644
--- a/src/java/org/apache/turbine/services/pull/ApplicationTool.java
+++ b/src/java/org/apache/turbine/services/pull/ApplicationTool.java
@@ -43,12 +43,14 @@ public interface ApplicationTool
      * session happens to the be login action.
      * <p>
      * If your session tool depends on having a <code>User</code> object, you
-     * should look at implementing the {@link RunDataApplicationTool} interface
+     * should look at implementing the {@link PipelineDataApplicationTool} 
interface
      * instead.
+     * 
+     * Default: do nothing
      *
      * @param data initialization data
      */
-    void init(Object data);
+    default void init(Object data) {}
 
     /**
      * Refresh the application tool. This is
@@ -56,6 +58,8 @@ public interface ApplicationTool
      * probably want the tool to refresh itself
      * if it is using configuration information
      * that is typically cached after initialization
+     * 
+     * Default: do nothing
      */
-    void refresh();
+    default void refresh() {}
 }
diff --git 
a/src/java/org/apache/turbine/services/pull/PipelineDataApplicationTool.java 
b/src/java/org/apache/turbine/services/pull/PipelineDataApplicationTool.java
index bc977567..f7141ed0 100644
--- a/src/java/org/apache/turbine/services/pull/PipelineDataApplicationTool.java
+++ b/src/java/org/apache/turbine/services/pull/PipelineDataApplicationTool.java
@@ -49,9 +49,11 @@ public interface PipelineDataApplicationTool
      * get a <code>User</code> object from the instance of
      * <code>PipelineData</code>.
      *
+     * Default: do nothing
+     *
      * @param data initialization data
      */
-    void init(Object data);
+    default void init(Object data) {}
 
     /**
      * Refresh the application tool. This is
@@ -59,8 +61,10 @@ public interface PipelineDataApplicationTool
      * probably want the tool to refresh itself
      * if it is using configuration information
      * that is typically cached after initialization
+     * 
+     * Default: do nothing
      *
      * @param data The current PipelineData Object
      */
-    void refresh(PipelineData data);
+    default void refresh(PipelineData data) {}
 }
diff --git 
a/src/java/org/apache/turbine/services/pull/RunDataApplicationTool.java 
b/src/java/org/apache/turbine/services/pull/RunDataApplicationTool.java
index 70c3a064..d43cebd9 100644
--- a/src/java/org/apache/turbine/services/pull/RunDataApplicationTool.java
+++ b/src/java/org/apache/turbine/services/pull/RunDataApplicationTool.java
@@ -50,9 +50,11 @@ public interface RunDataApplicationTool
      * get a <code>User</code> object from the instance of
      * <code>RunData</code>.
      *
+     * Default: do nothing
+     *
      * @param data initialization data
      */
-    void init(Object data);
+    default void init(Object data) {}
 
     /**
      * Refresh the application tool. This is
@@ -61,7 +63,9 @@ public interface RunDataApplicationTool
      * if it is using configuration information
      * that is typically cached after initialization
      *
+     * Default: do nothing
+     *
      * @param data The current RunData Object
      */
-    void refresh(RunData data);
+    default void refresh(RunData data){}
 }
diff --git a/src/java/org/apache/turbine/services/pull/tools/ContentTool.java 
b/src/java/org/apache/turbine/services/pull/tools/ContentTool.java
index 8394bf8a..017d1f62 100644
--- a/src/java/org/apache/turbine/services/pull/tools/ContentTool.java
+++ b/src/java/org/apache/turbine/services/pull/tools/ContentTool.java
@@ -139,15 +139,6 @@ public class ContentTool
         }
     }
 
-    /**
-     * Refresh method - does nothing
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Returns the Turbine URI of a given Path
      *
diff --git a/src/java/org/apache/turbine/services/pull/tools/TemplateLink.java 
b/src/java/org/apache/turbine/services/pull/tools/TemplateLink.java
index 02bce374..fecbcab7 100644
--- a/src/java/org/apache/turbine/services/pull/tools/TemplateLink.java
+++ b/src/java/org/apache/turbine/services/pull/tools/TemplateLink.java
@@ -155,15 +155,6 @@ public class TemplateLink
 
     }
 
-    /**
-     * Refresh method - does nothing
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /*
      * ========================================================================
      *
diff --git a/src/java/org/apache/turbine/services/pull/util/DateFormatter.java 
b/src/java/org/apache/turbine/services/pull/util/DateFormatter.java
index 7c394fdd..87227aac 100644
--- a/src/java/org/apache/turbine/services/pull/util/DateFormatter.java
+++ b/src/java/org/apache/turbine/services/pull/util/DateFormatter.java
@@ -67,19 +67,6 @@ public class DateFormatter
                 .getString(DATE_FORMAT_KEY, DATE_FORMAT_DEFAULT);
     }
 
-    /**
-     * Refresh the application tool. This is
-     * necessary for development work where you
-     * probably want the tool to refresh itself
-     * if it is using configuration information
-     * that is typically cached after initialization
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Formats the given date as a String using the default date format.
      * The default date format is MM/dd/yyyy
diff --git 
a/src/java/org/apache/turbine/services/pull/util/DateTimeFormatterTool.java 
b/src/java/org/apache/turbine/services/pull/util/DateTimeFormatterTool.java
index 59c5f7c7..3ad986d7 100644
--- a/src/java/org/apache/turbine/services/pull/util/DateTimeFormatterTool.java
+++ b/src/java/org/apache/turbine/services/pull/util/DateTimeFormatterTool.java
@@ -116,19 +116,6 @@ public class DateTimeFormatterTool extends DateFormatter
         return dtfs;
     }
 
-    /**
-     * Refresh the application tool. This is
-     * necessary for development work where you
-     * probably want the tool to refresh itself
-     * if it is using configuration information
-     * that is typically cached after initialization
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     @Override
     public DateTimeFormatter getDefaultFormat()
     {
diff --git a/src/java/org/apache/turbine/services/pull/util/SessionData.java 
b/src/java/org/apache/turbine/services/pull/util/SessionData.java
index 99d287aa..aceed49f 100644
--- a/src/java/org/apache/turbine/services/pull/util/SessionData.java
+++ b/src/java/org/apache/turbine/services/pull/util/SessionData.java
@@ -52,15 +52,6 @@ public class SessionData implements ApplicationTool
         dataStorage = new HashMap<>();
     }
 
-    /**
-     * Refresh the application tool.
-     */
-    @Override
-    public void refresh()
-    {
-        // do nothing
-    }
-
     /**
      * Gets the data stored under the key.  Null will be returned if the
      * key does not exist or if null was stored under the key.
diff --git a/src/java/org/apache/turbine/services/schedule/SchedulerTool.java 
b/src/java/org/apache/turbine/services/schedule/SchedulerTool.java
index 891d829b..b8342562 100644
--- a/src/java/org/apache/turbine/services/schedule/SchedulerTool.java
+++ b/src/java/org/apache/turbine/services/schedule/SchedulerTool.java
@@ -60,15 +60,6 @@ public class SchedulerTool implements ApplicationTool
         }
     }
 
-    /**
-     * Does nothing
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Gets the list of scheduled jobs.
      *
diff --git a/src/java/org/apache/turbine/services/session/SessionTool.java 
b/src/java/org/apache/turbine/services/session/SessionTool.java
index 16049f54..9b99d073 100644
--- a/src/java/org/apache/turbine/services/session/SessionTool.java
+++ b/src/java/org/apache/turbine/services/session/SessionTool.java
@@ -44,18 +44,6 @@ public class SessionTool
     @TurbineService
     private SessionService sessionService;
 
-    @Override
-    public void init(Object o)
-    {
-        // empty
-    }
-
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Gets a list of the active sessions
      *
diff --git a/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java 
b/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java
index f0313a16..dcc907db 100644
--- a/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java
+++ b/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java
@@ -162,15 +162,6 @@ public class HtmlPageAttributes
         this.httpEquivs.clear();
     }
 
-    /**
-     * Refresh method - does nothing
-     */
-    @Override
-    public void refresh()
-    {
-        // empty
-    }
-
     /**
      * Set the title in the page.  This returns an empty String so
      * that the template doesn't complain about getting a null return

Reply via email to