You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "Joern Kottmann (JIRA)" <ji...@apache.org> on 2016/11/07 09:09:58 UTC

[jira] [Commented] (OPENNLP-856) Refactor AdaptiveFeatureGenerator and FeatureGeneratorAdapter

    [ https://issues.apache.org/jira/browse/OPENNLP-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15643576#comment-15643576 ] 

Joern Kottmann commented on OPENNLP-856:
----------------------------------------

We need to keep the AdaptiveFeatureGenerator around otherwise the change will not be backward compatible. Java 8 added default methods and with them we can provide empty default implementations in the AdaptiveFeatureGenerator interface. Our users can then migrate their code to use this interface directly and stop extending FeatureGeneratorAdapter (which we then would deprecate and point that out).

It would be nice if you could send me the patch gain. I will create a Java 8 branch in git so we can start collecting all Java 8 improvements until we switch to it.

> Refactor AdaptiveFeatureGenerator and FeatureGeneratorAdapter
> -------------------------------------------------------------
>
>                 Key: OPENNLP-856
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-856
>             Project: OpenNLP
>          Issue Type: Improvement
>          Components: Name Finder
>    Affects Versions: 1.6.1
>            Reporter: Jeff Zemerick
>            Priority: Minor
>              Labels: feature, features, generator
>
> Under the package opennlp.tools.util.featuregen there is an interface AdaptiveFeatureGenerator and an abstract class FeatureGeneratorAdapter. The interface defines the createFeatures(), updateAdaptiveData(), and clearAdaptiveData() methods. The abstract class implements this interface to provide default implementations of the updateAdaptiveData() and clearAdaptiveData() functions. Feature generators then either implement the interface or extend the abstract class.
> The purpose of this task is to refactor these classes to remove confusion caused by the similarity between the interface and the abstract class. This task deprecates the AdaptiveFeatureGenerator interface in favor of the abstract class FeatureGeneratorAdapter.
> Default methods will be added to the AdaptiveFeatureGenerator interface to maintain backward compatibility. To support the default methods the version of the Java compiler will be set to 1.8.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)