You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matthias Bünger (Jira)" <ji...@apache.org> on 2024/01/13 19:07:00 UTC

[jira] [Updated] (MCLEAN-116) Create interface method to catch exceptions

     [ https://issues.apache.org/jira/browse/MCLEAN-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Bünger updated MCLEAN-116:
-----------------------------------
    Description: 
As stated multiple times in the {{Cleaner}} class, the {{Logger}} interface of this class does not provide a method to log exceptions and needs a refactoring

{code:java}

// ...
            if (logDebug != null) {
                // TODO: this Logger interface cannot log exceptions and needs refactoring
                logDebug.log("Unable to fast delete directory: " + e);
            }

// ...

    private interface Logger {

        void log(CharSequence message);
    }
{code}

However: Many plugins, e.g. the javadoc-plugin or the pmg-plugin use the {{org.apache.maven.plugin.logging.Log}} interface. Therefor using this interface instead an own could be a better solution than adding a new method to the interface in the {{Cleaner}} class.


_This ticket was created to have this task in the issue tracker_

  was:
As stated multiple times in the {{Cleaner}} class, the {{Logger}} interface of this class does not provide a method to log exceptions and needs a refactoring

{code:java}

// ...
            if (logDebug != null) {
                // TODO: this Logger interface cannot log exceptions and needs refactoring
                logDebug.log("Unable to fast delete directory: " + e);
            }

// ...

    private interface Logger {

        void log(CharSequence message);
    }
{code}

_This ticket was created to have this task in the issue tracker_


> Create interface method to catch exceptions
> -------------------------------------------
>
>                 Key: MCLEAN-116
>                 URL: https://issues.apache.org/jira/browse/MCLEAN-116
>             Project: Maven Clean Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.3.2
>            Reporter: Matthias Bünger
>            Priority: Minor
>
> As stated multiple times in the {{Cleaner}} class, the {{Logger}} interface of this class does not provide a method to log exceptions and needs a refactoring
> {code:java}
> // ...
>             if (logDebug != null) {
>                 // TODO: this Logger interface cannot log exceptions and needs refactoring
>                 logDebug.log("Unable to fast delete directory: " + e);
>             }
> // ...
>     private interface Logger {
>         void log(CharSequence message);
>     }
> {code}
> However: Many plugins, e.g. the javadoc-plugin or the pmg-plugin use the {{org.apache.maven.plugin.logging.Log}} interface. Therefor using this interface instead an own could be a better solution than adding a new method to the interface in the {{Cleaner}} class.
> _This ticket was created to have this task in the issue tracker_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)