private void ionEndings() {
    int old_k = k;
    if (!endsIn('i', 'o', 'n')) {
      return;
    }
    
    if (endsIn(ization)) { /*
                            * the -ize ending is very productive, so simply
                            * accept it as the root
                            */
      word.setLength(j + 3);
      word.unsafeWrite('e');
      k = j + 3;
      lookup();
      return;
    }
    
    if (endsIn(ition)) {
      word.setLength(j + 1);
      word.unsafeWrite('e');
      k = j + 1;
      if (lookup()) /*
                     * remove -ition and add `e', and check against the
                     * dictionary
                     */
      return; /* (e.g., definition->define, opposition->oppose) */
      
      /* restore original values */
      word.setLength(j + 1);
      word.append("ition");
      k = old_k;
      // nolookup()
    } else if (endsIn(ation)) {
      word.setLength(j + 3);
      word.unsafeWrite('e');
      k = j + 3;
      if (lookup()) /* remove -ion and add `e', and check against the dictionary */
      return; /* (elmination -> eliminate) */
      
      word.setLength(j + 1);
      word.unsafeWrite('e'); /*
                              * remove -ation and add `e', and check against the
                              * dictionary
                              */
      k = j + 1;
      if (lookup()) return;
      
      word.setLength(j + 1);/*
                             * just remove -ation (resignation->resign) and
                             * check dictionary
                             */
      k = j;
      if (lookup()) return;
      
      /* restore original values */
      word.setLength(j + 1);
      word.append("ation");
      k = old_k;
      // nolookup()
      
    }
    
    /*
     * test -ication after -ation is attempted (e.g., `complication->complicate'
     * rather than `complication->comply')
     */

    if (endsIn(ication)) {
      word.setLength(j + 1);
      word.unsafeWrite('y');
      k = j + 1;
      if (lookup()) /*
                     * remove -ication and add `y', and check against the
                     * dictionary
                     */
      return; /* (e.g., amplification -> amplify) */
      
      /* restore original values */
      word.setLength(j + 1);
      word.append("ication");
      k = old_k;
      // nolookup()
    }
    
    // if (endsIn(ion)) {
    if (true) { // we checked for this earlier... just need to set "j"
      j = k - 3; // YCS
      
      word.setLength(j + 1);
      word.unsafeWrite('e');
      k = j + 1;
      if (lookup()) /* remove -ion and add `e', and check against the dictionary */
      return;
      
      word.setLength(j + 1);
      k = j;
      if (lookup()) /* remove -ion, and if it's found, treat that as the root */
      return;
      
      /* restore original values */
      word.setLength(j + 1);
      word.append("ion");
      k = old_k;
      // nolookup()
    }
    
    // nolookup(); all of the other paths restored original values
    return;
  }
*
YCS: this was the one place where lookup was not followed by return.
So restructure it. if ((j>0)&&(lookup(word.toString())) &&
!((word.charAt(j) == 's') && (word.charAt(j-1) == 's'))) return;
***
linguistics/src/main/java/com/yahoo/language/simple/kstem/KStemmer.java