Skip to content

Commit

Permalink
[cleanup] Remove internally deprecated default class not used
Browse files Browse the repository at this point in the history
All this does is waste memory on the license-maven-plugin-fs test that uses it.

The adjustProperties fails to use what it created there so that just goes to GC.

The deprecated method only returns Collections.emptyMap().

Due to test in the license-maven-plugin-fs, keep these as default but have them do nothing as that is what they are actually doing.  The adjustProperties will remain to send back emptyMap()
  • Loading branch information
hazendaz authored and mathieucarbou committed Jan 4, 2024
1 parent 0b903a9 commit f581546
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,18 @@
import java.io.Closeable;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;

/**
*/
public interface PropertiesProvider extends Closeable {

default void init(AbstractLicenseMojo mojo, Map<String, String> currentProperties) {
// Do nothing on default
}

default Map<String, String> adjustProperties(AbstractLicenseMojo mojo,
Map<String, String> currentProperties, Document document) {
Properties properties = new Properties();
properties.putAll(currentProperties);
return getAdditionalProperties(mojo, properties, document);
}

/**
* Gets the additional properties.
*
* @param mojo the maven mojo
* @param currentProperties the current properties
* @param document the document to process
* @return the additional properties
*
* @deprecated Use instead {@link #adjustProperties(AbstractLicenseMojo, Map, Document)}
*/
@Deprecated
default Map<String, String> getAdditionalProperties(AbstractLicenseMojo mojo,
Properties currentProperties, Document document) {
// Return empty collection on default
return Collections.emptyMap();
}

Expand Down

0 comments on commit f581546

Please sign in to comment.