private void lyEndings() {
    int old_k = k;
    
    if (endsIn('l', 'y')) {
      
      word.setCharAt(j + 2, 'e'); /* try converting -ly to -le */
      
      if (lookup()) return;
      word.setCharAt(j + 2, 'y');
      
      word.setLength(j + 1); /* try just removing the -ly */
      k = j;
      
      if (lookup()) return;
      
      if ((j > 0) && (word.charAt(j - 1) == 'a') && (word.charAt(j) == 'l')) /*
                                                                              * always
                                                                              * convert
                                                                              * -
                                                                              * ally
                                                                              * to
                                                                              * -
                                                                              * al
                                                                              */
      return;
      word.append("ly");
      k = old_k;
      
      if ((j > 0) && (word.charAt(j - 1) == 'a') && (word.charAt(j) == 'b')) { // always convert 'ably' to 'able'
        word.setCharAt(j + 2, 'e');
        k = j + 2;
        return;
      }
      
      if (word.charAt(j) == 'i') { /* e.g., militarily -> military */
        word.setLength(j);
        word.unsafeWrite('y');
        k = j;
        if (lookup()) return;
        word.setLength(j);
        word.append("ily");
        k = old_k;
      }
      
      word.setLength(j + 1); /* the default is to remove -ly */
      
      k = j;
      // nolookup()... we already tried removing the "ly" variant
    }
    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