snowballstem/snowball

Generated Java code does not inherit from the correct class

urieli opened this issue · 2 comments

In the java TestApp, we have the statement at https://github.com/snowballstem/snowball/blob/master/java/org/tartarus/snowball/TestApp.java#L31

SnowballStemmer stemmer = (SnowballStemmer) stemClass.newInstance();

However, the generated Java class inherits from org.tartarus.snowball.SnowballProgram rather than org.tartarus.snowball.SnowballStemmer.

By simply making the generated class inherit from org.tartarus.snowball.SnowballStemmer (already a subclass of org.tartarus.snowball.SnowballProgram) the TestApp works out of the box.

ojwb commented

It looks to me like generated classes already inherit from SnowballStemmer:

$ grep extends java/org/tartarus/snowball/ext/spanishStemmer.java 
public class spanishStemmer extends org.tartarus.snowball.SnowballStemmer {

TestApp is used by make check_java, which currently passes, so it already works out of the box!

If you still think something needs changing, can you open a PR with the changes you're proposing? That avoids me having to interpret what you're trying to suggest, and also means the changes get automatically testing by the CI.

My excuses, I must have used a downloaded version of the snowball library against the github source code. I thought I had built directly from the github source code.